diff options
-rw-r--r-- | Makefile.in | 5 | ||||
-rwxr-xr-x | test/environment/csh.exp (renamed from test/shell_csh.exp) | 3 | ||||
-rwxr-xr-x | test/environment/dash.exp (renamed from test/shell_dash.exp) | 0 | ||||
-rwxr-xr-x | test/environment/env.exp (renamed from test/env.exp) | 3 | ||||
-rw-r--r-- | test/environment/env.profile (renamed from test/env.profile) | 0 | ||||
-rwxr-xr-x | test/environment/environment.sh | 47 | ||||
-rwxr-xr-x | test/environment/firejail-in-firejail.exp (renamed from test/firejail-in-firejail.exp) | 3 | ||||
-rwxr-xr-x | test/environment/firejail-in-firejail2.exp (renamed from test/firejail-in-firejail2.exp) | 3 | ||||
-rwxr-xr-x | test/environment/rlimit-profile.exp (renamed from test/profile_rlimit.exp) | 0 | ||||
-rwxr-xr-x | test/environment/rlimit.exp (renamed from test/option_rlimit.exp) | 0 | ||||
-rw-r--r-- | test/environment/rlimit.profile (renamed from test/rlimit.profile) | 0 | ||||
-rwxr-xr-x | test/environment/shell-none.exp | 48 | ||||
-rw-r--r-- | test/environment/shell-none.profile | 1 | ||||
-rwxr-xr-x | test/environment/zsh.exp (renamed from test/shell_zsh.exp) | 3 | ||||
-rwxr-xr-x | test/test.sh | 29 | ||||
-rwxr-xr-x | test/utils/utils.sh | 4 |
16 files changed, 117 insertions, 32 deletions
diff --git a/Makefile.in b/Makefile.in index c93fc401d..da339b7ed 100644 --- a/Makefile.in +++ b/Makefile.in | |||
@@ -282,5 +282,8 @@ test-firemon: | |||
282 | test-utils: | 282 | test-utils: |
283 | cd test/utils; ./utils.sh | grep TESTING | 283 | cd test/utils; ./utils.sh | grep TESTING |
284 | 284 | ||
285 | test: test-profiles test-utils test-apps test-apps-x11 test-firemon | 285 | test-environment: |
286 | cd test/environment; ./environment.sh | grep TESTING | ||
287 | |||
288 | test: test-profiles test-utils test-environment test-apps test-apps-x11 test-firemon | ||
286 | echo "TEST COMPLETE" | 289 | echo "TEST COMPLETE" |
diff --git a/test/shell_csh.exp b/test/environment/csh.exp index a2634f633..10ad3607e 100755 --- a/test/shell_csh.exp +++ b/test/environment/csh.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/shell_dash.exp b/test/environment/dash.exp index f5a60719e..f5a60719e 100755 --- a/test/shell_dash.exp +++ b/test/environment/dash.exp | |||
diff --git a/test/env.exp b/test/environment/env.exp index d7aee3c64..a09c3f9c5 100755 --- a/test/env.exp +++ b/test/environment/env.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/env.profile b/test/environment/env.profile index ba66e6210..ba66e6210 100644 --- a/test/env.profile +++ b/test/environment/env.profile | |||
diff --git a/test/environment/environment.sh b/test/environment/environment.sh new file mode 100755 index 000000000..3041fcc12 --- /dev/null +++ b/test/environment/environment.sh | |||
@@ -0,0 +1,47 @@ | |||
1 | #!/bin/bash | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | export MALLOC_CHECK_=3 | ||
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | ||
8 | |||
9 | echo "TESTING: environment variables (test/environment/env.exp)" | ||
10 | ./env.exp | ||
11 | |||
12 | echo "TESTING: shell none(test/environment/shell-none.exp)" | ||
13 | ./shell-none.exp | ||
14 | |||
15 | which dash | ||
16 | if [ "$?" -eq 0 ]; | ||
17 | then | ||
18 | echo "TESTING: dash (test/environment/dash.exp)" | ||
19 | ./dash.exp | ||
20 | else | ||
21 | echo "TESTING: dash not found" | ||
22 | fi | ||
23 | |||
24 | which csh | ||
25 | if [ "$?" -eq 0 ]; | ||
26 | then | ||
27 | echo "TESTING: csh (test/environment/csh.exp)" | ||
28 | ./csh.exp | ||
29 | else | ||
30 | echo "TESTING: csh not found" | ||
31 | fi | ||
32 | |||
33 | which zsh | ||
34 | if [ "$?" -eq 0 ]; | ||
35 | then | ||
36 | echo "TESTING: zsh (test/environment/zsh.exp)" | ||
37 | ./csh.exp | ||
38 | else | ||
39 | echo "TESTING: zsh not found" | ||
40 | fi | ||
41 | |||
42 | echo "TESTING: rlimit (test/environment/rlimit.exp)" | ||
43 | ./rlimit.exp | ||
44 | |||
45 | echo "TESTING: rlimit profile (test/environment/rlimit-profile.exp)" | ||
46 | ./rlimit-profile.exp | ||
47 | |||
diff --git a/test/firejail-in-firejail.exp b/test/environment/firejail-in-firejail.exp index 5ba18d1fa..7e7f4fd17 100755 --- a/test/firejail-in-firejail.exp +++ b/test/environment/firejail-in-firejail.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/firejail-in-firejail2.exp b/test/environment/firejail-in-firejail2.exp index b0fed0dae..5a2213074 100755 --- a/test/firejail-in-firejail2.exp +++ b/test/environment/firejail-in-firejail2.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/profile_rlimit.exp b/test/environment/rlimit-profile.exp index 7d2637444..7d2637444 100755 --- a/test/profile_rlimit.exp +++ b/test/environment/rlimit-profile.exp | |||
diff --git a/test/option_rlimit.exp b/test/environment/rlimit.exp index 17d2bd9d1..17d2bd9d1 100755 --- a/test/option_rlimit.exp +++ b/test/environment/rlimit.exp | |||
diff --git a/test/rlimit.profile b/test/environment/rlimit.profile index 271891c03..271891c03 100644 --- a/test/rlimit.profile +++ b/test/environment/rlimit.profile | |||
diff --git a/test/environment/shell-none.exp b/test/environment/shell-none.exp new file mode 100755 index 000000000..e30008f83 --- /dev/null +++ b/test/environment/shell-none.exp | |||
@@ -0,0 +1,48 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --shell=none\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "shell=none configured, but no program specified" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | send -- "firejail --profile=shell-none.profile\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "shell=none configured, but no program specified" | ||
21 | } | ||
22 | sleep 1 | ||
23 | |||
24 | send -- "firejail --shell=none ls\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 2\n";exit} | ||
27 | "Child process initialized" | ||
28 | } | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 3\n";exit} | ||
31 | "environment.sh" | ||
32 | } | ||
33 | sleep 1 | ||
34 | |||
35 | send -- "firejail --profile=shell-none.profile ls\r" | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 4\n";exit} | ||
38 | "Child process initialized" | ||
39 | } | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 5\n";exit} | ||
42 | "environment.sh" | ||
43 | } | ||
44 | sleep 1 | ||
45 | |||
46 | |||
47 | puts "\nall done\n" | ||
48 | |||
diff --git a/test/environment/shell-none.profile b/test/environment/shell-none.profile new file mode 100644 index 000000000..f16ebe3a0 --- /dev/null +++ b/test/environment/shell-none.profile | |||
@@ -0,0 +1 @@ | |||
shell none | |||
diff --git a/test/shell_zsh.exp b/test/environment/zsh.exp index 1d73fd926..2604b2be5 100755 --- a/test/shell_zsh.exp +++ b/test/environment/zsh.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/test.sh b/test/test.sh index ba5268036..e92a0f902 100755 --- a/test/test.sh +++ b/test/test.sh | |||
@@ -34,9 +34,6 @@ echo "TESTING: protocol (protocol.exp)" | |||
34 | echo "TESTING: invalid filename (invalid_filename.exp)" | 34 | echo "TESTING: invalid filename (invalid_filename.exp)" |
35 | ./invalid_filename.exp | 35 | ./invalid_filename.exp |
36 | 36 | ||
37 | echo "TESTING: environment variables (env.exp)" | ||
38 | ./env.exp | ||
39 | |||
40 | echo "TESTING: whitelist empty (whitelist-empty.exp)" | 37 | echo "TESTING: whitelist empty (whitelist-empty.exp)" |
41 | ./whitelist-empty.exp | 38 | ./whitelist-empty.exp |
42 | 39 | ||
@@ -96,15 +93,6 @@ echo "TESTING: extract command (extract_command.exp)" | |||
96 | echo "TESTING: kmsg access (kmsg.exp)" | 93 | echo "TESTING: kmsg access (kmsg.exp)" |
97 | ./kmsg.exp | 94 | ./kmsg.exp |
98 | 95 | ||
99 | echo "TESTING: rlimit (option_rlimit.exp)" | ||
100 | ./option_rlimit.exp | ||
101 | |||
102 | echo "TESTING: firejail in firejail - single sandbox (firejail-in-firejail.exp)" | ||
103 | ./firejail-in-firejail.exp | ||
104 | |||
105 | echo "TESTING: firejail in firejail - force new sandbox (firejail-in-firejail2.exp)" | ||
106 | ./firejail-in-firejail2.exp | ||
107 | |||
108 | echo "TESTING: chroot overlay (option_chroot_overlay.exp)" | 96 | echo "TESTING: chroot overlay (option_chroot_overlay.exp)" |
109 | ./option_chroot_overlay.exp | 97 | ./option_chroot_overlay.exp |
110 | 98 | ||
@@ -135,20 +123,6 @@ ls -al > tmpreadonly | |||
135 | sleep 5 | 123 | sleep 5 |
136 | rm -f tmpreadonly | 124 | rm -f tmpreadonly |
137 | 125 | ||
138 | echo "TESTING: zsh (shell_zsh.exp)" | ||
139 | ./shell_zsh.exp | ||
140 | |||
141 | echo "TESTING: csh (shell_csh.exp)" | ||
142 | ./shell_csh.exp | ||
143 | |||
144 | which dash | ||
145 | if [ "$?" -eq 0 ]; | ||
146 | then | ||
147 | echo "TESTING: dash (shell_dash.exp)" | ||
148 | ./shell_dash.exp | ||
149 | else | ||
150 | echo "TESTING: dash not found" | ||
151 | fi | ||
152 | 126 | ||
153 | echo "TESTING: PID (pid.exp)" | 127 | echo "TESTING: PID (pid.exp)" |
154 | ./pid.exp | 128 | ./pid.exp |
@@ -159,9 +133,6 @@ echo "TESTING: output (output.exp)" | |||
159 | echo "TESTING: profile no permissions (profile_noperm.exp)" | 133 | echo "TESTING: profile no permissions (profile_noperm.exp)" |
160 | ./profile_noperm.exp | 134 | ./profile_noperm.exp |
161 | 135 | ||
162 | echo "TESTING: profile rlimit (profile_rlimit.exp)" | ||
163 | ./profile_rlimit.exp | ||
164 | |||
165 | echo "TESTING: profile read-only (profile_readonly.exp)" | 136 | echo "TESTING: profile read-only (profile_readonly.exp)" |
166 | ./profile_readonly.exp | 137 | ./profile_readonly.exp |
167 | 138 | ||
diff --git a/test/utils/utils.sh b/test/utils/utils.sh index a40845a5f..9a1b6601a 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh | |||
@@ -55,8 +55,8 @@ echo "TESTING: shutdown4 (test/utils/shutdown4.exp)" | |||
55 | echo "TESTING: join test/utils/(join.exp)" | 55 | echo "TESTING: join test/utils/(join.exp)" |
56 | ./join.exp | 56 | ./join.exp |
57 | 57 | ||
58 | echo "TESTING: join2 test/utils/(join2.exp)" | 58 | echo "TESTING: join2 (test/utils/join2.exp)" |
59 | .join2.exp | 59 | ./join2.exp |
60 | 60 | ||
61 | echo "TESTING: join3 (test/utils/join3.exp)" | 61 | echo "TESTING: join3 (test/utils/join3.exp)" |
62 | ./join3.exp | 62 | ./join3.exp |