diff options
author | netblue30 <netblue30@yahoo.com> | 2016-05-05 10:22:18 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-05-05 10:22:18 -0400 |
commit | 37a5a3545ef6d8d03dad8bbd888f53e13274c9e5 (patch) | |
tree | 5d56a4b0a0933963d97eb0a88dd00fec9ea58bf2 /test/fs/private-bin.exp | |
parent | rename generic.profile as default.profile (diff) | |
download | firejail-37a5a3545ef6d8d03dad8bbd888f53e13274c9e5.tar.gz firejail-37a5a3545ef6d8d03dad8bbd888f53e13274c9e5.tar.zst firejail-37a5a3545ef6d8d03dad8bbd888f53e13274c9e5.zip |
testing
Diffstat (limited to 'test/fs/private-bin.exp')
-rwxr-xr-x | test/fs/private-bin.exp | 71 |
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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --private-bin=bash,ls,sh\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | sleep 1 | ||
16 | |||
17 | send -- "ls /bin\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 2\n";exit} | ||
20 | "bash" | ||
21 | } | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 3\n";exit} | ||
24 | "ls" | ||
25 | } | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 4\n";exit} | ||
28 | "sh" | ||
29 | } | ||
30 | |||
31 | send -- "ls /bin\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 5\n";exit} | ||
34 | "ping" {puts "TESTING ERROR 6\n";exit} | ||
35 | "sh" | ||
36 | } | ||
37 | send -- "exit\r" | ||
38 | sleep 1 | ||
39 | |||
40 | send -- "firejail --profile=private-bin.profile\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 7\n";exit} | ||
43 | "Child process initialized" | ||
44 | } | ||
45 | sleep 1 | ||
46 | |||
47 | send -- "ls /bin\r" | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 8\n";exit} | ||
50 | "bash" | ||
51 | } | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 9\n";exit} | ||
54 | "ls" | ||
55 | } | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 10\n";exit} | ||
58 | "sh" | ||
59 | } | ||
60 | |||
61 | send -- "ls /bin\r" | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 5\n";exit} | ||
64 | "ping" {puts "TESTING ERROR 6\n";exit} | ||
65 | "sh" | ||
66 | } | ||
67 | send -- "exit\r" | ||
68 | |||
69 | sleep 1 | ||
70 | puts "\nall done\n" | ||
71 | |||