aboutsummaryrefslogtreecommitdiffstats
path: root/test/fs/private-bin.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/fs/private-bin.exp')
-rwxr-xr-xtest/fs/private-bin.exp71
1 files changed, 71 insertions, 0 deletions
diff --git a/test/fs/private-bin.exp b/test/fs/private-bin.exp
new file mode 100755
index 000000000..c19702e77
--- /dev/null
+++ b/test/fs/private-bin.exp
@@ -0,0 +1,71 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --private-bin=bash,ls,sh\r"
11expect {
12 timeout {puts "TESTING ERROR 1\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17send -- "ls /bin\r"
18expect {
19 timeout {puts "TESTING ERROR 2\n";exit}
20 "bash"
21}
22expect {
23 timeout {puts "TESTING ERROR 3\n";exit}
24 "ls"
25}
26expect {
27 timeout {puts "TESTING ERROR 4\n";exit}
28 "sh"
29}
30
31send -- "ls /bin\r"
32expect {
33 timeout {puts "TESTING ERROR 5\n";exit}
34 "ping" {puts "TESTING ERROR 6\n";exit}
35 "sh"
36}
37send -- "exit\r"
38sleep 1
39
40send -- "firejail --profile=private-bin.profile\r"
41expect {
42 timeout {puts "TESTING ERROR 7\n";exit}
43 "Child process initialized"
44}
45sleep 1
46
47send -- "ls /bin\r"
48expect {
49 timeout {puts "TESTING ERROR 8\n";exit}
50 "bash"
51}
52expect {
53 timeout {puts "TESTING ERROR 9\n";exit}
54 "ls"
55}
56expect {
57 timeout {puts "TESTING ERROR 10\n";exit}
58 "sh"
59}
60
61send -- "ls /bin\r"
62expect {
63 timeout {puts "TESTING ERROR 5\n";exit}
64 "ping" {puts "TESTING ERROR 6\n";exit}
65 "sh"
66}
67send -- "exit\r"
68
69sleep 1
70puts "\nall done\n"
71