diff options
author | netblue30 <netblue30@yahoo.com> | 2016-05-05 18:16:03 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-05-05 18:16:03 -0400 |
commit | f8ad9c20bbbc5018927598c23532e33851b74d60 (patch) | |
tree | fce89e52f67388c228039d5c9efdae8d069f2813 /test | |
parent | Merge pull request #499 from reinerh/master (diff) | |
download | firejail-f8ad9c20bbbc5018927598c23532e33851b74d60.tar.gz firejail-f8ad9c20bbbc5018927598c23532e33851b74d60.tar.zst firejail-f8ad9c20bbbc5018927598c23532e33851b74d60.zip |
test fixes
Diffstat (limited to 'test')
-rwxr-xr-x | test/apps-x11/apps-x11.sh | 17 | ||||
-rwxr-xr-x | test/filters/seccomp-dualfilter.exp | 21 | ||||
-rwxr-xr-x | test/fs/fs.sh | 1 | ||||
-rwxr-xr-x | test/fs/private-whitelist.exp | 10 | ||||
-rwxr-xr-x | test/fs/private.exp | 43 |
5 files changed, 40 insertions, 52 deletions
diff --git a/test/apps-x11/apps-x11.sh b/test/apps-x11/apps-x11.sh index b01c37d0f..a8556ab8f 100755 --- a/test/apps-x11/apps-x11.sh +++ b/test/apps-x11/apps-x11.sh | |||
@@ -6,6 +6,23 @@ | |||
6 | export MALLOC_CHECK_=3 | 6 | export MALLOC_CHECK_=3 |
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | 7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) |
8 | 8 | ||
9 | # check xpra/xephyr | ||
10 | which xpra | ||
11 | if [ "$?" -eq 0 ]; | ||
12 | then | ||
13 | echo "xpra found" | ||
14 | else | ||
15 | echo "xpra not found" | ||
16 | which xephyr | ||
17 | if [ "$?" -eq 0 ]; | ||
18 | then | ||
19 | echo "xephyr found" | ||
20 | else | ||
21 | echo "TESTING SKIP: xpra and/or xephyr not found" | ||
22 | exit | ||
23 | fi | ||
24 | fi | ||
25 | |||
9 | which xterm | 26 | which xterm |
10 | if [ "$?" -eq 0 ]; | 27 | if [ "$?" -eq 0 ]; |
11 | then | 28 | then |
diff --git a/test/filters/seccomp-dualfilter.exp b/test/filters/seccomp-dualfilter.exp index 7efc117da..c75063672 100755 --- a/test/filters/seccomp-dualfilter.exp +++ b/test/filters/seccomp-dualfilter.exp | |||
@@ -3,10 +3,23 @@ | |||
3 | # Copyright (C) 2014-2016 Firejail Authors | 3 | # Copyright (C) 2014-2016 Firejail Authors |
4 | # License GPL v2 | 4 | # License GPL v2 |
5 | 5 | ||
6 | set timeout 10 | 6 | set timeout 1 |
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | send -- "./syscall_test\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING SKIP: 64-bit support missing\n";exit} | ||
13 | "Usage" | ||
14 | } | ||
15 | |||
16 | send -- "./syscall_test32\r" | ||
17 | expect { | ||
18 | timeout {puts "TESTING SKIP: 32-bit support missing\n";exit} | ||
19 | "Usage" | ||
20 | } | ||
21 | |||
22 | set timeout 10 | ||
10 | send -- "firejail ./syscall_test mount\r" | 23 | send -- "firejail ./syscall_test mount\r" |
11 | expect { | 24 | expect { |
12 | timeout {puts "TESTING ERROR 0\n";exit} | 25 | timeout {puts "TESTING ERROR 0\n";exit} |
@@ -18,7 +31,7 @@ expect { | |||
18 | } | 31 | } |
19 | expect { | 32 | expect { |
20 | timeout {puts "TESTING ERROR 2\n";exit} | 33 | timeout {puts "TESTING ERROR 2\n";exit} |
21 | "after mount" {puts "TESTING ERROR 2.1\n";exit} | 34 | "after mount" {puts "TESTING ERROR 3\n";exit} |
22 | "Parent is shutting down" | 35 | "Parent is shutting down" |
23 | } | 36 | } |
24 | sleep 1 | 37 | sleep 1 |
@@ -26,8 +39,6 @@ sleep 1 | |||
26 | send -- "firejail ./syscall_test32 mount\r" | 39 | send -- "firejail ./syscall_test32 mount\r" |
27 | expect { | 40 | expect { |
28 | timeout {puts "TESTING ERROR 4\n";exit} | 41 | timeout {puts "TESTING ERROR 4\n";exit} |
29 | "No such file or directory" {puts "\nTESTING SKIP 3: can't execute 32 bit binary\n"; exit} | ||
30 | "Parent is shutting down, bye" {puts "\nTESTING SKIP 3: can't execute 32 bit binary\n"; exit} | ||
31 | "Child process initialized" | 42 | "Child process initialized" |
32 | } | 43 | } |
33 | expect { | 44 | expect { |
@@ -36,7 +47,7 @@ expect { | |||
36 | } | 47 | } |
37 | expect { | 48 | expect { |
38 | timeout {puts "TESTING ERROR 6\n";exit} | 49 | timeout {puts "TESTING ERROR 6\n";exit} |
39 | "after mount" {puts "TESTING ERROR 6.1\n";exit} | 50 | "after mount" {puts "TESTING ERROR 7\n";exit} |
40 | "Parent is shutting down" | 51 | "Parent is shutting down" |
41 | } | 52 | } |
42 | 53 | ||
diff --git a/test/fs/fs.sh b/test/fs/fs.sh index 425af45a6..0fcffcb8e 100755 --- a/test/fs/fs.sh +++ b/test/fs/fs.sh | |||
@@ -31,7 +31,6 @@ echo "TESTING: whitelist empty (test/fs/whitelist-empty.exp)" | |||
31 | ./whitelist-empty.exp | 31 | ./whitelist-empty.exp |
32 | 32 | ||
33 | echo "TESTING: private whitelist (test/fs/private-whitelist.exp)" | 33 | echo "TESTING: private whitelist (test/fs/private-whitelist.exp)" |
34 | echo "TESTING: (failing on OpenSUSE)" | ||
35 | ./private-whitelist.exp | 34 | ./private-whitelist.exp |
36 | 35 | ||
37 | echo "TESTING: invalid filename (test/fs/invalid_filename.exp)" | 36 | echo "TESTING: invalid filename (test/fs/invalid_filename.exp)" |
diff --git a/test/fs/private-whitelist.exp b/test/fs/private-whitelist.exp index a3d60369a..4dadeacb1 100755 --- a/test/fs/private-whitelist.exp +++ b/test/fs/private-whitelist.exp | |||
@@ -12,26 +12,28 @@ expect { | |||
12 | timeout {puts "TESTING ERROR 1\n";exit} | 12 | timeout {puts "TESTING ERROR 1\n";exit} |
13 | "Child process initialized" | 13 | "Child process initialized" |
14 | } | 14 | } |
15 | sleep 1 | 15 | after 100 |
16 | 16 | ||
17 | send -- "ls -al /tmp\r" | 17 | send -- "ls -al /tmp\r" |
18 | expect { | 18 | expect { |
19 | timeout {puts "TESTING ERROR 2\n";exit} | 19 | timeout {puts "TESTING ERROR 2\n";exit} |
20 | ".X11-unix" | 20 | ".X11-unix" |
21 | } | 21 | } |
22 | sleep 1 | 22 | after 100 |
23 | 23 | ||
24 | send -- "ls -a /tmp | wc -l\r" | 24 | send -- "ls -a /tmp | wc -l\r" |
25 | expect { | 25 | expect { |
26 | timeout {puts "TESTING ERROR 3\n";exit} | 26 | timeout {puts "TESTING ERROR 3\n";exit} |
27 | "3" | 27 | "3" |
28 | } | 28 | } |
29 | sleep 1 | 29 | after 100 |
30 | 30 | ||
31 | send -- "ls -a ~ | wc -l\r" | 31 | send -- "ls -a ~ | wc -l\r" |
32 | expect { | 32 | expect { |
33 | timeout {puts "TESTING ERROR 4\n";exit} | 33 | timeout {puts "TESTING ERROR 4\n";exit} |
34 | "5" | 34 | "3" {puts "3\n"} |
35 | "4" {puts "4\n"} | ||
36 | "5" {puts "5\n"} | ||
35 | } | 37 | } |
36 | 38 | ||
37 | sleep 1 | 39 | sleep 1 |
diff --git a/test/fs/private.exp b/test/fs/private.exp index 01f04d3cb..7eee0c82b 100755 --- a/test/fs/private.exp +++ b/test/fs/private.exp | |||
@@ -38,49 +38,8 @@ expect { | |||
38 | } | 38 | } |
39 | expect { | 39 | expect { |
40 | timeout {puts "TESTING ERROR 3\n";exit} | 40 | timeout {puts "TESTING ERROR 3\n";exit} |
41 | [lindex $argv 0] | 41 | done |
42 | } | 42 | } |
43 | send -- "ls -al; echo done\r" | ||
44 | expect { | ||
45 | timeout { | ||
46 | # OpenSUSE doesn't use .Xauthority from user done directory | ||
47 | send -- "env | grep XAUTHORITY\r" | ||
48 | |||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 4\n";exit} | ||
51 | "/run/lightdm/netblue/xauthority" | ||
52 | } | ||
53 | } | ||
54 | ".Xauthority" | ||
55 | } | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 5\n";exit} | ||
58 | [lindex $argv 0] | ||
59 | } | ||
60 | |||
61 | |||
62 | # testing private only | ||
63 | send -- "bash\r" | ||
64 | sleep 1 | ||
65 | # owner /done/netblue | ||
66 | send -- "ls -l /done;echo done\r" | ||
67 | expect { | ||
68 | timeout {puts "TESTING ERROR 6\n";exit} | ||
69 | [lindex $argv 0] | ||
70 | } | ||
71 | expect { | ||
72 | timeout {puts "TESTING ERROR 7\n";exit} | ||
73 | [lindex $argv 0] | ||
74 | } | ||
75 | expect { | ||
76 | timeout {puts "TESTING ERROR 8\n";exit} | ||
77 | [lindex $argv 0] | ||
78 | } | ||
79 | expect { | ||
80 | timeout {puts "TESTING ERROR 9\n";exit} | ||
81 | "done" | ||
82 | } | ||
83 | sleep 1 | ||
84 | 43 | ||
85 | # owner /tmp | 44 | # owner /tmp |
86 | send -- "stat -c %U%a /tmp;echo done\r" | 45 | send -- "stat -c %U%a /tmp;echo done\r" |