aboutsummaryrefslogtreecommitdiffstats
path: root/test/fs_chroot_asroot.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-10-31 13:07:38 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2015-10-31 13:07:38 -0400
commit1cb8ef59101eeaa1b325fb7f881ded148b0de1d3 (patch)
treeea114440c2236e1418a17f0e78c3050262965d98 /test/fs_chroot_asroot.exp
parentreadme.md (diff)
downloadfirejail-1cb8ef59101eeaa1b325fb7f881ded148b0de1d3.tar.gz
firejail-1cb8ef59101eeaa1b325fb7f881ded148b0de1d3.tar.zst
firejail-1cb8ef59101eeaa1b325fb7f881ded148b0de1d3.zip
--chroot testing
Diffstat (limited to 'test/fs_chroot_asroot.exp')
-rwxr-xr-xtest/fs_chroot_asroot.exp91
1 files changed, 91 insertions, 0 deletions
diff --git a/test/fs_chroot_asroot.exp b/test/fs_chroot_asroot.exp
new file mode 100755
index 000000000..7e18153e0
--- /dev/null
+++ b/test/fs_chroot_asroot.exp
@@ -0,0 +1,91 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --chroot=/tmp/chroot\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14send -- "cd /home;pwd\r"
15expect {
16 timeout {puts "TESTING ERROR 0.1\n";exit}
17 "home"
18}
19sleep 1
20send -- "bash\r"
21sleep 1
22send -- "ls /; pwd\r"
23expect {
24 timeout {puts "TESTING ERROR 0.2\n";exit}
25 "this-is-my-chroot"
26}
27expect {
28 timeout {puts "TESTING ERROR 0.3\n";exit}
29 "home"
30}
31
32send -- "umount /boot; pwd\r"
33expect {
34 timeout {puts "TESTING ERROR 0.4\n";exit}
35 "Bad system call"
36}
37expect {
38 timeout {puts "TESTING ERROR 0.5\n";exit}
39 "home"
40}
41
42send -- "/unchroot; pwd\r"
43expect {
44 timeout {puts "TESTING ERROR 0.6\n";exit}
45 "Bad system call"
46}
47expect {
48 timeout {puts "TESTING ERROR 0.7\n";exit}
49 "home"
50}
51
52
53
54
55
56send -- "ps aux; pwd\r"
57expect {
58 timeout {puts "TESTING ERROR 1\n";exit}
59 "/bin/bash"
60}
61expect {
62 timeout {puts "TESTING ERROR 2\n";exit}
63 "bash"
64}
65expect {
66 timeout {puts "TESTING ERROR 3\n";exit}
67 "ps aux"
68}
69expect {
70 timeout {puts "TESTING ERROR 4\n";exit}
71 "home"
72}
73sleep 1
74
75
76send -- "ps aux |wc -l; pwd\r"
77expect {
78 timeout {puts "TESTING ERROR 5\n";exit}
79 "5"
80}
81expect {
82 timeout {puts "TESTING ERROR 6\n";exit}
83 "home"
84}
85sleep 1
86
87
88
89
90puts "all done\n"
91