aboutsummaryrefslogtreecommitdiffstats
path: root/test/root/checkcfg.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/root/checkcfg.exp')
-rwxr-xr-xtest/root/checkcfg.exp92
1 files changed, 74 insertions, 18 deletions
diff --git a/test/root/checkcfg.exp b/test/root/checkcfg.exp
index e1ec6cf79..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,15 +83,80 @@ 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
101send -- "exit\r" 92# netfilter-default
93send -- "echo \"netfilter-default blablabla\" > /etc/firejail/firejail.config\r"
102after 100 94after 100
95send -- "firejail --noprofile\r"
96expect {
97 timeout {puts "TESTING ERROR 10\n";exit}
98 "netfilter-default file blablabla not available\r"
99}
103 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
104 116
117# error exit
118send -- "echo \"join no\" > /etc/firejail/firejail.config\r"
119after 100
120send -- "echo \"cache-tmpfs no\" >> /etc/firejail/firejail.config\r"
121after 100
122send -- "echo \"file-transfer no\" >> /etc/firejail/firejail.config\r"
123after 100
124send -- "echo \"x11 no\" >> /etc/firejail/firejail.config\r"
125after 100
126send -- "echo \"firejail-prompt yes\" >> /etc/firejail/firejail.config\r"
127after 100
128send -- "echo \"follow-symlink-as-user yes\" >> /etc/firejail/firejail.config\r"
129after 100
130send -- "echo \"follow-symlink-private-bin yes\" >> /etc/firejail/firejail.config\r"
131after 100
132send -- "echo \"force-nonewprivs yes\" >> /etc/firejail/firejail.config\r"
133after 100
134send -- "echo \"seccomp no\" >> /etc/firejail/firejail.config\r"
135after 100
136send -- "echo \"restricted-network yes\" >> /etc/firejail/firejail.config\r"
137after 100
138send -- "echo \"xephyr-window-title yes\" >> /etc/firejail/firejail.config\r"
139after 100
140send -- "echo \"quiet-by-default yes\" >> /etc/firejail/firejail.config\r"
141after 100
142send -- "echo \"chroot-desktop no\" >> /etc/firejail/firejail.config\r"
143after 100
144send -- "echo \"private-bin-no-local yes\" >> /etc/firejail/firejail.config\r"
145after 100
146send -- "echo \"disable-mnt yes\" >> /etc/firejail/firejail.config\r"
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
154send -- "echo \"blablabla\" >> /etc/firejail/firejail.config\r"
155after 100
156send -- "firejail --noprofile\r"
157expect {
158 timeout {puts "TESTING ERROR 12\n";exit}
159 ""
160}
105after 100 161after 100
106puts "\nall done\n" 162puts "\nall done\n"