aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters/filters.sh
diff options
context:
space:
mode:
authorLibravatar a1346054 <36859588+a1346054@users.noreply.github.com>2022-09-13 18:42:15 +0000
committerLibravatar a1346054 <36859588+a1346054@users.noreply.github.com>2022-09-13 22:37:18 +0000
commite04d6b7bf58a95105a8fc79fcde7c0e98875e72a (patch)
tree6e20913ed5d4af3e1b0ef5a31ef80ee42f651376 /test/filters/filters.sh
parenttests: fix unintentional overwriting of array value (diff)
downloadfirejail-e04d6b7bf58a95105a8fc79fcde7c0e98875e72a.tar.gz
firejail-e04d6b7bf58a95105a8fc79fcde7c0e98875e72a.tar.zst
firejail-e04d6b7bf58a95105a8fc79fcde7c0e98875e72a.zip
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`
Diffstat (limited to 'test/filters/filters.sh')
-rwxr-xr-xtest/filters/filters.sh3
1 files changed, 1 insertions, 2 deletions
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)"
96echo "TESTING: seccomp su (test/filters/seccomp-su.exp)" 96echo "TESTING: seccomp su (test/filters/seccomp-su.exp)"
97./seccomp-su.exp 97./seccomp-su.exp
98 98
99which strace 2>/dev/null 99if command -v strace; then
100if [ $? -eq 0 ]; then
101 echo "TESTING: seccomp ptrace (test/filters/seccomp-ptrace.exp)" 100 echo "TESTING: seccomp ptrace (test/filters/seccomp-ptrace.exp)"
102 ./seccomp-ptrace.exp 101 ./seccomp-ptrace.exp
103else 102else