aboutsummaryrefslogtreecommitdiffstats
path: root/test/network/net_netfilter.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/network/net_netfilter.exp')
-rwxr-xr-xtest/network/net_netfilter.exp77
1 files changed, 7 insertions, 70 deletions
diff --git a/test/network/net_netfilter.exp b/test/network/net_netfilter.exp
index 97170a1b9..56480251e 100755
--- a/test/network/net_netfilter.exp
+++ b/test/network/net_netfilter.exp
@@ -8,83 +8,20 @@ spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10# check default netfilter on br0 10# check default netfilter on br0
11send -- "firejail --debug --noprofile --net=br0 --ip=10.10.20.5 --netfilter\r" 11send -- "firejail --name=test --net=br0 --netfilter\r"
12expect { 12expect {
13 timeout {puts "TESTING ERROR 0\n";exit} 13 timeout {puts "TESTING ERROR 0\n";exit}
14 "Installing firewall"
15}
16expect {
17 timeout {puts "TESTING ERROR 1\n";exit}
18 "Chain INPUT (policy DROP"
19}
20expect {
21 timeout {puts "TESTING ERROR 2\n";exit}
22 "ACCEPT all -- any any anywhere"
23}
24expect {
25 timeout {puts "TESTING ERROR 3\n";exit}
26 "ACCEPT icmp -- any any anywhere"
27}
28expect {
29 timeout {puts "TESTING ERROR 4\n";exit}
30 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" 14 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
31} 15}
32sleep 1 16sleep 2
33send -- "exit\r" 17spawn $env(SHELL)
34sleep 1
35 18
36# check default netfilter no new network 19# check default netfilter no new network
37send -- "firejail --debug --noprofile --netfilter\r" 20send -- "firejail --netfilter.print=test\r"
38expect {
39 timeout {puts "TESTING ERROR 5\n";exit}
40 "Installing network filter" {puts "TESTING ERROR 5.1\n";exit}
41 "Chain INPUT (policy DROP" {puts "TESTING ERROR 5.1\n";exit}
42 "ACCEPT all -- any any anywhere" {puts "TESTING ERROR 5.1\n";exit}
43 "ACCEPT icmp -- any any anywhere" {puts "TESTING ERROR 5.1\n";exit}
44 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
45}
46sleep 1
47send -- "exit\r"
48sleep 1
49
50# check file filter netfilter on br0
51send -- "firejail --debug --noprofile --net=br0 --ip=10.10.20.5 --netfilter=netfilter.filter\r"
52expect {
53 timeout {puts "TESTING ERROR 6\n";exit}
54 "Installing firewall"
55}
56expect {
57 timeout {puts "TESTING ERROR 6.1\n";exit}
58 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
59}
60sleep 1
61send -- "ping -c 1 -w 3 10.10.20.1\r"
62expect {
63 timeout {puts "TESTING ERROR 6.2\n";exit}
64 "0 received, 100% packet loss"
65}
66
67send -- "exit\r"
68sleep 1
69
70# check profile netfilter on br0
71send -- "firejail --debug --net=br0 --ip=10.10.20.5 --profile=netfilter.profile\r"
72expect { 21expect {
73 timeout {puts "TESTING ERROR 7\n";exit} 22 timeout {puts "TESTING ERROR 1\n";exit}
74 "Installing firewall" 23 "ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED"
75}
76expect {
77 timeout {puts "TESTING ERROR 7.1\n";exit}
78 -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms"
79}
80sleep 2
81send -- "ping -c 1 -w 3 10.10.20.1\r"
82expect {
83 timeout {puts "TESTING ERROR 7.2\n";exit}
84 "0 received, 100% packet loss"
85} 24}
86 25
87send -- "exit\r" 26after 500
88after 100
89
90puts "all done\n" 27puts "all done\n"