From df1831299fab8afaba4dbadf05a8355b20c91ab0 Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Mon, 1 Oct 2018 14:23:24 +0200 Subject: tests: skip audit.exp if tests are already running in a pid namespace --- test/utils/shutdown.exp | 8 ++++---- test/utils/utils.sh | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'test/utils') 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" after 100 send -- "firejail --shutdown=shutdowntesting; echo done\r" expect { - timeout {puts "TESTING ERROR 4\n";exit} + timeout {puts "TESTING ERROR 1\n";exit} "done" } sleep 5 @@ -28,15 +28,15 @@ sleep 5 spawn $env(SHELL) send -- "firejail --list;echo done\r" expect { - timeout {puts "TESTING ERROR 5\n";exit} - "shutdowntesting" {puts "TESTING ERROR 6\n";exit} + timeout {puts "TESTING ERROR 2\n";exit} + "shutdowntesting" {puts "TESTING ERROR 3\n";exit} "done" } sleep 1 send -- "firejail --shutdown=sutdowntesting\r" expect { - timeout {puts "TESTING ERROR 5\n";exit} + timeout {puts "TESTING ERROR 4\n";exit} "cannot find sandbox sutdowntesting" } after 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 rm -f /tmp/firejail-test-file-7699 rm -f /var/tmp/firejail-test-file-7699 -echo "TESTING: audit (test/utils/audit.exp)" -./audit.exp +if [ $(readlink /proc/self) -lt 100 ]; then + echo "TESTING SKIP: already running in pid namespace (test/utils/audit.exp)" +else + echo "TESTING: audit (test/utils/audit.exp)" + ./audit.exp +fi echo "TESTING: name (test/utils/name.exp)" ./name.exp -- cgit v1.2.3-70-g09d2