aboutsummaryrefslogtreecommitdiffstats
path: root/test/root
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2017-03-23 15:02:35 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2017-03-23 15:02:35 -0400
commitad14d091b2babc7a429f922844a8fc1d8523846f (patch)
tree72be213a8cb5dcda65ad0e144cfa828c5337a1af /test/root
parentMerge branch 'master' of https://github.com/netblue30/firejail (diff)
downloadfirejail-ad14d091b2babc7a429f922844a8fc1d8523846f.tar.gz
firejail-ad14d091b2babc7a429f922844a8fc1d8523846f.tar.zst
firejail-ad14d091b2babc7a429f922844a8fc1d8523846f.zip
merge #1100 from zackw: xvfb support in /etc/firejail/firejail.config
Diffstat (limited to 'test/root')
-rwxr-xr-xtest/root/checkcfg.exp67
-rw-r--r--test/root/firejail.config1
-rwxr-xr-xtest/root/root.sh1
3 files changed, 44 insertions, 25 deletions
diff --git a/test/root/checkcfg.exp b/test/root/checkcfg.exp
index 5ec1c4e77..205ef1e0c 100755
--- a/test/root/checkcfg.exp
+++ b/test/root/checkcfg.exp
@@ -8,13 +8,6 @@ cd /home
8spawn $env(SHELL) 8spawn $env(SHELL)
9match_max 100000 9match_max 100000
10 10
11send -- "firejail --noprofile --overlay\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Child process initialized"
15}
16sleep 2
17
18send -- "rm /etc/firejail/firejail.config\r" 11send -- "rm /etc/firejail/firejail.config\r"
19after 100 12after 100
20 13
@@ -27,18 +20,16 @@ expect {
27# seccomp 20# seccomp
28send -- "echo \"seccomp no\" > /etc/firejail/firejail.config\r" 21send -- "echo \"seccomp no\" > /etc/firejail/firejail.config\r"
29after 100 22after 100
30send -- "firejail --noprofile --seccomp --force\r" 23send -- "firejail --noprofile --seccomp\r"
31expect { 24expect {
32 timeout {puts "TESTING ERROR 2\n";exit} 25 timeout {puts "TESTING ERROR 2\n";exit}
33 "seccomp feature is disabled in Firejail configuration file\r" 26 "seccomp feature is disabled in Firejail configuration file\r"
34} 27}
35send -- "exit\r"
36after 100
37 28
38# whitelist 29# whitelist
39send -- "echo \"whitelist no\" > /etc/firejail/firejail.config\r" 30send -- "echo \"whitelist no\" > /etc/firejail/firejail.config\r"
40after 100 31after 100
41send -- "firejail --noprofile --whitelist=~/.config --force\r" 32send -- "firejail --noprofile --whitelist=~/.config\r"
42expect { 33expect {
43 timeout {puts "TESTING ERROR 3\n";exit} 34 timeout {puts "TESTING ERROR 3\n";exit}
44 "whitelist feature is disabled in Firejail configuration file\r" 35 "whitelist feature is disabled in Firejail configuration file\r"
@@ -47,7 +38,7 @@ expect {
47# network 38# network
48send -- "echo \"network no\" > /etc/firejail/firejail.config\r" 39send -- "echo \"network no\" > /etc/firejail/firejail.config\r"
49after 100 40after 100
50send -- "firejail --noprofile --net=eth0 --force\r" 41send -- "firejail --noprofile --net=eth0\r"
51expect { 42expect {
52 timeout {puts "TESTING ERROR 4\n";exit} 43 timeout {puts "TESTING ERROR 4\n";exit}
53 "networking feature is disabled in Firejail configuration file\r" 44 "networking feature is disabled in Firejail configuration file\r"
@@ -56,7 +47,7 @@ expect {
56# bind 47# bind
57send -- "echo \"bind no\" > /etc/firejail/firejail.config\r" 48send -- "echo \"bind no\" > /etc/firejail/firejail.config\r"
58after 100 49after 100
59send -- "firejail --noprofile --bind=/tmp,/var/tmp --force\r" 50send -- "firejail --noprofile --bind=/tmp,/var/tmp\r"
60expect { 51expect {
61 timeout {puts "TESTING ERROR 5\n";exit} 52 timeout {puts "TESTING ERROR 5\n";exit}
62 "bind feature is disabled in Firejail configuration file\r" 53 "bind feature is disabled in Firejail configuration file\r"
@@ -65,7 +56,7 @@ expect {
65# overlay 56# overlay
66send -- "echo \"overlayfs no\" > /etc/firejail/firejail.config\r" 57send -- "echo \"overlayfs no\" > /etc/firejail/firejail.config\r"
67after 100 58after 100
68send -- "firejail --noprofile --overlay --force\r" 59send -- "firejail --noprofile --overlay\r"
69expect { 60expect {
70 timeout {puts "TESTING ERROR 6\n";exit} 61 timeout {puts "TESTING ERROR 6\n";exit}
71 "overlayfs feature is disabled in Firejail configuration file\r" 62 "overlayfs feature is disabled in Firejail configuration file\r"
@@ -74,7 +65,7 @@ expect {
74# private-home 65# private-home
75send -- "echo \"private-home no\" > /etc/firejail/firejail.config\r" 66send -- "echo \"private-home no\" > /etc/firejail/firejail.config\r"
76after 100 67after 100
77send -- "firejail --noprofile --private-home=/tmp --force\r" 68send -- "firejail --noprofile --private-home=/tmp\r"
78expect { 69expect {
79 timeout {puts "TESTING ERROR 7\n";exit} 70 timeout {puts "TESTING ERROR 7\n";exit}
80 "private-home feature is disabled in Firejail configuration file\r" 71 "private-home feature is disabled in Firejail configuration file\r"
@@ -83,7 +74,7 @@ expect {
83# chroot 74# chroot
84send -- "echo \"chroot no\" > /etc/firejail/firejail.config\r" 75send -- "echo \"chroot no\" > /etc/firejail/firejail.config\r"
85after 100 76after 100
86send -- "firejail --noprofile --chroot=/tmp --force\r" 77send -- "firejail --noprofile --chroot=/tmp\r"
87expect { 78expect {
88 timeout {puts "TESTING ERROR 8\n";exit} 79 timeout {puts "TESTING ERROR 8\n";exit}
89 "chroot feature is disabled in Firejail configuration file\r" 80 "chroot feature is disabled in Firejail configuration file\r"
@@ -92,12 +83,37 @@ expect {
92# userns 83# userns
93send -- "echo \"userns no\" > /etc/firejail/firejail.config\r" 84send -- "echo \"userns no\" > /etc/firejail/firejail.config\r"
94after 100 85after 100
95send -- "firejail --noprofile --noroot --force\r" 86send -- "firejail --noprofile --noroot\r"
96expect { 87expect {
97 timeout {puts "TESTING ERROR 9\n";exit} 88 timeout {puts "TESTING ERROR 9\n";exit}
98 "noroot feature is disabled in Firejail configuration file\r" 89 "noroot feature is disabled in Firejail configuration file\r"
99} 90}
100 91
92# netfilter-default
93send -- "echo \"netfilter-default blablabla\" > /etc/firejail/firejail.config\r"
94after 100
95send -- "firejail --noprofile\r"
96expect {
97 timeout {puts "TESTING ERROR 10\n";exit}
98 "netfilter-default file blablabla not available\r"
99}
100
101# strings
102send -- "echo \"xephyr-screen 800x600\" > /etc/firejail/firejail.config\r"
103after 100
104send -- "echo \"xvfb-screen 800x600x24\" >> /etc/firejail/firejail.config\r"
105after 100
106send -- "echo \"xvfb-extra-params blablabla\" >> /etc/firejail/firejail.config\r"
107after 100
108send -- "firejail --noprofile\r"
109expect {
110 timeout {puts "TESTING ERROR 11\n";exit}
111 "Child process initialized\r"
112}
113after 100
114send -- "exit\r"
115after 100
116
101# error exit 117# error exit
102send -- "echo \"join no\" > /etc/firejail/firejail.config\r" 118send -- "echo \"join no\" > /etc/firejail/firejail.config\r"
103after 100 119after 100
@@ -129,17 +145,18 @@ send -- "echo \"private-bin-no-local yes\" >> /etc/firejail/firejail.config\r"
129after 100 145after 100
130send -- "echo \"disable-mnt yes\" >> /etc/firejail/firejail.config\r" 146send -- "echo \"disable-mnt yes\" >> /etc/firejail/firejail.config\r"
131after 100 147after 100
148send -- "echo \"xephyr-window-title no\" >> /etc/firejail/firejail.config\r"
149after 100
150send -- "echo \"remount-proc-sys no\" >> /etc/firejail/firejail.config\r"
151after 100
152send -- "echo \"disable-mnt no\" >> /etc/firejail/firejail.config\r"
153after 100
132send -- "echo \"blablabla\" >> /etc/firejail/firejail.config\r" 154send -- "echo \"blablabla\" >> /etc/firejail/firejail.config\r"
133after 100 155after 100
134send -- "firejail --noprofile --force\r" 156send -- "firejail --noprofile\r"
135expect { 157expect {
136 timeout {puts "TESTING ERROR 10\n";exit} 158 timeout {puts "TESTING ERROR 12\n";exit}
137 "invalid line\r" 159 ""
138} 160}
139
140send -- "exit\r"
141after 100
142
143
144after 100 161after 100
145puts "\nall done\n" 162puts "\nall done\n"
diff --git a/test/root/firejail.config b/test/root/firejail.config
index 9b57f5126..4ad5edd4d 100644
--- a/test/root/firejail.config
+++ b/test/root/firejail.config
@@ -1,3 +1,4 @@
1
1bind yes 2bind yes
2chroot yes 3chroot yes
3chroot-desktop yes 4chroot-desktop yes
diff --git a/test/root/root.sh b/test/root/root.sh
index e23499d2a..82fdc90b5 100755
--- a/test/root/root.sh
+++ b/test/root/root.sh
@@ -82,6 +82,7 @@ echo "TESTING: seccomp chown (test/root/seccomp-chown.exp)"
82#******************************** 82#********************************
83echo "TESTING: firejail configuration (test/root/checkcfg.exp)" 83echo "TESTING: firejail configuration (test/root/checkcfg.exp)"
84./checkcfg.exp 84./checkcfg.exp
85cp ../../etc/firejail.config /etc/firejail/.
85 86
86echo "TESTING: tmpfs (test/root/option_tmpfs.exp)" 87echo "TESTING: tmpfs (test/root/option_tmpfs.exp)"
87./option_tmpfs.exp 88./option_tmpfs.exp