@@ -167,14 +167,16 @@ teardown() {
167
167
168
168
@test " TCP listen without iptables" {
169
169
sudo ip netns exec SouthNS bash -c ' ../bin/netkat --listen 1.1.1.2 9090 > /tmp/test_output.log' 3>& - &
170
+ sleep 1
170
171
sudo ip netns exec NorthNS bash -c " cat ./test_short.log | nc 1.1.1.2 9090"
171
172
run diff ./test_short.log /tmp/test_output.log
172
173
[ " $status " -eq 0 ]
173
174
}
174
175
175
176
@test " TCP listen without iptables long file" {
176
177
sudo ip netns exec SouthNS bash -c ' ../bin/netkat --listen 1.1.1.2 9090 > /tmp/test_output.log' 3>& - &
177
- sudo ip netns exec NorthNS bash -c " cat ./test_long.log | nc 9090"
178
+ sleep 1
179
+ sudo ip netns exec NorthNS bash -c " cat ./test_long.log | nc 1.1.1.2 9090"
178
180
run diff ./test_long.log /tmp/test_output.log
179
181
[ " $status " -eq 0 ]
180
182
}
@@ -206,7 +208,7 @@ teardown() {
206
208
207
209
@test " TCP listen with iptables in input" {
208
210
# add iptables rule to block traffic
209
- sudo ip netns exec NorthNS bash -c " iptables -A INPUT -d 1.1.1.2 -j DROP"
211
+ sudo ip netns exec SouthNS bash -c " iptables -A INPUT -d 1.1.1.2 -j DROP"
210
212
# verify it actually drops traffic
211
213
run sudo ip netns exec NorthNS ping -c 1 1.1.1.2
212
214
[ " $status " -eq 1 ]
@@ -219,7 +221,7 @@ teardown() {
219
221
220
222
@test " TCP listen with iptables in input long file" {
221
223
# add iptables rule to block traffic
222
- sudo ip netns exec NorthNS bash -c " iptables -A INPUT -d 1.1.1.2 -j DROP"
224
+ sudo ip netns exec SouthNS bash -c " iptables -A INPUT -d 1.1.1.2 -j DROP"
223
225
# verify it actually drops traffic
224
226
run sudo ip netns exec NorthNS ping -c 1 1.1.1.2
225
227
[ " $status " -eq 1 ]
0 commit comments