aboutsummaryrefslogtreecommitdiffstats
path: root/test/private-bin.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-10-11 11:24:02 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2015-10-11 11:24:02 -0400
commitf4171a91412f89d509e6d1371fd81b4ecd89c11d (patch)
tree89882fc26af43bc4149109c029380209792698d9 /test/private-bin.exp
parentMerge pull request #81 from pyther/rpm (diff)
downloadfirejail-f4171a91412f89d509e6d1371fd81b4ecd89c11d.tar.gz
firejail-f4171a91412f89d509e6d1371fd81b4ecd89c11d.tar.zst
firejail-f4171a91412f89d509e6d1371fd81b4ecd89c11d.zip
--private-bin
Diffstat (limited to 'test/private-bin.exp')
-rwxr-xr-xtest/private-bin.exp71
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
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --private-bin=bash,ls,sh\r"
8expect {
9 timeout {puts "TESTING ERROR 1\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14send -- "ls -al /bin\r"
15expect {
16 timeout {puts "TESTING ERROR 2\n";exit}
17 "bash"
18}
19expect {
20 timeout {puts "TESTING ERROR 3\n";exit}
21 "ls"
22}
23expect {
24 timeout {puts "TESTING ERROR 4\n";exit}
25 "sh"
26}
27
28send -- "ls -al /bin\r"
29expect {
30 timeout {puts "TESTING ERROR 5\n";exit}
31 "ping" {puts "TESTING ERROR 6\n";exit}
32 "sh"
33}
34send -- "exit\r"
35sleep 1
36
37send -- "firejail --profile=private-bin.profile\r"
38expect {
39 timeout {puts "TESTING ERROR 7\n";exit}
40 "Child process initialized"
41}
42sleep 1
43
44send -- "ls -al /bin\r"
45expect {
46 timeout {puts "TESTING ERROR 8\n";exit}
47 "bash"
48}
49expect {
50 timeout {puts "TESTING ERROR 9\n";exit}
51 "ls"
52}
53expect {
54 timeout {puts "TESTING ERROR 10\n";exit}
55 "sh"
56}
57
58send -- "ls -al /bin\r"
59expect {
60 timeout {puts "TESTING ERROR 5\n";exit}
61 "ping" {puts "TESTING ERROR 6\n";exit}
62 "sh"
63}
64send -- "exit\r"
65
66
67
68
69sleep 1
70puts "\nall done\n"
71