|
24 | 24 | .... |
25 | 25 | """ |
26 | 26 | import infamy |
| 27 | +import subprocess |
27 | 28 |
|
28 | 29 | with infamy.Test() as test: |
29 | 30 | with test.step("Set up topology and attach to target DUT"): |
|
168 | 169 | lambda: ns11.must_not_reach("10.0.0.3"), |
169 | 170 | lambda: ns10.must_not_reach("10.0.0.2"), |
170 | 171 | lambda: ns11.must_not_reach("10.0.0.1")) |
171 | | - |
| 172 | + |
172 | 173 | with test.step("Verify MAC broadcast isolation within VLANs"): |
173 | 174 | # Clear ARP entries/queued packets |
174 | 175 | ns10.runsh("ip neigh flush all") |
175 | 176 | ns11.runsh("ip neigh flush all") |
176 | 177 | ns20.runsh("ip neigh flush all") |
177 | 178 | ns21.runsh("ip neigh flush all") |
178 | 179 |
|
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 | + ) |
187 | 192 |
|
188 | 193 | test.succeed() |
0 commit comments