Skip to content

Commit f6bd209

Browse files
authored
Merge pull request #842 from kernelkit/update-vlan-separation-test
test: bridge_vlan_separation: Make test more robust
2 parents eabf79c + b36e55e commit f6bd209

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

test/case/ietf_interfaces/bridge_vlan_separation/Readme.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ endif::topdoc[]
4040
. Verify ping 10.0.0.4 from host:data11
4141
. Verify ping not possible host:data10->10.0.0.4, host:data11->10.0.0.3, host:data10->10.0.0.2, host:data11->10.0.0.1
4242
. Verify MAC broadcast isolation within VLANs
43+
. Send ping to 10.0.0.255 from host:data10
44+
. Verify broadcast is received on host:data20
45+
. Verify broadcast is NOT received on host:data11 and host:data21
4346

4447

4548
<<<

test/case/ietf_interfaces/bridge_vlan_separation/test.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
....
2525
"""
2626
import infamy
27+
import subprocess
2728

2829
with infamy.Test() as test:
2930
with test.step("Set up topology and attach to target DUT"):
@@ -168,21 +169,25 @@
168169
lambda: ns11.must_not_reach("10.0.0.3"),
169170
lambda: ns10.must_not_reach("10.0.0.2"),
170171
lambda: ns11.must_not_reach("10.0.0.1"))
171-
172+
172173
with test.step("Verify MAC broadcast isolation within VLANs"):
173174
# Clear ARP entries/queued packets
174175
ns10.runsh("ip neigh flush all")
175176
ns11.runsh("ip neigh flush all")
176177
ns20.runsh("ip neigh flush all")
177178
ns21.runsh("ip neigh flush all")
178179

179-
lambda: ns10.runsh("ping -b -c 5 -i 0.5 10.0.0.255"),
180-
181-
lambda: ns20.must_receive("broadcast or arp"),
182-
183-
infamy.parallel(
184-
lambda: ns11.must_not_receive("broadcast or arp"),
185-
lambda: ns21.must_not_receive("broadcast or arp")
186-
)
180+
# Sending IP subnet broadcast, resulting in MAC broadcast
181+
with test.step("Send ping to 10.0.0.255 from host:data10"):
182+
process=ns10.popen("ping -b -c 5 -i 0.5 10.0.0.255".split(), stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
183+
184+
with test.step("Verify broadcast is received on host:data20"):
185+
ns20.must_receive("ip dst 10.0.0.255")
186+
187+
with test.step("Verify broadcast is NOT received on host:data11 and host:data21"):
188+
infamy.parallel(
189+
lambda: ns11.must_not_receive("ip dst 10.0.0.255"),
190+
lambda: ns21.must_not_receive("ip dst 10.0.0.255")
191+
)
187192

188193
test.succeed()

0 commit comments

Comments
 (0)