aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Reiner Herrmann <reiner@reiner-h.de>2018-10-01 14:23:24 +0200
committerLibravatar Reiner Herrmann <reiner@reiner-h.de>2018-10-01 14:23:24 +0200
commitdf1831299fab8afaba4dbadf05a8355b20c91ab0 (patch)
tree42c2df1bf19763b90dda456ec988fa12486f4824
parentfs_whitelist: reduce number of loop iterations (diff)
downloadfirejail-df1831299fab8afaba4dbadf05a8355b20c91ab0.tar.gz
firejail-df1831299fab8afaba4dbadf05a8355b20c91ab0.tar.zst
firejail-df1831299fab8afaba4dbadf05a8355b20c91ab0.zip
tests: skip audit.exp if tests are already running in a pid namespace
-rwxr-xr-xtest/utils/shutdown.exp8
-rwxr-xr-xtest/utils/utils.sh8
2 files changed, 10 insertions, 6 deletions
diff --git a/test/utils/shutdown.exp b/test/utils/shutdown.exp
index 1d4dc9ae4..15a74f8c8 100755
--- a/test/utils/shutdown.exp
+++ b/test/utils/shutdown.exp
@@ -20,7 +20,7 @@ send -- "stty -echo\r"
20after 100 20after 100
21send -- "firejail --shutdown=shutdowntesting; echo done\r" 21send -- "firejail --shutdown=shutdowntesting; echo done\r"
22expect { 22expect {
23 timeout {puts "TESTING ERROR 4\n";exit} 23 timeout {puts "TESTING ERROR 1\n";exit}
24 "done" 24 "done"
25} 25}
26sleep 5 26sleep 5
@@ -28,15 +28,15 @@ sleep 5
28spawn $env(SHELL) 28spawn $env(SHELL)
29send -- "firejail --list;echo done\r" 29send -- "firejail --list;echo done\r"
30expect { 30expect {
31 timeout {puts "TESTING ERROR 5\n";exit} 31 timeout {puts "TESTING ERROR 2\n";exit}
32 "shutdowntesting" {puts "TESTING ERROR 6\n";exit} 32 "shutdowntesting" {puts "TESTING ERROR 3\n";exit}
33 "done" 33 "done"
34} 34}
35sleep 1 35sleep 1
36 36
37send -- "firejail --shutdown=sutdowntesting\r" 37send -- "firejail --shutdown=sutdowntesting\r"
38expect { 38expect {
39 timeout {puts "TESTING ERROR 5\n";exit} 39 timeout {puts "TESTING ERROR 4\n";exit}
40 "cannot find sandbox sutdowntesting" 40 "cannot find sandbox sutdowntesting"
41} 41}
42after 100 42after 100
diff --git a/test/utils/utils.sh b/test/utils/utils.sh
index c3d4a0dcf..f819c3c01 100755
--- a/test/utils/utils.sh
+++ b/test/utils/utils.sh
@@ -21,8 +21,12 @@ rm -f ~/firejail-test-file-7699
21rm -f /tmp/firejail-test-file-7699 21rm -f /tmp/firejail-test-file-7699
22rm -f /var/tmp/firejail-test-file-7699 22rm -f /var/tmp/firejail-test-file-7699
23 23
24echo "TESTING: audit (test/utils/audit.exp)" 24if [ $(readlink /proc/self) -lt 100 ]; then
25./audit.exp 25 echo "TESTING SKIP: already running in pid namespace (test/utils/audit.exp)"
26else
27 echo "TESTING: audit (test/utils/audit.exp)"
28 ./audit.exp
29fi
26 30
27echo "TESTING: name (test/utils/name.exp)" 31echo "TESTING: name (test/utils/name.exp)"
28./name.exp 32./name.exp