aboutsummaryrefslogtreecommitdiffstats
path: root/test/apps-x11-xorg
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/apps-x11-xorg
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/apps-x11-xorg')
-rwxr-xr-xtest/apps-x11-xorg/apps-x11-xorg.sh12
1 files changed, 4 insertions, 8 deletions
diff --git a/test/apps-x11-xorg/apps-x11-xorg.sh b/test/apps-x11-xorg/apps-x11-xorg.sh
index 9ed123979..9dcee7aff 100755
--- a/test/apps-x11-xorg/apps-x11-xorg.sh
+++ b/test/apps-x11-xorg/apps-x11-xorg.sh
@@ -7,8 +7,7 @@ export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8export LC_ALL=C 8export LC_ALL=C
9 9
10which firefox 2>/dev/null 10if command -v firefox
11if [ "$?" -eq 0 ];
12then 11then
13 echo "TESTING: firefox x11 xorg" 12 echo "TESTING: firefox x11 xorg"
14 ./firefox.exp 13 ./firefox.exp
@@ -16,8 +15,7 @@ else
16 echo "TESTING SKIP: firefox not found" 15 echo "TESTING SKIP: firefox not found"
17fi 16fi
18 17
19which transmission-gtk 2>/dev/null 18if command -v transmission-gtk
20if [ "$?" -eq 0 ];
21then 19then
22 echo "TESTING: transmission-gtk x11 xorg" 20 echo "TESTING: transmission-gtk x11 xorg"
23 ./transmission-gtk.exp 21 ./transmission-gtk.exp
@@ -25,8 +23,7 @@ else
25 echo "TESTING SKIP: transmission-gtk not found" 23 echo "TESTING SKIP: transmission-gtk not found"
26fi 24fi
27 25
28which transmission-qt 2>/dev/null 26if command -v transmission-qt
29if [ "$?" -eq 0 ];
30then 27then
31 echo "TESTING: transmission-qt x11 xorg" 28 echo "TESTING: transmission-qt x11 xorg"
32 ./transmission-qt.exp 29 ./transmission-qt.exp
@@ -34,8 +31,7 @@ else
34 echo "TESTING SKIP: transmission-qt not found" 31 echo "TESTING SKIP: transmission-qt not found"
35fi 32fi
36 33
37which thunderbird 2>/dev/null 34if command -v thunderbird
38if [ "$?" -eq 0 ];
39then 35then
40 echo "TESTING: thunderbird x11 xorg" 36 echo "TESTING: thunderbird x11 xorg"
41 ./thunderbird.exp 37 ./thunderbird.exp