diff options
author | netblue30 <netblue30@yahoo.com> | 2015-10-11 11:24:02 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-10-11 11:24:02 -0400 |
commit | f4171a91412f89d509e6d1371fd81b4ecd89c11d (patch) | |
tree | 89882fc26af43bc4149109c029380209792698d9 /test/private-bin.exp | |
parent | Merge pull request #81 from pyther/rpm (diff) | |
download | firejail-f4171a91412f89d509e6d1371fd81b4ecd89c11d.tar.gz firejail-f4171a91412f89d509e6d1371fd81b4ecd89c11d.tar.zst firejail-f4171a91412f89d509e6d1371fd81b4ecd89c11d.zip |
--private-bin
Diffstat (limited to 'test/private-bin.exp')
-rwxr-xr-x | test/private-bin.exp | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/test/private-bin.exp b/test/private-bin.exp new file mode 100755 index 000000000..cc5ea99c7 --- /dev/null +++ b/test/private-bin.exp | |||
@@ -0,0 +1,71 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --private-bin=bash,ls,sh\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 1\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | sleep 1 | ||
13 | |||
14 | send -- "ls -al /bin\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 2\n";exit} | ||
17 | "bash" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 3\n";exit} | ||
21 | "ls" | ||
22 | } | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 4\n";exit} | ||
25 | "sh" | ||
26 | } | ||
27 | |||
28 | send -- "ls -al /bin\r" | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 5\n";exit} | ||
31 | "ping" {puts "TESTING ERROR 6\n";exit} | ||
32 | "sh" | ||
33 | } | ||
34 | send -- "exit\r" | ||
35 | sleep 1 | ||
36 | |||
37 | send -- "firejail --profile=private-bin.profile\r" | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 7\n";exit} | ||
40 | "Child process initialized" | ||
41 | } | ||
42 | sleep 1 | ||
43 | |||
44 | send -- "ls -al /bin\r" | ||
45 | expect { | ||
46 | timeout {puts "TESTING ERROR 8\n";exit} | ||
47 | "bash" | ||
48 | } | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 9\n";exit} | ||
51 | "ls" | ||
52 | } | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 10\n";exit} | ||
55 | "sh" | ||
56 | } | ||
57 | |||
58 | send -- "ls -al /bin\r" | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 5\n";exit} | ||
61 | "ping" {puts "TESTING ERROR 6\n";exit} | ||
62 | "sh" | ||
63 | } | ||
64 | send -- "exit\r" | ||
65 | |||
66 | |||
67 | |||
68 | |||
69 | sleep 1 | ||
70 | puts "\nall done\n" | ||
71 | |||