aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters/protocol.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-04-30 07:27:31 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-04-30 07:27:31 -0400
commita1272742cfbdbfe999a701f804b58ceb4605713d (patch)
tree16d6013c8d99d9e4370d1672b4018f958081f416 /test/filters/protocol.exp
parentMerge pull request #490 from reinerh/master (diff)
downloadfirejail-a1272742cfbdbfe999a701f804b58ceb4605713d.tar.gz
firejail-a1272742cfbdbfe999a701f804b58ceb4605713d.tar.zst
firejail-a1272742cfbdbfe999a701f804b58ceb4605713d.zip
added make test-filters
Diffstat (limited to 'test/filters/protocol.exp')
-rwxr-xr-xtest/filters/protocol.exp180
1 files changed, 180 insertions, 0 deletions
diff --git a/test/filters/protocol.exp b/test/filters/protocol.exp
new file mode 100755
index 000000000..cf552da56
--- /dev/null
+++ b/test/filters/protocol.exp
@@ -0,0 +1,180 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --noprofile --protocol=unix ./syscall_test socket\r"
8expect {
9 timeout {puts "TESTING ERROR 1\n";exit}
10 "Child process initialized"
11}
12expect {
13 timeout {puts "TESTING ERROR 1.1\n";exit}
14 "socket AF_INET"
15}
16expect {
17 timeout {puts "TESTING ERROR 1.2\n";exit}
18 "Operation not supported"
19}
20expect {
21 timeout {puts "TESTING ERROR 1.3\n";exit}
22 "socket AF_INET6"
23}
24expect {
25 timeout {puts "TESTING ERROR 1.4\n";exit}
26 "Operation not supported"
27}
28expect {
29 timeout {puts "TESTING ERROR 1.5\n";exit}
30 "socket AF_NETLINK"
31}
32expect {
33 timeout {puts "TESTING ERROR 1.6\n";exit}
34 "Operation not supported"
35}
36expect {
37 timeout {puts "TESTING ERROR 1.7\n";exit}
38 "socket AF_UNIX"
39}
40expect {
41 timeout {puts "TESTING ERROR 1.8\n";exit}
42 "socket AF_PACKETX"
43}
44expect {
45 timeout {puts "TESTING ERROR 1.9\n";exit}
46 "Operation not supported"
47}
48sleep 1
49
50send -- "firejail --noprofile --protocol=inet6,packet ./syscall_test socket\r"
51expect {
52 timeout {puts "TESTING ERROR 2\n";exit}
53 "Child process initialized"
54}
55expect {
56 timeout {puts "TESTING ERROR 2.1\n";exit}
57 "socket AF_INET"
58}
59expect {
60 timeout {puts "TESTING ERROR 2.2\n";exit}
61 "Operation not supported"
62}
63expect {
64 timeout {puts "TESTING ERROR 2.3\n";exit}
65 "socket AF_INET6"
66}
67expect {
68 timeout {puts "TESTING ERROR 2.4\n";exit}
69 "socket AF_NETLINK"
70}
71expect {
72 timeout {puts "TESTING ERROR 2.5\n";exit}
73 "Operation not supported"
74}
75expect {
76 timeout {puts "TESTING ERROR 2.6\n";exit}
77 "socket AF_UNIX"
78}
79expect {
80 timeout {puts "TESTING ERROR 2.7\n";exit}
81 "Operation not supported"
82}
83expect {
84 timeout {puts "TESTING ERROR 2.8\n";exit}
85 "socket AF_PACKETX"
86}
87expect {
88 timeout {puts "TESTING ERROR 2.9\n";exit}
89 "after socket"
90}
91sleep 1
92
93# profile testing
94send -- "firejail --profile=protocol1.profile ./syscall_test socket\r"
95expect {
96 timeout {puts "TESTING ERROR 3\n";exit}
97 "Child process initialized"
98}
99expect {
100 timeout {puts "TESTING ERROR 3.1\n";exit}
101 "socket AF_INET"
102}
103expect {
104 timeout {puts "TESTING ERROR 3.2\n";exit}
105 "Operation not supported"
106}
107expect {
108 timeout {puts "TESTING ERROR 3.3\n";exit}
109 "socket AF_INET6"
110}
111expect {
112 timeout {puts "TESTING ERROR 3.4\n";exit}
113 "Operation not supported"
114}
115expect {
116 timeout {puts "TESTING ERROR 3.5\n";exit}
117 "socket AF_NETLINK"
118}
119expect {
120 timeout {puts "TESTING ERROR 3.6\n";exit}
121 "Operation not supported"
122}
123expect {
124 timeout {puts "TESTING ERROR 3.7\n";exit}
125 "socket AF_UNIX"
126}
127expect {
128 timeout {puts "TESTING ERROR 3.8\n";exit}
129 "socket AF_PACKETX"
130}
131expect {
132 timeout {puts "TESTING ERROR 3.9\n";exit}
133 "Operation not supported"
134}
135sleep 1
136
137send -- "firejail --profile=protocol2.profile ./syscall_test socket\r"
138expect {
139 timeout {puts "TESTING ERROR 4\n";exit}
140 "Child process initialized"
141}
142expect {
143 timeout {puts "TESTING ERROR 4.1\n";exit}
144 "socket AF_INET"
145}
146expect {
147 timeout {puts "TESTING ERROR 4.2\n";exit}
148 "Operation not supported"
149}
150expect {
151 timeout {puts "TESTING ERROR 4.3\n";exit}
152 "socket AF_INET6"
153}
154expect {
155 timeout {puts "TESTING ERROR 4.4\n";exit}
156 "socket AF_NETLINK"
157}
158expect {
159 timeout {puts "TESTING ERROR 4.5\n";exit}
160 "Operation not supported"
161}
162expect {
163 timeout {puts "TESTING ERROR 4.6\n";exit}
164 "socket AF_UNIX"
165}
166expect {
167 timeout {puts "TESTING ERROR 4.7\n";exit}
168 "Operation not supported"
169}
170expect {
171 timeout {puts "TESTING ERROR 4.8\n";exit}
172 "socket AF_PACKETX"
173}
174expect {
175 timeout {puts "TESTING ERROR 4.9\n";exit}
176 "after socket"
177}
178sleep 1
179
180puts "\nall done\n"