From e04d6b7bf58a95105a8fc79fcde7c0e98875e72a Mon Sep 17 00:00:00 2001 From: a1346054 <36859588+a1346054@users.noreply.github.com> Date: Tue, 13 Sep 2022 18:42:15 +0000 Subject: tests: directly test for presence of command Test directly for presence of command instead of indirectly testing the return code. Additionally: * uses a shell builtin `command -v` instead of external `which` * `command -v` is the standardized version of `which` --- test/filters/filters.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/filters') diff --git a/test/filters/filters.sh b/test/filters/filters.sh index 04d7080d6..1c6b812ff 100755 --- a/test/filters/filters.sh +++ b/test/filters/filters.sh @@ -96,8 +96,7 @@ echo "TESTING: seccomp errno (test/filters/seccomp-errno.exp)" echo "TESTING: seccomp su (test/filters/seccomp-su.exp)" ./seccomp-su.exp -which strace 2>/dev/null -if [ $? -eq 0 ]; then +if command -v strace; then echo "TESTING: seccomp ptrace (test/filters/seccomp-ptrace.exp)" ./seccomp-ptrace.exp else -- cgit v1.2.3-54-g00ecf