aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-04-04 22:01:33 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-04-04 22:01:33 -0400
commit54fc70b7bf4e3f74c63d068a873de5a9ddf78330 (patch)
tree98e15626d9271b14f8208e29debbb6685eb0d65a
parentgrsecurity: --join, --shutdown (diff)
downloadfirejail-54fc70b7bf4e3f74c63d068a873de5a9ddf78330.tar.gz
firejail-54fc70b7bf4e3f74c63d068a873de5a9ddf78330.tar.zst
firejail-54fc70b7bf4e3f74c63d068a873de5a9ddf78330.zip
grsecurity: network testing
-rwxr-xr-xtest/4bridges_arp.exp37
-rwxr-xr-xtest/4bridges_ip.exp35
-rwxr-xr-xtest/net_defaultgw.exp35
-rwxr-xr-xtest/net_defaultgw2.exp47
-rwxr-xr-xtest/net_ip.exp33
5 files changed, 59 insertions, 128 deletions
diff --git a/test/4bridges_arp.exp b/test/4bridges_arp.exp
index 3004082e6..6a3e6db2a 100755
--- a/test/4bridges_arp.exp
+++ b/test/4bridges_arp.exp
@@ -115,7 +115,7 @@ sleep 2
115 115
116 116
117# check loopback 117# check loopback
118send -- "firejail --net=br0 --net=br1 --net=br2 --net=br3\r" 118send -- "firejail --net=br0 --net=br1 --net=br2 --net=br3 --protocol=unix,inet,netlink\r"
119expect { 119expect {
120 timeout {puts "TESTING ERROR 5\n";exit} 120 timeout {puts "TESTING ERROR 5\n";exit}
121 "lo" 121 "lo"
@@ -136,40 +136,35 @@ expect {
136 timeout {puts "TESTING ERROR 9\n";exit} 136 timeout {puts "TESTING ERROR 9\n";exit}
137 "Child process initialized" 137 "Child process initialized"
138} 138}
139sleep 1
139 140
140# check default gateway 141# check default gateway
141send -- "bash\r" 142send -- "ip route show\r"
142sleep 1
143send -- "netstat -rn;pwd\r"
144expect { 143expect {
145 timeout {puts "TESTING ERROR 10.1\n";exit} 144 timeout {puts "TESTING ERROR 10.1\n";exit}
146 "0.0.0.0" 145 "default via 10.10.20.1 dev eth0"
147} 146}
147send -- "ip route show\r"
148expect { 148expect {
149 timeout {puts "TESTING ERROR 10.2\n";exit} 149 timeout {puts "TESTING ERROR 10.2\n";exit}
150 "10.10.20.1" 150 "10.10.20.0/29 dev eth0 proto kernel scope link"
151}
152expect {
153 timeout {puts "TESTING ERROR 10.3\n";exit}
154 "eth0"
155} 151}
152send -- "ip route show\r"
156expect { 153expect {
157 timeout {puts "TESTING ERROR 10.4\n";exit} 154 timeout {puts "TESTING ERROR 10.2\n";exit}
158 "10.10.20.0" 155 "10.10.30.0/24 dev eth1 proto kernel scope link"
159}
160expect {
161 timeout {puts "TESTING ERROR 10.5\n";exit}
162 "0.0.0.0"
163} 156}
157send -- "ip route show\r"
164expect { 158expect {
165 timeout {puts "TESTING ERROR 10.6\n";exit} 159 timeout {puts "TESTING ERROR 10.2\n";exit}
166 "eth0" 160 "10.10.40.0/24 dev eth2 proto kernel scope link"
167} 161}
162send -- "ip route show\r"
168expect { 163expect {
169 timeout {puts "TESTING ERROR 10\n";exit} 164 timeout {puts "TESTING ERROR 10.2\n";exit}
170 "home" 165 "10.10.50.0/24 dev eth3 proto kernel scope link"
171} 166}
172sleep 1 167sleep 1
173 168
174puts "\n" 169puts "\nall done\n"
175 170
diff --git a/test/4bridges_ip.exp b/test/4bridges_ip.exp
index 9e37b4ff4..8068aeebb 100755
--- a/test/4bridges_ip.exp
+++ b/test/4bridges_ip.exp
@@ -115,7 +115,7 @@ sleep 2
115 115
116 116
117# check loopback 117# check loopback
118send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3\r" 118send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3 --protocol=unix,inet,netlink\r"
119expect { 119expect {
120 timeout {puts "TESTING ERROR 5\n";exit} 120 timeout {puts "TESTING ERROR 5\n";exit}
121 "lo" 121 "lo"
@@ -138,38 +138,37 @@ expect {
138} 138}
139 139
140# check default gateway 140# check default gateway
141send -- "bash\r" 141send -- "ip route show\r"
142sleep 1
143send -- "netstat -rn;pwd\r"
144expect { 142expect {
145 timeout {puts "TESTING ERROR 10.1\n";exit} 143 timeout {puts "TESTING ERROR 10.1\n";exit}
146 "0.0.0.0" 144 "default via 10.10.20.1 dev eth0"
147} 145}
146
147send -- "ip route show\r"
148expect { 148expect {
149 timeout {puts "TESTING ERROR 10.2\n";exit} 149 timeout {puts "TESTING ERROR 10.2\n";exit}
150 "10.10.20.1" 150 "10.10.20.0/29 dev eth0 proto kernel scope link"
151} 151}
152
153send -- "ip route show\r"
152expect { 154expect {
153 timeout {puts "TESTING ERROR 10.3\n";exit} 155 timeout {puts "TESTING ERROR 10.3\n";exit}
154 "eth0" 156 "10.10.30.0/24 dev eth1 proto kernel scope link src 10.10.30.50"
155} 157}
158
159send -- "ip route show\r"
156expect { 160expect {
157 timeout {puts "TESTING ERROR 10.4\n";exit} 161 timeout {puts "TESTING ERROR 10.4\n";exit}
158 "10.10.20.0" 162 "10.10.40.0/24 dev eth2 proto kernel scope link src 10.10.40.100"
159} 163}
164
165send -- "ip route show\r"
160expect { 166expect {
161 timeout {puts "TESTING ERROR 10.5\n";exit} 167 timeout {puts "TESTING ERROR 10.5\n";exit}
162 "0.0.0.0" 168 "10.10.50.0/24 dev eth3 proto kernel scope link"
163}
164expect {
165 timeout {puts "TESTING ERROR 10.6\n";exit}
166 "eth0"
167}
168expect {
169 timeout {puts "TESTING ERROR 10\n";exit}
170 "home"
171} 169}
170
172sleep 1 171sleep 1
173 172
174puts "\n" 173puts "\nall done\n"
175 174
diff --git a/test/net_defaultgw.exp b/test/net_defaultgw.exp
index 9820660b7..840f2ccac 100755
--- a/test/net_defaultgw.exp
+++ b/test/net_defaultgw.exp
@@ -5,7 +5,7 @@ spawn $env(SHELL)
5match_max 100000 5match_max 100000
6 6
7# check ip address 7# check ip address
8send -- "firejail --net=br0 --ip=10.10.20.5 --defaultgw=10.10.20.2\r" 8send -- "firejail --net=br0 --ip=10.10.20.5 --defaultgw=10.10.20.2 --protocol=unix,inet,netlink\r"
9expect { 9expect {
10 timeout {puts "TESTING ERROR 0\n";exit} 10 timeout {puts "TESTING ERROR 0\n";exit}
11 "eth0" 11 "eth0"
@@ -26,40 +26,21 @@ expect {
26 timeout {puts "TESTING ERROR 4\n";exit} 26 timeout {puts "TESTING ERROR 4\n";exit}
27 "Child process initialized" 27 "Child process initialized"
28} 28}
29sleep 1
29 30
30# check default gateway 31# check default gateway
31send -- "bash\r" 32send -- "ip route show\r"
32sleep 1
33send -- "netstat -rn;pwd\r"
34expect { 33expect {
35 timeout {puts "TESTING ERROR 10.1\n";exit} 34 timeout {puts "TESTING ERROR 10.1\n";exit}
36 "0.0.0.0" 35 "default via 10.10.20.2 dev eth0"
37} 36}
37
38send -- "ip route show\r"
38expect { 39expect {
39 timeout {puts "TESTING ERROR 10.2\n";exit} 40 timeout {puts "TESTING ERROR 10.2\n";exit}
40 "10.10.20.2" 41 "10.10.20.0/29 dev eth0 proto kernel scope link"
41}
42expect {
43 timeout {puts "TESTING ERROR 10.3\n";exit}
44 "eth0"
45}
46expect {
47 timeout {puts "TESTING ERROR 10.4\n";exit}
48 "10.10.20.0"
49}
50expect {
51 timeout {puts "TESTING ERROR 10.5\n";exit}
52 "0.0.0.0"
53}
54expect {
55 timeout {puts "TESTING ERROR 10.6\n";exit}
56 "eth0"
57}
58expect {
59 timeout {puts "TESTING ERROR 10\n";exit}
60 "home"
61} 42}
62sleep 1 43sleep 1
63 44
64puts "\n" 45puts "\nall done\n"
65 46
diff --git a/test/net_defaultgw2.exp b/test/net_defaultgw2.exp
index be9b4882a..db14e17cb 100755
--- a/test/net_defaultgw2.exp
+++ b/test/net_defaultgw2.exp
@@ -5,7 +5,7 @@ spawn $env(SHELL)
5match_max 100000 5match_max 100000
6 6
7# check ip address 7# check ip address
8send -- "firejail --net=br0 --net=br1 --defaultgw=10.10.30.89\r" 8send -- "firejail --net=br0 --net=br1 --defaultgw=10.10.30.89 --protocol=unix,inet,netlink\r"
9expect { 9expect {
10 timeout {puts "TESTING ERROR 0\n";exit} 10 timeout {puts "TESTING ERROR 0\n";exit}
11 "eth1" 11 "eth1"
@@ -14,52 +14,27 @@ expect {
14 timeout {puts "TESTING ERROR 4\n";exit} 14 timeout {puts "TESTING ERROR 4\n";exit}
15 "Child process initialized" 15 "Child process initialized"
16} 16}
17sleep 1
17 18
18# check default gateway 19# check default gateway
19send -- "bash\r" 20send -- "ip route show\r"
20sleep 1
21send -- "netstat -rn;pwd\r"
22expect { 21expect {
23 timeout {puts "TESTING ERROR 10.1\n";exit} 22 timeout {puts "TESTING ERROR 10.1\n";exit}
24 "0.0.0.0" 23 "default via 10.10.30.89 dev eth1"
25} 24}
25
26send -- "ip route show\r"
26expect { 27expect {
27 timeout {puts "TESTING ERROR 10.2\n";exit} 28 timeout {puts "TESTING ERROR 10.2\n";exit}
28 "10.10.30.89" 29 "10.10.20.0/29 dev eth0 proto kernel scope link"
29} 30}
31
32send -- "ip route show\r"
30expect { 33expect {
31 timeout {puts "TESTING ERROR 10.3\n";exit} 34 timeout {puts "TESTING ERROR 10.3\n";exit}
32 "eth1" 35 "10.10.30.0/24 dev eth1 proto kernel scope link"
33}
34expect {
35 timeout {puts "TESTING ERROR 10.4\n";exit}
36 "10.10.20.0"
37}
38expect {
39 timeout {puts "TESTING ERROR 10.5\n";exit}
40 "0.0.0.0"
41}
42expect {
43 timeout {puts "TESTING ERROR 10.6\n";exit}
44 "eth0"
45}
46expect {
47 timeout {puts "TESTING ERROR 10.4\n";exit}
48 "10.10.30.0"
49}
50expect {
51 timeout {puts "TESTING ERROR 10.5\n";exit}
52 "0.0.0.0"
53}
54expect {
55 timeout {puts "TESTING ERROR 10.6\n";exit}
56 "eth1"
57}
58expect {
59 timeout {puts "TESTING ERROR 10\n";exit}
60 "home"
61} 36}
62sleep 1 37sleep 1
63 38
64puts "\n" 39puts "\nall done\n"
65 40
diff --git a/test/net_ip.exp b/test/net_ip.exp
index 5995296c7..f5d487ecc 100755
--- a/test/net_ip.exp
+++ b/test/net_ip.exp
@@ -31,7 +31,7 @@ send -- "exit\r"
31sleep 2 31sleep 2
32 32
33# check loopback 33# check loopback
34send -- "firejail --net=br0 --ip=10.10.20.5\r" 34send -- "firejail --net=br0 --ip=10.10.20.5 --protocol=unix,inet,netlink\r"
35expect { 35expect {
36 timeout {puts "TESTING ERROR 5\n";exit} 36 timeout {puts "TESTING ERROR 5\n";exit}
37 "lo" 37 "lo"
@@ -52,38 +52,19 @@ expect {
52 timeout {puts "TESTING ERROR 9\n";exit} 52 timeout {puts "TESTING ERROR 9\n";exit}
53 "Child process initialized" 53 "Child process initialized"
54} 54}
55sleep 1
55 56
56# check default gateway 57# check default gateway
57send -- "bash\r" 58send -- "ip route show\r"
58sleep 1
59send -- "netstat -rn;pwd\r"
60expect { 59expect {
61 timeout {puts "TESTING ERROR 10.1\n";exit} 60 timeout {puts "TESTING ERROR 10.1\n";exit}
62 "0.0.0.0" 61 "default via 10.10.20.1 dev eth0"
63}
64expect {
65 timeout {puts "TESTING ERROR 10.2\n";exit}
66 "10.10.20.1"
67}
68expect {
69 timeout {puts "TESTING ERROR 10.3\n";exit}
70 "eth0"
71}
72expect {
73 timeout {puts "TESTING ERROR 10.4\n";exit}
74 "10.10.20.0"
75}
76expect {
77 timeout {puts "TESTING ERROR 10.5\n";exit}
78 "0.0.0.0"
79}
80expect {
81 timeout {puts "TESTING ERROR 10.6\n";exit}
82 "eth0"
83} 62}
63
64send -- "ip route show\r"
84expect { 65expect {
85 timeout {puts "TESTING ERROR 10\n";exit} 66 timeout {puts "TESTING ERROR 10\n";exit}
86 "home" 67 "10.10.20.0/29 dev eth0 proto kernel scope link"
87} 68}
88sleep 1 69sleep 1
89 70