diff options
author | netblue30 <netblue30@yahoo.com> | 2016-11-19 09:49:09 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-11-19 09:49:09 -0500 |
commit | d30ae468d925199359aa7c6d4cdec7e9e15587dd (patch) | |
tree | 0d90762b6f55ca8bad2b923d4682f8a337a32600 /test/chroot/fs_chroot.exp | |
parent | testing (diff) | |
download | firejail-d30ae468d925199359aa7c6d4cdec7e9e15587dd.tar.gz firejail-d30ae468d925199359aa7c6d4cdec7e9e15587dd.tar.zst firejail-d30ae468d925199359aa7c6d4cdec7e9e15587dd.zip |
testing
Diffstat (limited to 'test/chroot/fs_chroot.exp')
-rwxr-xr-x | test/chroot/fs_chroot.exp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/test/chroot/fs_chroot.exp b/test/chroot/fs_chroot.exp new file mode 100755 index 000000000..aeb5669e1 --- /dev/null +++ b/test/chroot/fs_chroot.exp | |||
@@ -0,0 +1,68 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --chroot=/tmp/chroot\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Error: --chroot option is not available on Grsecurity systems" {puts "\nall done\n"; exit} | ||
11 | "Child process initialized" {puts "chroot available\n"}; | ||
12 | } | ||
13 | sleep 1 | ||
14 | |||
15 | send -- "cd /home;pwd\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
18 | "home" | ||
19 | } | ||
20 | sleep 1 | ||
21 | send -- "bash\r" | ||
22 | sleep 1 | ||
23 | send -- "ls /; pwd\r" | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 0.2\n";exit} | ||
26 | "this-is-my-chroot" | ||
27 | } | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 0.3\n";exit} | ||
30 | "home" | ||
31 | } | ||
32 | |||
33 | |||
34 | |||
35 | send -- "ps aux; pwd\r" | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 1\n";exit} | ||
38 | "/bin/bash" | ||
39 | } | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 2\n";exit} | ||
42 | "bash" | ||
43 | } | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 3\n";exit} | ||
46 | "ps aux" | ||
47 | } | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 4\n";exit} | ||
50 | "home" | ||
51 | } | ||
52 | sleep 1 | ||
53 | |||
54 | |||
55 | send -- "ps aux |wc -l; pwd\r" | ||
56 | expect { | ||
57 | timeout {puts "TESTING ERROR 5\n";exit} | ||
58 | "6" | ||
59 | } | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 6\n";exit} | ||
62 | "home" | ||
63 | } | ||
64 | sleep 1 | ||
65 | |||
66 | |||
67 | puts "all done\n" | ||
68 | |||