Re: [PATCH nft] tests: shell: Allow wrappers to be passed as nft command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 14, 2020 at 11:41:37PM +0200, Stefano Brivio wrote:
> The current check on $NFT only allows to directly pass an executable,
> so I've been commenting it out locally for a while to run tests with
> valgrind.
> 
> Instead of using the -x test, run nft without arguments and check the
> exit status. POSIX.1-2017, Shell and Utilities volume, par. 2.8.2
> ("Exit Status for Commands") states:
> 
>   If a command is not found, the exit status shall be 127. If the
>   command name is found, but it is not an executable utility, the
>   exit status shall be 126. Applications that invoke utilities
>   without using the shell should use these exit status values to
>   report similar errors.
> 
> While this script isn't POSIX-compliant, it requires bash, and any
> modern version of bash complies with those exit status requirements.
> Also valgrind complies with this.
> 
> We need to quote the NFT variable passed to execute the commands in
> the main loop and adjust error and informational messages, too.
> 
> This way, for example, export NFT="valgrind nft" can be issued to
> run tests with valgrind.

Applied, thanks.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux