diff options
author | netblue30 <netblue30@yahoo.com> | 2016-04-28 08:45:55 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-04-28 08:45:55 -0400 |
commit | fec1100836a007c49b81e1dbf5185345d09d0883 (patch) | |
tree | 81beb5d2d2408c1081c566bb11149cf15e007a11 /test | |
parent | testing (diff) | |
parent | Make some tests more robust (diff) | |
download | firejail-fec1100836a007c49b81e1dbf5185345d09d0883.tar.gz firejail-fec1100836a007c49b81e1dbf5185345d09d0883.tar.zst firejail-fec1100836a007c49b81e1dbf5185345d09d0883.zip |
Merge pull request #486 from reinerh/master
Make some tests more robust
Diffstat (limited to 'test')
-rwxr-xr-x | test/apps-x11/apps-x11.sh | 2 | ||||
-rwxr-xr-x | test/environment/csh.exp | 1 | ||||
-rwxr-xr-x | test/environment/dash.exp | 1 | ||||
-rwxr-xr-x | test/environment/environment.sh | 10 | ||||
-rwxr-xr-x | test/environment/nice.exp | 8 | ||||
-rwxr-xr-x | test/environment/rlimit-profile.exp | 1 | ||||
-rwxr-xr-x | test/environment/rlimit.exp | 1 | ||||
-rwxr-xr-x | test/environment/zsh.exp | 1 | ||||
-rwxr-xr-x | test/utils/join.exp | 1 | ||||
-rwxr-xr-x | test/utils/join2.exp | 1 | ||||
-rwxr-xr-x | test/utils/join3.exp | 1 | ||||
-rwxr-xr-x | test/utils/shutdown.exp | 1 | ||||
-rwxr-xr-x | test/utils/utils.sh | 26 |
13 files changed, 40 insertions, 15 deletions
diff --git a/test/apps-x11/apps-x11.sh b/test/apps-x11/apps-x11.sh index 938d4c993..2182c90a2 100755 --- a/test/apps-x11/apps-x11.sh +++ b/test/apps-x11/apps-x11.sh | |||
@@ -48,6 +48,6 @@ then | |||
48 | echo "TESTING: icedove x11" | 48 | echo "TESTING: icedove x11" |
49 | ./icedove.exp | 49 | ./icedove.exp |
50 | else | 50 | else |
51 | echo "TESTING: icedovenot found" | 51 | echo "TESTING: icedove not found" |
52 | fi | 52 | fi |
53 | 53 | ||
diff --git a/test/environment/csh.exp b/test/environment/csh.exp index 10ad3607e..7fd69ed43 100755 --- a/test/environment/csh.exp +++ b/test/environment/csh.exp | |||
@@ -4,6 +4,7 @@ | |||
4 | # License GPL v2 | 4 | # License GPL v2 |
5 | 5 | ||
6 | set timeout 10 | 6 | set timeout 10 |
7 | cd /home | ||
7 | spawn $env(SHELL) | 8 | spawn $env(SHELL) |
8 | match_max 100000 | 9 | match_max 100000 |
9 | 10 | ||
diff --git a/test/environment/dash.exp b/test/environment/dash.exp index f5a60719e..d727d302e 100755 --- a/test/environment/dash.exp +++ b/test/environment/dash.exp | |||
@@ -1,6 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | 2 | ||
3 | set timeout 10 | 3 | set timeout 10 |
4 | cd /home | ||
4 | spawn $env(SHELL) | 5 | spawn $env(SHELL) |
5 | match_max 100000 | 6 | match_max 100000 |
6 | 7 | ||
diff --git a/test/environment/environment.sh b/test/environment/environment.sh index ede5735c6..9164b43a2 100755 --- a/test/environment/environment.sh +++ b/test/environment/environment.sh | |||
@@ -51,8 +51,14 @@ echo "TESTING: firejail in firejail - single sandbox (test/environment/firejail- | |||
51 | echo "TESTING: firejail in firejail - force new sandbox (test/environment/firejail-in-firejail2.exp)" | 51 | echo "TESTING: firejail in firejail - force new sandbox (test/environment/firejail-in-firejail2.exp)" |
52 | ./firejail-in-firejail2.exp | 52 | ./firejail-in-firejail2.exp |
53 | 53 | ||
54 | echo "TESTING: sound (test/environment/sound.exp)" | 54 | which aplay |
55 | ./sound.exp | 55 | if [ "$?" -eq 0 ]; |
56 | then | ||
57 | echo "TESTING: sound (test/environment/sound.exp)" | ||
58 | ./sound.exp | ||
59 | else | ||
60 | echo "TESTING: aplay not found" | ||
61 | fi | ||
56 | 62 | ||
57 | echo "TESTING: nice (test/environment/nice.exp)" | 63 | echo "TESTING: nice (test/environment/nice.exp)" |
58 | ./nice.exp | 64 | ./nice.exp |
diff --git a/test/environment/nice.exp b/test/environment/nice.exp index 7e5731c63..3a5db71c8 100755 --- a/test/environment/nice.exp +++ b/test/environment/nice.exp | |||
@@ -17,7 +17,7 @@ sleep 1 | |||
17 | send -- "top -b -n 1\r" | 17 | send -- "top -b -n 1\r" |
18 | expect { | 18 | expect { |
19 | timeout {puts "TESTING ERROR 1\n";exit} | 19 | timeout {puts "TESTING ERROR 1\n";exit} |
20 | "netblue" | 20 | $env(USER) |
21 | } | 21 | } |
22 | expect { | 22 | expect { |
23 | timeout {puts "TESTING ERROR 2\n";exit} | 23 | timeout {puts "TESTING ERROR 2\n";exit} |
@@ -29,7 +29,7 @@ expect { | |||
29 | } | 29 | } |
30 | expect { | 30 | expect { |
31 | timeout {puts "TESTING ERROR 4\n";exit} | 31 | timeout {puts "TESTING ERROR 4\n";exit} |
32 | "netblu" | 32 | $env(USER) |
33 | } | 33 | } |
34 | expect { | 34 | expect { |
35 | timeout {puts "TESTING ERROR 5\n";exit} | 35 | timeout {puts "TESTING ERROR 5\n";exit} |
@@ -54,7 +54,7 @@ sleep 1 | |||
54 | send -- "top -b -n 1\r" | 54 | send -- "top -b -n 1\r" |
55 | expect { | 55 | expect { |
56 | timeout {puts "TESTING ERROR 11\n";exit} | 56 | timeout {puts "TESTING ERROR 11\n";exit} |
57 | "netblue" | 57 | $env(USER) |
58 | } | 58 | } |
59 | expect { | 59 | expect { |
60 | timeout {puts "TESTING ERROR 12\n";exit} | 60 | timeout {puts "TESTING ERROR 12\n";exit} |
@@ -66,7 +66,7 @@ expect { | |||
66 | } | 66 | } |
67 | expect { | 67 | expect { |
68 | timeout {puts "TESTING ERROR 14\n";exit} | 68 | timeout {puts "TESTING ERROR 14\n";exit} |
69 | "netblu" | 69 | $env(USER) |
70 | } | 70 | } |
71 | expect { | 71 | expect { |
72 | timeout {puts "TESTING ERROR 15\n";exit} | 72 | timeout {puts "TESTING ERROR 15\n";exit} |
diff --git a/test/environment/rlimit-profile.exp b/test/environment/rlimit-profile.exp index 7d2637444..aed634201 100755 --- a/test/environment/rlimit-profile.exp +++ b/test/environment/rlimit-profile.exp | |||
@@ -1,6 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | 2 | ||
3 | set timeout 10 | 3 | set timeout 10 |
4 | cd /home | ||
4 | spawn $env(SHELL) | 5 | spawn $env(SHELL) |
5 | match_max 100000 | 6 | match_max 100000 |
6 | 7 | ||
diff --git a/test/environment/rlimit.exp b/test/environment/rlimit.exp index 17d2bd9d1..680520b33 100755 --- a/test/environment/rlimit.exp +++ b/test/environment/rlimit.exp | |||
@@ -1,6 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | 2 | ||
3 | set timeout 10 | 3 | set timeout 10 |
4 | cd /home | ||
4 | spawn $env(SHELL) | 5 | spawn $env(SHELL) |
5 | match_max 100000 | 6 | match_max 100000 |
6 | 7 | ||
diff --git a/test/environment/zsh.exp b/test/environment/zsh.exp index 2604b2be5..96fa84dfe 100755 --- a/test/environment/zsh.exp +++ b/test/environment/zsh.exp | |||
@@ -4,6 +4,7 @@ | |||
4 | # License GPL v2 | 4 | # License GPL v2 |
5 | 5 | ||
6 | set timeout 10 | 6 | set timeout 10 |
7 | cd /home | ||
7 | spawn $env(SHELL) | 8 | spawn $env(SHELL) |
8 | match_max 100000 | 9 | match_max 100000 |
9 | 10 | ||
diff --git a/test/utils/join.exp b/test/utils/join.exp index fc94a22c3..e1cd37fcb 100755 --- a/test/utils/join.exp +++ b/test/utils/join.exp | |||
@@ -4,6 +4,7 @@ | |||
4 | # License GPL v2 | 4 | # License GPL v2 |
5 | 5 | ||
6 | set timeout 10 | 6 | set timeout 10 |
7 | cd /home | ||
7 | spawn $env(SHELL) | 8 | spawn $env(SHELL) |
8 | match_max 100000 | 9 | match_max 100000 |
9 | 10 | ||
diff --git a/test/utils/join2.exp b/test/utils/join2.exp index 749e8900f..820c43174 100755 --- a/test/utils/join2.exp +++ b/test/utils/join2.exp | |||
@@ -4,6 +4,7 @@ | |||
4 | # License GPL v2 | 4 | # License GPL v2 |
5 | 5 | ||
6 | set timeout 10 | 6 | set timeout 10 |
7 | cd /home | ||
7 | spawn $env(SHELL) | 8 | spawn $env(SHELL) |
8 | match_max 100000 | 9 | match_max 100000 |
9 | 10 | ||
diff --git a/test/utils/join3.exp b/test/utils/join3.exp index 0a686bc36..96d3e5186 100755 --- a/test/utils/join3.exp +++ b/test/utils/join3.exp | |||
@@ -4,6 +4,7 @@ | |||
4 | # License GPL v2 | 4 | # License GPL v2 |
5 | 5 | ||
6 | set timeout 10 | 6 | set timeout 10 |
7 | cd /home | ||
7 | spawn $env(SHELL) | 8 | spawn $env(SHELL) |
8 | match_max 100000 | 9 | match_max 100000 |
9 | 10 | ||
diff --git a/test/utils/shutdown.exp b/test/utils/shutdown.exp index 135f42d28..ca321b3c9 100755 --- a/test/utils/shutdown.exp +++ b/test/utils/shutdown.exp | |||
@@ -4,6 +4,7 @@ | |||
4 | # License GPL v2 | 4 | # License GPL v2 |
5 | 5 | ||
6 | set timeout 10 | 6 | set timeout 10 |
7 | cd /home | ||
7 | spawn $env(SHELL) | 8 | spawn $env(SHELL) |
8 | match_max 100000 | 9 | match_max 100000 |
9 | 10 | ||
diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 474c026d1..1e010147d 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh | |||
@@ -12,8 +12,14 @@ echo "TESTING: version (test/utils/version.exp)" | |||
12 | echo "TESTING: help (test/utils/help.exp)" | 12 | echo "TESTING: help (test/utils/help.exp)" |
13 | ./help.exp | 13 | ./help.exp |
14 | 14 | ||
15 | echo "TESTING: man (test/utils/man.exp)" | 15 | which man |
16 | ./man.exp | 16 | if [ "$?" -eq 0 ]; |
17 | then | ||
18 | echo "TESTING: man (test/utils/man.exp)" | ||
19 | ./man.exp | ||
20 | else | ||
21 | echo "TESTING: man not found" | ||
22 | fi | ||
17 | 23 | ||
18 | echo "TESTING: list (test/utils/list.exp)" | 24 | echo "TESTING: list (test/utils/list.exp)" |
19 | ./list.exp | 25 | ./list.exp |
@@ -21,9 +27,13 @@ echo "TESTING: list (test/utils/list.exp)" | |||
21 | echo "TESTING: tree (test/utils/tree.exp)" | 27 | echo "TESTING: tree (test/utils/tree.exp)" |
22 | ./tree.exp | 28 | ./tree.exp |
23 | 29 | ||
24 | echo "TESTING: cpu.print (test/utils/cpu-print.exp)" | 30 | if [ $(grep -c ^processor /proc/cpuinfo) -gt 1 ]; |
25 | echo "TESTING: failing under VirtualBox where there is only one CPU" | 31 | then |
26 | ./cpu-print.exp | 32 | echo "TESTING: cpu.print (test/utils/cpu-print.exp)" |
33 | ./cpu-print.exp | ||
34 | else | ||
35 | echo "TESTING: cpu.print, not enough CPUs" | ||
36 | fi | ||
27 | 37 | ||
28 | echo "TESTING: fs.print (test/utils/fs-print.exp)" | 38 | echo "TESTING: fs.print (test/utils/fs-print.exp)" |
29 | ./fs-print.exp | 39 | ./fs-print.exp |
@@ -52,7 +62,7 @@ echo "TESTING: shutdown3 (test/utils/shutdown3.exp)" | |||
52 | echo "TESTING: shutdown4 (test/utils/shutdown4.exp)" | 62 | echo "TESTING: shutdown4 (test/utils/shutdown4.exp)" |
53 | ./shutdown4.exp | 63 | ./shutdown4.exp |
54 | 64 | ||
55 | echo "TESTING: join test/utils/(join.exp)" | 65 | echo "TESTING: join (test/utils/join.exp)" |
56 | ./join.exp | 66 | ./join.exp |
57 | 67 | ||
58 | echo "TESTING: join2 (test/utils/join2.exp)" | 68 | echo "TESTING: join2 (test/utils/join2.exp)" |
@@ -72,9 +82,9 @@ rm -f index.html* | |||
72 | echo "TESTING: firemon --seccomp (test/utils/seccomp.exp)" | 82 | echo "TESTING: firemon --seccomp (test/utils/seccomp.exp)" |
73 | ./seccomp.exp | 83 | ./seccomp.exp |
74 | 84 | ||
75 | echo "TESTING: firemon --caps (test/ustil/caps.exp)" | 85 | echo "TESTING: firemon --caps (test/utils/caps.exp)" |
76 | ./caps.exp | 86 | ./caps.exp |
77 | 87 | ||
78 | echo "TESTING: file transfer (test/ustil/ls.exp)" | 88 | echo "TESTING: file transfer (test/utils/ls.exp)" |
79 | ./ls.exp | 89 | ./ls.exp |
80 | 90 | ||