aboutsummaryrefslogtreecommitdiffstats
path: root/test/fs/invalid_filename.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/fs/invalid_filename.exp')
-rwxr-xr-xtest/fs/invalid_filename.exp189
1 files changed, 189 insertions, 0 deletions
diff --git a/test/fs/invalid_filename.exp b/test/fs/invalid_filename.exp
new file mode 100755
index 000000000..1acc85491
--- /dev/null
+++ b/test/fs/invalid_filename.exp
@@ -0,0 +1,189 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --debug-check-filename --noprofile --blacklist=\"bla&&bla\"\r"
11expect {
12 timeout {puts "TESTING ERROR 1.1\n";exit}
13 "Checking filename bla&&bla"
14}
15expect {
16 timeout {puts "TESTING ERROR 1.2\n";exit}
17 "Error:"
18}
19expect {
20 timeout {puts "TESTING ERROR 1.3\n";exit}
21 "is an invalid filename"
22}
23after 100
24
25send -- "firejail --debug-check-filename --noprofile --cgroup=\"bla&&bla\"\r"
26expect {
27 timeout {puts "TESTING ERROR 2.1\n";exit}
28 "Checking filename bla&&bla"
29}
30expect {
31 timeout {puts "TESTING ERROR 2.2\n";exit}
32 "Error:"
33}
34expect {
35 timeout {puts "TESTING ERROR 2.3\n";exit}
36 "is an invalid filename"
37}
38after 100
39
40send -- "firejail --debug-check-filename --noprofile --chroot=\"bla&&bla\"\r"
41expect {
42 timeout {puts "TESTING ERROR 3.1\n";exit}
43 "Checking filename bla&&bla" {puts "normal system\n"}
44 "Error: --chroot option is not available on Grsecurity systems" { puts "\nall done\n"; exit}
45}
46expect {
47 timeout {puts "TESTING ERROR 3.2\n";exit}
48 "Error:"
49}
50expect {
51 timeout {puts "TESTING ERROR 3.3\n";exit}
52 "is an invalid filename"
53}
54after 100
55
56send -- "firejail --debug-check-filename --noprofile --netfilter=\"bla&&bla\"\r"
57expect {
58 timeout {puts "TESTING ERROR 4.1\n";exit}
59 "Checking filename bla&&bla"
60}
61expect {
62 timeout {puts "TESTING ERROR 4.2\n";exit}
63 "Error:"
64}
65expect {
66 timeout {puts "TESTING ERROR 4.3\n";exit}
67 "is an invalid filename"
68}
69after 100
70
71send -- "firejail --debug-check-filename --noprofile --output=\"bla&&bla\"\r"
72expect {
73 timeout {puts "TESTING ERROR 5.2\n";exit}
74 "Error:"
75}
76expect {
77 timeout {puts "TESTING ERROR 5.3\n";exit}
78 "is an invalid filename"
79}
80after 100
81
82send -- "firejail --debug-check-filename --noprofile --private=\"bla&&bla\"\r"
83expect {
84 timeout {puts "TESTING ERROR 6.1\n";exit}
85 "Checking filename bla&&bla"
86}
87expect {
88 timeout {puts "TESTING ERROR 6.2\n";exit}
89 "Error:"
90}
91expect {
92 timeout {puts "TESTING ERROR 6.3\n";exit}
93 "is an invalid filename"
94}
95after 100
96
97send -- "firejail --debug-check-filename --noprofile --private-bin=\"bla&&bla\"\r"
98expect {
99 timeout {puts "TESTING ERROR 7.1\n";exit}
100 "Checking filename bla&&bla"
101}
102expect {
103 timeout {puts "TESTING ERROR 7.2\n";exit}
104 "Error:"
105}
106expect {
107 timeout {puts "TESTING ERROR 7.3\n";exit}
108 "is an invalid filename"
109}
110after 100
111
112send -- "firejail --debug-check-filename --noprofile --private-etc=\"bla&&bla\"\r"
113expect {
114 timeout {puts "TESTING ERROR 9.1\n";exit}
115 "Checking filename bla&&bla"
116}
117expect {
118 timeout {puts "TESTING ERROR 9.2\n";exit}
119 "Error:"
120}
121expect {
122 timeout {puts "TESTING ERROR 9.3\n";exit}
123 "is an invalid filename"
124}
125after 100
126
127send -- "firejail --debug-check-filename --profile=\"bla&&bla\"\r"
128expect {
129 timeout {puts "TESTING ERROR 10.1\n";exit}
130 "Checking filename bla&&bla"
131}
132expect {
133 timeout {puts "TESTING ERROR 10.2\n";exit}
134 "Error:"
135}
136expect {
137 timeout {puts "TESTING ERROR 10.3\n";exit}
138 "is an invalid filename"
139}
140after 100
141
142send -- "firejail --debug-check-filename --read-only=\"bla&&bla\"\r"
143expect {
144 timeout {puts "TESTING ERROR 11.1\n";exit}
145 "Checking filename bla&&bla"
146}
147expect {
148 timeout {puts "TESTING ERROR 11.2\n";exit}
149 "Error:"
150}
151expect {
152 timeout {puts "TESTING ERROR 11.3\n";exit}
153 "is an invalid filename"
154}
155after 100
156
157send -- "firejail --debug-check-filename --shell=\"bla&&bla\"\r"
158expect {
159 timeout {puts "TESTING ERROR 12.1\n";exit}
160 "Checking filename bla&&bla"
161}
162expect {
163 timeout {puts "TESTING ERROR 12.2\n";exit}
164 "Error:"
165}
166expect {
167 timeout {puts "TESTING ERROR 12.3\n";exit}
168 "is an invalid filename"
169}
170after 100
171
172
173send -- "firejail --debug-check-filename --whitelist=\"bla&&bla\"\r"
174expect {
175 timeout {puts "TESTING ERROR 14.1\n";exit}
176 "Checking filename bla&&bla"
177}
178expect {
179 timeout {puts "TESTING ERROR 14.2\n";exit}
180 "Error:"
181}
182expect {
183 timeout {puts "TESTING ERROR 14.3\n";exit}
184 "is an invalid filename"
185}
186after 100
187
188puts "\nall done\n"
189