diff options
author | netblue30 <netblue30@yahoo.com> | 2017-03-29 12:09:26 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2017-03-29 12:09:26 -0400 |
commit | b2b603eac941d2cdea97d7886dc7181c179a8160 (patch) | |
tree | afb0c44459b96f331e07772959bd7e983a082a05 /test/stress/blacklist.exp | |
parent | merges (diff) | |
download | firejail-b2b603eac941d2cdea97d7886dc7181c179a8160.tar.gz firejail-b2b603eac941d2cdea97d7886dc7181c179a8160.tar.zst firejail-b2b603eac941d2cdea97d7886dc7181c179a8160.zip |
testing
Diffstat (limited to 'test/stress/blacklist.exp')
-rwxr-xr-x | test/stress/blacklist.exp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/test/stress/blacklist.exp b/test/stress/blacklist.exp new file mode 100755 index 000000000..33e2c262e --- /dev/null +++ b/test/stress/blacklist.exp | |||
@@ -0,0 +1,60 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2017 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | set MAXi 100 | ||
11 | |||
12 | # blacklist testing | ||
13 | set i 1 | ||
14 | send -- "firejail --profile=blacklist.profile\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "Child process initialized" | ||
18 | } | ||
19 | |||
20 | while { $i <= $MAXi } { | ||
21 | send -- "cat ~/fj-stress-test/testfile$i\r" | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 1\n";exit} | ||
24 | "denied" | ||
25 | } | ||
26 | incr i | ||
27 | after 100 | ||
28 | } | ||
29 | after 100 | ||
30 | |||
31 | send -- "exit\r" | ||
32 | sleep 1 | ||
33 | |||
34 | # noblacklist testing | ||
35 | set i 1 | ||
36 | send -- "firejail --profile=noblacklist.profile\r" | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 1\n";exit} | ||
39 | "Child process initialized" | ||
40 | } | ||
41 | |||
42 | while { $i <= $MAXi } { | ||
43 | send -- "cat ~/fj-stress-test/testfile$i\r" | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 1\n";exit} | ||
46 | "hello" | ||
47 | } | ||
48 | incr i | ||
49 | after 100 | ||
50 | } | ||
51 | after 100 | ||
52 | |||
53 | send -- "exit\r" | ||
54 | sleep 1 | ||
55 | |||
56 | |||
57 | |||
58 | after 100 | ||
59 | puts "\nall done\n" | ||
60 | |||