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