diff options
author | smitsohu <smitsohu@gmail.com> | 2019-09-26 10:59:26 +0200 |
---|---|---|
committer | smitsohu <smitsohu@gmail.com> | 2019-09-26 10:59:26 +0200 |
commit | b9888e6a388b7d2c17f0aa75b2ef5205b4b90720 (patch) | |
tree | b17e2d4430e1118e34f4f9764f082d30e309384e /test/fs/whitelist-noexec.exp | |
parent | testing: rename and simplify (diff) | |
download | firejail-b9888e6a388b7d2c17f0aa75b2ef5205b4b90720.tar.gz firejail-b9888e6a388b7d2c17f0aa75b2ef5205b4b90720.tar.zst firejail-b9888e6a388b7d2c17f0aa75b2ef5205b4b90720.zip |
testing
Diffstat (limited to 'test/fs/whitelist-noexec.exp')
-rwxr-xr-x | test/fs/whitelist-noexec.exp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/fs/whitelist-noexec.exp b/test/fs/whitelist-noexec.exp new file mode 100755 index 000000000..f05316a30 --- /dev/null +++ b/test/fs/whitelist-noexec.exp | |||
@@ -0,0 +1,36 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2019 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | set PWD $env(PWD) | ||
10 | |||
11 | |||
12 | send -- "firejail --noprofile --whitelist=$PWD --noexec=$PWD\r" | ||
13 | expect { | ||
14 | timeout {puts "TESTING ERROR 0\n";exit} | ||
15 | "Child process initialized" | ||
16 | } | ||
17 | sleep 1 | ||
18 | |||
19 | send -- "ls $PWD\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1\n";exit} | ||
22 | "whitelist-noexec.exp" | ||
23 | } | ||
24 | after 100 | ||
25 | |||
26 | send -- "$PWD/whitelist-noexec.exp\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 2\n";exit} | ||
29 | "Permission denied" | ||
30 | } | ||
31 | after 100 | ||
32 | |||
33 | send -- "exit\r" | ||
34 | sleep 1 | ||
35 | |||
36 | puts "\nall done\n" | ||