aboutsummaryrefslogtreecommitdiffstats
path: root/test/apps-x11/apps-x11.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/apps-x11/apps-x11.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/apps-x11/apps-x11.sh')
-rwxr-xr-xtest/apps-x11/apps-x11.sh27
1 files changed, 9 insertions, 18 deletions
diff --git a/test/apps-x11/apps-x11.sh b/test/apps-x11/apps-x11.sh
index a3c946ca4..9f8102738 100755
--- a/test/apps-x11/apps-x11.sh
+++ b/test/apps-x11/apps-x11.sh
@@ -11,21 +11,18 @@ echo "TESTING: no x11 (test/apps-x11/x11-none.exp)"
11./x11-none.exp 11./x11-none.exp
12 12
13 13
14which xterm 2>/dev/null 14if command -v xterm
15if [ "$?" -eq 0 ];
16then 15then
17 echo "TESTING: xterm x11 xorg" 16 echo "TESTING: xterm x11 xorg"
18 ./xterm-xorg.exp 17 ./xterm-xorg.exp
19 18
20 which xpra 2>/dev/null 19 if command -v xpra
21 if [ "$?" -eq 0 ];
22 then 20 then
23 echo "TESTING: xterm x11 xpra" 21 echo "TESTING: xterm x11 xpra"
24 ./xterm-xpra.exp 22 ./xterm-xpra.exp
25 fi 23 fi
26 24
27 which Xephyr 2>/dev/null 25 if command -v Xephyr
28 if [ "$?" -eq 0 ];
29 then 26 then
30 echo "TESTING: xterm x11 xephyr" 27 echo "TESTING: xterm x11 xephyr"
31 ./xterm-xephyr.exp 28 ./xterm-xephyr.exp
@@ -35,14 +32,12 @@ else
35fi 32fi
36 33
37# check xpra/xephyr 34# check xpra/xephyr
38which xpra 2>/dev/null 35if command -v xpra
39if [ "$?" -eq 0 ];
40then 36then
41 echo "xpra found" 37 echo "xpra found"
42else 38else
43 echo "xpra not found" 39 echo "xpra not found"
44 which Xephyr 2>/dev/null 40 if command -v Xephyr
45 if [ "$?" -eq 0 ];
46 then 41 then
47 echo "Xephyr found" 42 echo "Xephyr found"
48 else 43 else
@@ -51,8 +46,7 @@ else
51 fi 46 fi
52fi 47fi
53 48
54which firefox 2>/dev/null 49if command -v firefox
55if [ "$?" -eq 0 ];
56then 50then
57 echo "TESTING: firefox x11" 51 echo "TESTING: firefox x11"
58 ./firefox.exp 52 ./firefox.exp
@@ -60,8 +54,7 @@ else
60 echo "TESTING SKIP: firefox not found" 54 echo "TESTING SKIP: firefox not found"
61fi 55fi
62 56
63which chromium 2>/dev/null 57if command -v chromium
64if [ "$?" -eq 0 ];
65then 58then
66 echo "TESTING: chromium x11" 59 echo "TESTING: chromium x11"
67 ./chromium.exp 60 ./chromium.exp
@@ -69,8 +62,7 @@ else
69 echo "TESTING SKIP: chromium not found" 62 echo "TESTING SKIP: chromium not found"
70fi 63fi
71 64
72which transmission-gtk 2>/dev/null 65if command -v transmission-gtk
73if [ "$?" -eq 0 ];
74then 66then
75 echo "TESTING: transmission-gtk x11" 67 echo "TESTING: transmission-gtk x11"
76 ./transmission-gtk.exp 68 ./transmission-gtk.exp
@@ -78,8 +70,7 @@ else
78 echo "TESTING SKIP: transmission-gtk not found" 70 echo "TESTING SKIP: transmission-gtk not found"
79fi 71fi
80 72
81which thunderbird 2>/dev/null 73if command -v thunderbird
82if [ "$?" -eq 0 ];
83then 74then
84 echo "TESTING: thunderbird x11" 75 echo "TESTING: thunderbird x11"
85 ./thunderbird.exp 76 ./thunderbird.exp