diff options
Diffstat (limited to 'test/root/checkcfg.exp')
-rwxr-xr-x | test/root/checkcfg.exp | 92 |
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 | |||
8 | spawn $env(SHELL) | 8 | spawn $env(SHELL) |
9 | match_max 100000 | 9 | match_max 100000 |
10 | 10 | ||
11 | send -- "firejail --noprofile --overlay\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 0\n";exit} | ||
14 | "Child process initialized" | ||
15 | } | ||
16 | sleep 2 | ||
17 | |||
18 | send -- "rm /etc/firejail/firejail.config\r" | 11 | send -- "rm /etc/firejail/firejail.config\r" |
19 | after 100 | 12 | after 100 |
20 | 13 | ||
@@ -27,18 +20,16 @@ expect { | |||
27 | # seccomp | 20 | # seccomp |
28 | send -- "echo \"seccomp no\" > /etc/firejail/firejail.config\r" | 21 | send -- "echo \"seccomp no\" > /etc/firejail/firejail.config\r" |
29 | after 100 | 22 | after 100 |
30 | send -- "firejail --noprofile --seccomp --force\r" | 23 | send -- "firejail --noprofile --seccomp\r" |
31 | expect { | 24 | expect { |
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 | } |
35 | send -- "exit\r" | ||
36 | after 100 | ||
37 | 28 | ||
38 | # whitelist | 29 | # whitelist |
39 | send -- "echo \"whitelist no\" > /etc/firejail/firejail.config\r" | 30 | send -- "echo \"whitelist no\" > /etc/firejail/firejail.config\r" |
40 | after 100 | 31 | after 100 |
41 | send -- "firejail --noprofile --whitelist=~/.config --force\r" | 32 | send -- "firejail --noprofile --whitelist=~/.config\r" |
42 | expect { | 33 | expect { |
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 |
48 | send -- "echo \"network no\" > /etc/firejail/firejail.config\r" | 39 | send -- "echo \"network no\" > /etc/firejail/firejail.config\r" |
49 | after 100 | 40 | after 100 |
50 | send -- "firejail --noprofile --net=eth0 --force\r" | 41 | send -- "firejail --noprofile --net=eth0\r" |
51 | expect { | 42 | expect { |
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 |
57 | send -- "echo \"bind no\" > /etc/firejail/firejail.config\r" | 48 | send -- "echo \"bind no\" > /etc/firejail/firejail.config\r" |
58 | after 100 | 49 | after 100 |
59 | send -- "firejail --noprofile --bind=/tmp,/var/tmp --force\r" | 50 | send -- "firejail --noprofile --bind=/tmp,/var/tmp\r" |
60 | expect { | 51 | expect { |
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 |
66 | send -- "echo \"overlayfs no\" > /etc/firejail/firejail.config\r" | 57 | send -- "echo \"overlayfs no\" > /etc/firejail/firejail.config\r" |
67 | after 100 | 58 | after 100 |
68 | send -- "firejail --noprofile --overlay --force\r" | 59 | send -- "firejail --noprofile --overlay\r" |
69 | expect { | 60 | expect { |
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 |
75 | send -- "echo \"private-home no\" > /etc/firejail/firejail.config\r" | 66 | send -- "echo \"private-home no\" > /etc/firejail/firejail.config\r" |
76 | after 100 | 67 | after 100 |
77 | send -- "firejail --noprofile --private-home=/tmp --force\r" | 68 | send -- "firejail --noprofile --private-home=/tmp\r" |
78 | expect { | 69 | expect { |
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 |
84 | send -- "echo \"chroot no\" > /etc/firejail/firejail.config\r" | 75 | send -- "echo \"chroot no\" > /etc/firejail/firejail.config\r" |
85 | after 100 | 76 | after 100 |
86 | send -- "firejail --noprofile --chroot=/tmp --force\r" | 77 | send -- "firejail --noprofile --chroot=/tmp\r" |
87 | expect { | 78 | expect { |
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 |
93 | send -- "echo \"userns no\" > /etc/firejail/firejail.config\r" | 84 | send -- "echo \"userns no\" > /etc/firejail/firejail.config\r" |
94 | after 100 | 85 | after 100 |
95 | send -- "firejail --noprofile --noroot --force\r" | 86 | send -- "firejail --noprofile --noroot\r" |
96 | expect { | 87 | expect { |
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 | ||
101 | send -- "exit\r" | 92 | # netfilter-default |
93 | send -- "echo \"netfilter-default blablabla\" > /etc/firejail/firejail.config\r" | ||
102 | after 100 | 94 | after 100 |
95 | send -- "firejail --noprofile\r" | ||
96 | expect { | ||
97 | timeout {puts "TESTING ERROR 10\n";exit} | ||
98 | "netfilter-default file blablabla not available\r" | ||
99 | } | ||
103 | 100 | ||
101 | # strings | ||
102 | send -- "echo \"xephyr-screen 800x600\" > /etc/firejail/firejail.config\r" | ||
103 | after 100 | ||
104 | send -- "echo \"xvfb-screen 800x600x24\" >> /etc/firejail/firejail.config\r" | ||
105 | after 100 | ||
106 | send -- "echo \"xvfb-extra-params blablabla\" >> /etc/firejail/firejail.config\r" | ||
107 | after 100 | ||
108 | send -- "firejail --noprofile\r" | ||
109 | expect { | ||
110 | timeout {puts "TESTING ERROR 11\n";exit} | ||
111 | "Child process initialized\r" | ||
112 | } | ||
113 | after 100 | ||
114 | send -- "exit\r" | ||
115 | after 100 | ||
104 | 116 | ||
117 | # error exit | ||
118 | send -- "echo \"join no\" > /etc/firejail/firejail.config\r" | ||
119 | after 100 | ||
120 | send -- "echo \"cache-tmpfs no\" >> /etc/firejail/firejail.config\r" | ||
121 | after 100 | ||
122 | send -- "echo \"file-transfer no\" >> /etc/firejail/firejail.config\r" | ||
123 | after 100 | ||
124 | send -- "echo \"x11 no\" >> /etc/firejail/firejail.config\r" | ||
125 | after 100 | ||
126 | send -- "echo \"firejail-prompt yes\" >> /etc/firejail/firejail.config\r" | ||
127 | after 100 | ||
128 | send -- "echo \"follow-symlink-as-user yes\" >> /etc/firejail/firejail.config\r" | ||
129 | after 100 | ||
130 | send -- "echo \"follow-symlink-private-bin yes\" >> /etc/firejail/firejail.config\r" | ||
131 | after 100 | ||
132 | send -- "echo \"force-nonewprivs yes\" >> /etc/firejail/firejail.config\r" | ||
133 | after 100 | ||
134 | send -- "echo \"seccomp no\" >> /etc/firejail/firejail.config\r" | ||
135 | after 100 | ||
136 | send -- "echo \"restricted-network yes\" >> /etc/firejail/firejail.config\r" | ||
137 | after 100 | ||
138 | send -- "echo \"xephyr-window-title yes\" >> /etc/firejail/firejail.config\r" | ||
139 | after 100 | ||
140 | send -- "echo \"quiet-by-default yes\" >> /etc/firejail/firejail.config\r" | ||
141 | after 100 | ||
142 | send -- "echo \"chroot-desktop no\" >> /etc/firejail/firejail.config\r" | ||
143 | after 100 | ||
144 | send -- "echo \"private-bin-no-local yes\" >> /etc/firejail/firejail.config\r" | ||
145 | after 100 | ||
146 | send -- "echo \"disable-mnt yes\" >> /etc/firejail/firejail.config\r" | ||
147 | after 100 | ||
148 | send -- "echo \"xephyr-window-title no\" >> /etc/firejail/firejail.config\r" | ||
149 | after 100 | ||
150 | send -- "echo \"remount-proc-sys no\" >> /etc/firejail/firejail.config\r" | ||
151 | after 100 | ||
152 | send -- "echo \"disable-mnt no\" >> /etc/firejail/firejail.config\r" | ||
153 | after 100 | ||
154 | send -- "echo \"blablabla\" >> /etc/firejail/firejail.config\r" | ||
155 | after 100 | ||
156 | send -- "firejail --noprofile\r" | ||
157 | expect { | ||
158 | timeout {puts "TESTING ERROR 12\n";exit} | ||
159 | "" | ||
160 | } | ||
105 | after 100 | 161 | after 100 |
106 | puts "\nall done\n" | 162 | puts "\nall done\n" |