diff options
Diffstat (limited to 'test/chroot/fs_chroot.exp')
-rwxr-xr-x | test/chroot/fs_chroot.exp | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/test/chroot/fs_chroot.exp b/test/chroot/fs_chroot.exp index 545de0c66..eb1349112 100755 --- a/test/chroot/fs_chroot.exp +++ b/test/chroot/fs_chroot.exp | |||
@@ -10,55 +10,61 @@ match_max 100000 | |||
10 | send -- "firejail --chroot=/tmp/chroot\r" | 10 | send -- "firejail --chroot=/tmp/chroot\r" |
11 | expect { | 11 | expect { |
12 | timeout {puts "TESTING ERROR 0\n";exit} | 12 | timeout {puts "TESTING ERROR 0\n";exit} |
13 | "Error: --chroot option is not available on Grsecurity systems" {puts "\nall done\n"; exit} | ||
14 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "chroot available\n"}; | 13 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "chroot available\n"}; |
15 | } | 14 | } |
16 | sleep 1 | 15 | sleep 1 |
17 | 16 | ||
18 | send -- "cd /home;pwd\r" | 17 | send -- "pwd\r" |
19 | expect { | 18 | expect { |
20 | timeout {puts "TESTING ERROR 0.1\n";exit} | 19 | timeout {puts "TESTING ERROR 1\n";exit} |
21 | "home" | 20 | "/home" |
22 | } | 21 | } |
23 | sleep 1 | 22 | after 100 |
24 | send -- "bash\r" | ||
25 | sleep 1 | ||
26 | send -- "ls /\r" | 23 | send -- "ls /\r" |
27 | expect { | 24 | expect { |
28 | timeout {puts "TESTING ERROR 0.2\n";exit} | 25 | timeout {puts "TESTING ERROR 2\n";exit} |
29 | "this-is-my-chroot" | 26 | "this-is-my-chroot" |
30 | } | 27 | } |
31 | after 100 | 28 | after 100 |
32 | 29 | ||
33 | send -- "ps aux\r" | 30 | send -- "ps aux\r" |
34 | expect { | 31 | expect { |
35 | timeout {puts "TESTING ERROR 1\n";exit} | 32 | timeout {puts "TESTING ERROR 3\n";exit} |
36 | "/bin/bash" | 33 | "/bin/bash" |
37 | } | 34 | } |
38 | expect { | 35 | expect { |
39 | timeout {puts "TESTING ERROR 2\n";exit} | 36 | timeout {puts "TESTING ERROR 4\n";exit} |
40 | "bash" | ||
41 | } | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 3\n";exit} | ||
44 | "ps aux" | 37 | "ps aux" |
45 | } | 38 | } |
46 | after 100 | 39 | after 100 |
47 | 40 | ||
48 | send -- "ps aux | wc -l; pwd\r" | 41 | # check /sys directory |
42 | send -- "ls /sys\r" | ||
49 | expect { | 43 | expect { |
50 | timeout {puts "TESTING ERROR 5\n";exit} | 44 | timeout {puts "TESTING ERROR 5\n";exit} |
51 | "6" | 45 | "block" |
52 | } | 46 | } |
53 | after 100 | ||
54 | |||
55 | # check /sys directory | ||
56 | send -- "ls /sys\r" | ||
57 | expect { | 47 | expect { |
58 | timeout {puts "TESTING ERROR 6\n";exit} | 48 | timeout {puts "TESTING ERROR 6\n";exit} |
59 | "block" | 49 | "class" |
50 | } | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 7\n";exit} | ||
53 | "dev" | ||
60 | } | 54 | } |
61 | after 100 | 55 | after 100 |
62 | 56 | ||
57 | # check /bin directory | ||
58 | send -- "ls /bin/find\r" | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 8\n";exit} | ||
61 | "No such file or directory" | ||
62 | } | ||
63 | after 100 | ||
64 | send -- "/bin/ping 1.1.1.1\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 9\n";exit} | ||
67 | "Operation not permitted" | ||
68 | } | ||
63 | 69 | ||
64 | puts "all done\n" | 70 | puts "all done\n" |