aboutsummaryrefslogtreecommitdiffstats
path: root/test/invalid_filename.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-10-20 11:01:40 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2015-10-20 11:01:40 -0400
commit45060ec40f0e9790d5e6a503486867951df71300 (patch)
tree1811814d5fbd5f4806c0a8d527806fffc137f5e5 /test/invalid_filename.exp
parentfixed join/shutdown problem, moving browsers and mail clients to a --shell=no... (diff)
downloadfirejail-45060ec40f0e9790d5e6a503486867951df71300.tar.gz
firejail-45060ec40f0e9790d5e6a503486867951df71300.tar.zst
firejail-45060ec40f0e9790d5e6a503486867951df71300.zip
testing and fixes
Diffstat (limited to 'test/invalid_filename.exp')
-rwxr-xr-xtest/invalid_filename.exp236
1 files changed, 236 insertions, 0 deletions
diff --git a/test/invalid_filename.exp b/test/invalid_filename.exp
new file mode 100755
index 000000000..ca35262f8
--- /dev/null
+++ b/test/invalid_filename.exp
@@ -0,0 +1,236 @@
1#!/usr/bin/expect -f
2
3#invalid_filename checks:
4#
5#--bind (two files) - profile.c - Note: The test is not implemented here, need to be root to test it
6#--blacklist - profile.c
7#--cgroup - cgroup.c
8#--chroot - main.c
9#--netfilter - netfilter.c
10#--output - output.c
11#--private - fs_home.c
12#--privte-bin (list) - fs_bin.c
13#--private-keep/--private-home (list) - fs_home.c
14#--private-etc (list) - fs_etc.c
15#--profile - main.c
16#--read_only - profile.c
17#--shell - main.c
18#--tmpfs - profile.c
19#--white-list
20
21
22set timeout 10
23spawn $env(SHELL)
24match_max 100000
25
26send -- "firejail --debug --noprofile --blacklist=\"bla&&bla\"\r"
27expect {
28 timeout {puts "TESTING ERROR 1.1\n";exit}
29 "Checking filename bla&&bla"
30}
31expect {
32 timeout {puts "TESTING ERROR 1.2\n";exit}
33 "Error:"
34}
35expect {
36 timeout {puts "TESTING ERROR 1.3\n";exit}
37 "is an invalid filename"
38}
39after 100
40
41send -- "firejail --debug --noprofile --cgroup=\"bla&&bla\"\r"
42expect {
43 timeout {puts "TESTING ERROR 2.1\n";exit}
44 "Checking filename bla&&bla"
45}
46expect {
47 timeout {puts "TESTING ERROR 2.2\n";exit}
48 "Error:"
49}
50expect {
51 timeout {puts "TESTING ERROR 2.3\n";exit}
52 "is an invalid filename"
53}
54after 100
55
56send -- "firejail --debug --noprofile --chroot=\"bla&&bla\"\r"
57expect {
58 timeout {puts "TESTING ERROR 3.1\n";exit}
59 "Checking filename bla&&bla"
60}
61expect {
62 timeout {puts "TESTING ERROR 3.2\n";exit}
63 "Error:"
64}
65expect {
66 timeout {puts "TESTING ERROR 3.3\n";exit}
67 "is an invalid filename"
68}
69after 100
70
71send -- "firejail --debug --noprofile --netfilter=\"bla&&bla\"\r"
72expect {
73 timeout {puts "TESTING ERROR 4.1\n";exit}
74 "Checking filename bla&&bla"
75}
76expect {
77 timeout {puts "TESTING ERROR 4.2\n";exit}
78 "Error:"
79}
80expect {
81 timeout {puts "TESTING ERROR 4.3\n";exit}
82 "is an invalid filename"
83}
84after 100
85
86send -- "firejail --debug --noprofile --output=\"bla&&bla\"\r"
87expect {
88 timeout {puts "TESTING ERROR 5.2\n";exit}
89 "Error:"
90}
91expect {
92 timeout {puts "TESTING ERROR 5.3\n";exit}
93 "is an invalid filename"
94}
95after 100
96
97send -- "firejail --debug --noprofile --private=\"bla&&bla\"\r"
98expect {
99 timeout {puts "TESTING ERROR 6.1\n";exit}
100 "Checking filename bla&&bla"
101}
102expect {
103 timeout {puts "TESTING ERROR 6.2\n";exit}
104 "Error:"
105}
106expect {
107 timeout {puts "TESTING ERROR 6.3\n";exit}
108 "is an invalid filename"
109}
110after 100
111
112send -- "firejail --debug --noprofile --private-bin=\"bla&&bla\"\r"
113expect {
114 timeout {puts "TESTING ERROR 7.1\n";exit}
115 "Checking filename bla&&bla"
116}
117expect {
118 timeout {puts "TESTING ERROR 7.2\n";exit}
119 "Error:"
120}
121expect {
122 timeout {puts "TESTING ERROR 7.3\n";exit}
123 "is an invalid filename"
124}
125after 100
126
127send -- "firejail --debug --noprofile --private-home=\"bla&&bla\"\r"
128expect {
129 timeout {puts "TESTING ERROR 8.1\n";exit}
130 "Checking filename bla&&bla"
131}
132expect {
133 timeout {puts "TESTING ERROR 8.2\n";exit}
134 "Error:"
135}
136expect {
137 timeout {puts "TESTING ERROR 8.3\n";exit}
138 "is an invalid filename"
139}
140after 100
141
142
143send -- "firejail --debug --noprofile --private-etc=\"bla&&bla\"\r"
144expect {
145 timeout {puts "TESTING ERROR 9.1\n";exit}
146 "Checking filename bla&&bla"
147}
148expect {
149 timeout {puts "TESTING ERROR 9.2\n";exit}
150 "Error:"
151}
152expect {
153 timeout {puts "TESTING ERROR 9.3\n";exit}
154 "is an invalid filename"
155}
156after 100
157
158send -- "firejail --debug --profile=\"bla&&bla\"\r"
159expect {
160 timeout {puts "TESTING ERROR 10.1\n";exit}
161 "Checking filename bla&&bla"
162}
163expect {
164 timeout {puts "TESTING ERROR 10.2\n";exit}
165 "Error:"
166}
167expect {
168 timeout {puts "TESTING ERROR 10.3\n";exit}
169 "is an invalid filename"
170}
171after 100
172
173send -- "firejail --debug --read-only=\"bla&&bla\"\r"
174expect {
175 timeout {puts "TESTING ERROR 11.1\n";exit}
176 "Checking filename bla&&bla"
177}
178expect {
179 timeout {puts "TESTING ERROR 11.2\n";exit}
180 "Error:"
181}
182expect {
183 timeout {puts "TESTING ERROR 11.3\n";exit}
184 "is an invalid filename"
185}
186after 100
187
188send -- "firejail --debug --shell=\"bla&&bla\"\r"
189expect {
190 timeout {puts "TESTING ERROR 12.1\n";exit}
191 "Checking filename bla&&bla"
192}
193expect {
194 timeout {puts "TESTING ERROR 12.2\n";exit}
195 "Error:"
196}
197expect {
198 timeout {puts "TESTING ERROR 12.3\n";exit}
199 "is an invalid filename"
200}
201after 100
202
203send -- "firejail --debug --tmpfs=\"bla&&bla\"\r"
204expect {
205 timeout {puts "TESTING ERROR 13.1\n";exit}
206 "Checking filename bla&&bla"
207}
208expect {
209 timeout {puts "TESTING ERROR 13.2\n";exit}
210 "Error:"
211}
212expect {
213 timeout {puts "TESTING ERROR 13.3\n";exit}
214 "is an invalid filename"
215}
216after 100
217
218send -- "firejail --debug --whitelist=\"bla&&bla\"\r"
219expect {
220 timeout {puts "TESTING ERROR 14.1\n";exit}
221 "Checking filename bla&&bla"
222}
223expect {
224 timeout {puts "TESTING ERROR 14.2\n";exit}
225 "Error:"
226}
227expect {
228 timeout {puts "TESTING ERROR 14.3\n";exit}
229 "is an invalid filename"
230}
231after 100
232
233
234
235puts "\nall done\n"
236