aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters/protocol.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/filters/protocol.exp')
-rwxr-xr-xtest/filters/protocol.exp171
1 files changed, 15 insertions, 156 deletions
diff --git a/test/filters/protocol.exp b/test/filters/protocol.exp
index 071460e4c..09c742378 100755
--- a/test/filters/protocol.exp
+++ b/test/filters/protocol.exp
@@ -7,179 +7,38 @@ set timeout 10
7spawn $env(SHELL) 7spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "firejail --noprofile --protocol=unix ./syscall_test socket\r" 10send -- "firejail --noprofile --protocol=unix --debug\r"
11expect { 11expect {
12 timeout {puts "TESTING ERROR 1\n";exit} 12 timeout {puts "TESTING ERROR 1\n";exit}
13 "Permission denied" {puts "TESTING SKIP: permission denied\n"; exit} 13 "0009: 20 00 00 00000000 ld data.syscall-number"
14 "Child process initialized"
15} 14}
16expect { 15expect {
17 timeout {puts "TESTING ERROR 1.1\n";exit}
18 "Permission denied" {puts "TESTING SKIP: permission denied\n"; exit}
19 "socket AF_INET"
20}
21expect {
22 timeout {puts "TESTING ERROR 1.2\n";exit}
23 "Operation not supported"
24}
25expect {
26 timeout {puts "TESTING ERROR 1.3\n";exit}
27 "socket AF_INET6"
28}
29expect {
30 timeout {puts "TESTING ERROR 1.4\n";exit}
31 "Operation not supported"
32}
33expect {
34 timeout {puts "TESTING ERROR 1.5\n";exit}
35 "socket AF_NETLINK"
36}
37expect {
38 timeout {puts "TESTING ERROR 1.6\n";exit}
39 "Operation not supported"
40}
41expect {
42 timeout {puts "TESTING ERROR 1.7\n";exit}
43 "socket AF_UNIX"
44}
45expect {
46 timeout {puts "TESTING ERROR 1.8\n";exit}
47 "socket AF_PACKETX"
48}
49expect {
50 timeout {puts "TESTING ERROR 1.9\n";exit}
51 "Operation not supported"
52}
53sleep 1
54
55send -- "firejail --noprofile --protocol=inet6,packet ./syscall_test socket\r"
56expect {
57 timeout {puts "TESTING ERROR 2\n";exit} 16 timeout {puts "TESTING ERROR 2\n";exit}
58 "Child process initialized" 17 "000a: 15 01 00 00000029 jeq socket 000c (false 000b)"
59}
60expect {
61 timeout {puts "TESTING ERROR 2.1\n";exit}
62 "socket AF_INET"
63}
64expect {
65 timeout {puts "TESTING ERROR 2.2\n";exit}
66 "Operation not supported"
67}
68expect {
69 timeout {puts "TESTING ERROR 2.3\n";exit}
70 "socket AF_INET6"
71}
72expect {
73 timeout {puts "TESTING ERROR 2.4\n";exit}
74 "socket AF_NETLINK"
75}
76expect {
77 timeout {puts "TESTING ERROR 2.5\n";exit}
78 "Operation not supported"
79}
80expect {
81 timeout {puts "TESTING ERROR 2.6\n";exit}
82 "socket AF_UNIX"
83}
84expect {
85 timeout {puts "TESTING ERROR 2.7\n";exit}
86 "Operation not supported"
87}
88expect {
89 timeout {puts "TESTING ERROR 2.8\n";exit}
90 "socket AF_PACKETX"
91}
92expect {
93 timeout {puts "TESTING ERROR 2.9\n";exit}
94 "after socket"
95} 18}
96sleep 1
97
98# profile testing
99send -- "firejail --profile=protocol1.profile ./syscall_test socket\r"
100expect { 19expect {
101 timeout {puts "TESTING ERROR 3\n";exit} 20 timeout {puts "TESTING ERROR 3\n";exit}
102 "Child process initialized" 21 "000b: 06 00 00 7fff0000 ret ALLOW"
103}
104expect {
105 timeout {puts "TESTING ERROR 3.1\n";exit}
106 "socket AF_INET"
107}
108expect {
109 timeout {puts "TESTING ERROR 3.2\n";exit}
110 "Operation not supported"
111}
112expect {
113 timeout {puts "TESTING ERROR 3.3\n";exit}
114 "socket AF_INET6"
115}
116expect {
117 timeout {puts "TESTING ERROR 3.4\n";exit}
118 "Operation not supported"
119}
120expect {
121 timeout {puts "TESTING ERROR 3.5\n";exit}
122 "socket AF_NETLINK"
123}
124expect {
125 timeout {puts "TESTING ERROR 3.6\n";exit}
126 "Operation not supported"
127}
128expect {
129 timeout {puts "TESTING ERROR 3.7\n";exit}
130 "socket AF_UNIX"
131}
132expect {
133 timeout {puts "TESTING ERROR 3.8\n";exit}
134 "socket AF_PACKETX"
135} 22}
136expect { 23expect {
137 timeout {puts "TESTING ERROR 3.9\n";exit}
138 "Operation not supported"
139}
140sleep 1
141
142send -- "firejail --profile=protocol2.profile ./syscall_test socket\r"
143expect {
144 timeout {puts "TESTING ERROR 4\n";exit} 24 timeout {puts "TESTING ERROR 4\n";exit}
145 "Child process initialized" 25 "000c: 20 00 00 00000010 ld data.args"
146}
147expect {
148 timeout {puts "TESTING ERROR 4.1\n";exit}
149 "socket AF_INET"
150}
151expect {
152 timeout {puts "TESTING ERROR 4.2\n";exit}
153 "Operation not supported"
154}
155expect {
156 timeout {puts "TESTING ERROR 4.3\n";exit}
157 "socket AF_INET6"
158} 26}
159expect { 27expect {
160 timeout {puts "TESTING ERROR 4.4\n";exit} 28 timeout {puts "TESTING ERROR 5\n";exit}
161 "socket AF_NETLINK" 29 "000d: 15 00 01 00000001 jeq 1 000e (false 000f)"
162} 30}
163expect { 31expect {
164 timeout {puts "TESTING ERROR 4.5\n";exit} 32 timeout {puts "TESTING ERROR 6\n";exit}
165 "Operation not supported" 33 "000e: 06 00 00 7fff0000 ret ALLOW"
34 ""
166} 35}
167expect { 36expect {
168 timeout {puts "TESTING ERROR 4.6\n";exit} 37 timeout {puts "TESTING ERROR 7\n";exit}
169 "socket AF_UNIX" 38 "000f: 06 00 00 0005005f ret ERRNO(95)"
170} 39}
171expect {
172 timeout {puts "TESTING ERROR 4.7\n";exit}
173 "Operation not supported"
174}
175expect {
176 timeout {puts "TESTING ERROR 4.8\n";exit}
177 "socket AF_PACKETX"
178}
179expect {
180 timeout {puts "TESTING ERROR 4.9\n";exit}
181 "after socket"
182}
183after 100
184 40
41after 100
42send -- "exit\r"
43after 100
185puts "\nall done\n" 44puts "\nall done\n"