Repository navigation
Test rig fixes #1704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Test rig fixes #1704
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5e71716
test: add igmp_basic_3duts, IGMP basic spread over three DUTs
mattiaswal b1d85ea
test: ospf_multiarea: one step per neighbor adjacency
mattiaswal 9120e4c
test: dhcp/server_boot: retry the host MAC change
mattiaswal 42def34
test: drop wifi_station_from_scan
mattiaswal 29f6ac2
statd: report the installer's last-error
mattiaswal f692e58
test: system/upgrade: fail on install error with the reason
mattiaswal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| === IGMP Basic 3 DUTs | ||
|
|
||
| ifdef::topdoc[:imagesdir: {topdoc}../../test/case/interfaces/igmp_basic_3duts] | ||
|
|
||
| ==== Description | ||
|
|
||
| The same check as IGMP basic, spread over three bridges in a chain so | ||
| that each DUT only needs a single port facing the host. A multicast sender sits | ||
| behind dut1, a non-member behind dut2, and the receiver behind dut3. | ||
| The membership report from the receiver must propagate through dut3 | ||
| and dut2 up to the querier on dut1 before dut2 prunes the group from | ||
| its own host port. | ||
|
|
||
| .... | ||
| 10.0.0.1 | ||
| .-----------. .----------------. .-----------. | ||
| | dut1 | | dut2 | | dut3 | | ||
| '-data-link-'-------'-west-data-east-'-------'-link-data-' | ||
| | | | 10.0.0.0/24 | ||
| .-data1-. .-data2-. .-data3-. | ||
| | msend | | !memb | | mrecv | | ||
| '-------' '-------' '-------' | ||
| .2 .3 .4 | ||
| HOST | ||
| .... | ||
|
|
||
| With no membership the group 224.1.1.1 is flooded to both `!memb` and | ||
| `mrecv`. Once `mrecv` joins, dut2 and dut1 learn the group on their | ||
| links toward dut3, and `!memb` no longer receives it. | ||
|
|
||
| ==== Topology | ||
|
|
||
| image::topology.svg[IGMP Basic 3 DUTs topology, align=center, scaledwidth=75%] | ||
|
|
||
| ==== Sequence | ||
|
|
||
| . Set up topology and attach to target DUTs | ||
| . Configure bridges with IGMP snooping on all DUTs, querier on dut1 with 10.0.0.1/24 | ||
| . Verify host:data1, host:data2 and host:data3 can reach 10.0.0.1 | ||
| . Start multicast sender on host:data1, group 224.1.1.1 | ||
| . Verify group 224.1.1.1 is flooded to host:data2 and host:data3 | ||
| . Join multicast group 224.1.1.1 on host:data3 | ||
| . Verify dut3 has learned group 224.1.1.1 on dut3:data | ||
| . Verify dut2 has learned group 224.1.1.1 on dut2:east | ||
| . Verify dut1 has learned group 224.1.1.1 on dut1:link | ||
| . Verify group 224.1.1.1 is still received on host:data3 | ||
| . Verify group 224.1.1.1 is no longer received on host:data2 | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| #!/usr/bin/env python3 | ||
| """IGMP basic with three DUTs | ||
|
|
||
| The same check as IGMP basic, spread over three bridges in a chain so | ||
| that each DUT only needs a single port facing the host. A multicast sender sits | ||
| behind dut1, a non-member behind dut2, and the receiver behind dut3. | ||
| The membership report from the receiver must propagate through dut3 | ||
| and dut2 up to the querier on dut1 before dut2 prunes the group from | ||
| its own host port. | ||
|
|
||
| .... | ||
| 10.0.0.1 | ||
| .-----------. .----------------. .-----------. | ||
| | dut1 | | dut2 | | dut3 | | ||
| '-data-link-'-------'-west-data-east-'-------'-link-data-' | ||
| | | | 10.0.0.0/24 | ||
| .-data1-. .-data2-. .-data3-. | ||
| | msend | | !memb | | mrecv | | ||
| '-------' '-------' '-------' | ||
| .2 .3 .4 | ||
| HOST | ||
| .... | ||
|
|
||
| With no membership the group 224.1.1.1 is flooded to both `!memb` and | ||
| `mrecv`. Once `mrecv` joins, dut2 and dut1 learn the group on their | ||
| links toward dut3, and `!memb` no longer receives it. | ||
| """ | ||
|
|
||
| import infamy | ||
| import infamy.iface as iface | ||
| import infamy.multicast as mcast | ||
| from infamy.util import until, parallel | ||
|
|
||
| query_interval = 4 | ||
|
|
||
|
|
||
| def bridge(ports, address=None): | ||
| br0 = { | ||
| "name": "br0", | ||
| "enabled": True, | ||
| "type": "infix-if-type:bridge", | ||
| "bridge": { | ||
| "multicast": { | ||
| "snooping": True, | ||
| "query-interval": query_interval | ||
| } | ||
| } | ||
| } | ||
| if address: | ||
| br0["ipv4"] = {"address": [{"ip": address, "prefix-length": 24}]} | ||
|
|
||
| return { | ||
| "ietf-interfaces": { | ||
| "interfaces": { | ||
| "interface": [br0] + [{ | ||
| "name": port, | ||
| "enabled": True, | ||
| "bridge-port": {"bridge": "br0"} | ||
| } for port in ports] | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| with infamy.Test() as test: | ||
| with test.step("Set up topology and attach to target DUTs"): | ||
| env = infamy.Env() | ||
| dut1, dut2, dut3 = parallel(lambda: env.attach("dut1", "mgmt"), | ||
| lambda: env.attach("dut2", "mgmt"), | ||
| lambda: env.attach("dut3", "mgmt")) | ||
| _, d1data = env.ltop.xlate("dut1", "data") | ||
| _, d1link = env.ltop.xlate("dut1", "link") | ||
| _, d2data = env.ltop.xlate("dut2", "data") | ||
| _, d2west = env.ltop.xlate("dut2", "west") | ||
| _, d2east = env.ltop.xlate("dut2", "east") | ||
| _, d3data = env.ltop.xlate("dut3", "data") | ||
| _, d3link = env.ltop.xlate("dut3", "link") | ||
|
|
||
| _, hsend = env.ltop.xlate("host", "data1") | ||
| _, hnojoin = env.ltop.xlate("host", "data2") | ||
| _, hreceive = env.ltop.xlate("host", "data3") | ||
|
|
||
| with test.step("Configure bridges with IGMP snooping on all DUTs, querier on dut1 with 10.0.0.1/24"): | ||
| parallel(lambda: dut1.put_config_dicts(bridge([d1data, d1link], "10.0.0.1")), | ||
| lambda: dut2.put_config_dicts(bridge([d2data, d2west, d2east])), | ||
| lambda: dut3.put_config_dicts(bridge([d3data, d3link]))) | ||
|
|
||
| with infamy.IsolatedMacVlan(hsend) as send_ns, \ | ||
| infamy.IsolatedMacVlan(hnojoin) as nojoin_ns, \ | ||
| infamy.IsolatedMacVlan(hreceive) as receive_ns: | ||
|
|
||
| with test.step("Verify host:data1, host:data2 and host:data3 can reach 10.0.0.1"): | ||
| send_ns.addip("10.0.0.2") | ||
| nojoin_ns.addip("10.0.0.3") | ||
| receive_ns.addip("10.0.0.4") | ||
| parallel(lambda: send_ns.must_reach("10.0.0.1"), | ||
| lambda: nojoin_ns.must_reach("10.0.0.1"), | ||
| lambda: receive_ns.must_reach("10.0.0.1")) | ||
|
|
||
| with test.step("Start multicast sender on host:data1, group 224.1.1.1"): | ||
| with mcast.MCastSender(send_ns, "224.1.1.1"): | ||
| with test.step("Verify group 224.1.1.1 is flooded to host:data2 and host:data3"): | ||
| parallel(lambda: nojoin_ns.must_receive("ip dst 224.1.1.1"), | ||
| lambda: receive_ns.must_receive("ip dst 224.1.1.1")) | ||
|
|
||
| with test.step("Join multicast group 224.1.1.1 on host:data3"): | ||
| with mcast.MCastReceiver(receive_ns, "224.1.1.1"): | ||
| with test.step("Verify dut3 has learned group 224.1.1.1 on dut3:data"): | ||
| until(lambda: iface.exist_bridge_multicast_filter(dut3, "224.1.1.1", d3data, "br0"), attempts=10) | ||
|
|
||
| with test.step("Verify dut2 has learned group 224.1.1.1 on dut2:east"): | ||
| until(lambda: iface.exist_bridge_multicast_filter(dut2, "224.1.1.1", d2east, "br0"), attempts=10) | ||
|
|
||
| with test.step("Verify dut1 has learned group 224.1.1.1 on dut1:link"): | ||
| until(lambda: iface.exist_bridge_multicast_filter(dut1, "224.1.1.1", d1link, "br0"), attempts=10) | ||
|
|
||
| with test.step("Verify group 224.1.1.1 is still received on host:data3"): | ||
| receive_ns.must_receive("ip dst 224.1.1.1") | ||
|
|
||
| with test.step("Verify group 224.1.1.1 is no longer received on host:data2"): | ||
| nojoin_ns.must_not_receive("ip dst 224.1.1.1") | ||
|
|
||
| test.succeed() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| graph "igmp-basic-3duts" { | ||
| layout="neato"; | ||
| overlap="false"; | ||
| esep="+40"; | ||
|
|
||
| node [shape=record, fontname="DejaVu Sans Mono, Book"]; | ||
| edge [color="cornflowerblue", penwidth="2", fontname="DejaVu Serif, Book"]; | ||
|
|
||
| host [ | ||
| label="host | { <mgmt1> mgmt1 | <data1> data1 | <mgmt2> mgmt2 | <data2> data2 | <mgmt3> mgmt3 | <data3> data3 }", | ||
| pos="0,10!", | ||
| requires="controller", | ||
| ]; | ||
|
|
||
| dut1 [ | ||
| label="{ <mgmt> mgmt | <data> data | <link> link } | dut1 \n\n(br0)\n10.0.0.1/24", | ||
| pos="12,20!", | ||
| requires="infix", | ||
| ]; | ||
|
|
||
| dut2 [ | ||
| label="{ <west> west | <mgmt> mgmt | <data> data | <east> east } | dut2 \n\n(br0)", | ||
| pos="12,10!", | ||
| requires="infix", | ||
| ]; | ||
|
|
||
| dut3 [ | ||
| label="{ <link> link | <mgmt> mgmt | <data> data } | dut3 \n\n(br0)", | ||
| pos="12,0!", | ||
| requires="infix", | ||
| ]; | ||
|
|
||
| host:mgmt1 -- dut1:mgmt [requires="mgmt", color="lightgray"] | ||
| host:mgmt2 -- dut2:mgmt [requires="mgmt", color="lightgray"] | ||
| host:mgmt3 -- dut3:mgmt [requires="mgmt", color="lightgray"] | ||
|
|
||
| host:data1 -- dut1:data [color=black, fontcolor=black, taillabel="10.0.0.2/24"] | ||
| host:data2 -- dut2:data [color=black, fontcolor=black, taillabel="10.0.0.3/24"] | ||
| host:data3 -- dut3:data [color=black, fontcolor=black, taillabel="10.0.0.4/24"] | ||
|
|
||
| dut1:link -- dut2:west [color=black] | ||
| dut2:east -- dut3:link [color=black] | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: We do not have to this anymore, since e4535aa, you can just subscript a device to translate logical port names to physical ones:
I created #1705 to be done with this once and for all.