diff options
author | 2019-09-26 10:59:26 +0200 | |
---|---|---|
committer | 2019-09-26 10:59:26 +0200 | |
commit | b9888e6a388b7d2c17f0aa75b2ef5205b4b90720 (patch) | |
tree | b17e2d4430e1118e34f4f9764f082d30e309384e /test/environment | |
parent | testing: rename and simplify (diff) | |
download | firejail-b9888e6a388b7d2c17f0aa75b2ef5205b4b90720.tar.gz firejail-b9888e6a388b7d2c17f0aa75b2ef5205b4b90720.tar.zst firejail-b9888e6a388b7d2c17f0aa75b2ef5205b4b90720.zip |
testing
Diffstat (limited to 'test/environment')
-rwxr-xr-x | test/environment/environment.sh | 3 | ||||
-rwxr-xr-x | test/environment/umask.exp | 41 |
2 files changed, 44 insertions, 0 deletions
diff --git a/test/environment/environment.sh b/test/environment/environment.sh index 735d3e59e..f860f7c24 100755 --- a/test/environment/environment.sh +++ b/test/environment/environment.sh | |||
@@ -120,3 +120,6 @@ echo "TESTING: rlimit errors profile (test/environment/rlimit-bad-profile.exp)" | |||
120 | 120 | ||
121 | echo "TESTING: deterministic exit code (test/environment/deterministic-exit-code.exp" | 121 | echo "TESTING: deterministic exit code (test/environment/deterministic-exit-code.exp" |
122 | ./deterministic-exit-code.exp | 122 | ./deterministic-exit-code.exp |
123 | |||
124 | echo "TESTING: retain umask (test/environment/umask.exp" | ||
125 | (umask 123 && ./umask.exp) | ||
diff --git a/test/environment/umask.exp b/test/environment/umask.exp new file mode 100755 index 000000000..e93d71bd4 --- /dev/null +++ b/test/environment/umask.exp | |||
@@ -0,0 +1,41 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --noprofile\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | sleep 1 | ||
13 | |||
14 | send -- "umask\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "0123" | ||
18 | } | ||
19 | after 100 | ||
20 | |||
21 | send -- "firejail\r" | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 2\n";exit} | ||
24 | "Warning: an existing sandbox was detected" | ||
25 | } | ||
26 | after 100 | ||
27 | |||
28 | send -- "umask\r" | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 3\n";exit} | ||
31 | "0123" | ||
32 | } | ||
33 | after 100 | ||
34 | |||
35 | send -- "exit\r" | ||
36 | after 100 | ||
37 | |||
38 | send -- "exit\r" | ||
39 | sleep 1 | ||
40 | |||
41 | puts "\nall done\n" | ||