diff --git a/test/case/ietf_interfaces/bridge_basic/Readme.adoc b/test/case/ietf_interfaces/bridge_basic/Readme.adoc index 2e23fd20c..e0f2c420f 100644 --- a/test/case/ietf_interfaces/bridge_basic/Readme.adoc +++ b/test/case/ietf_interfaces/bridge_basic/Readme.adoc @@ -2,6 +2,14 @@ ==== Description Test basic connectivity to a bridge +.... + + PING --> br0 (10.0.0.2) + / + PC -------- target:data + +.... + ==== Topology ifdef::topdoc[] image::../../test/case/ietf_interfaces/bridge_basic/topology.png[Bridge basic topology] @@ -15,7 +23,7 @@ image::topology.png[Bridge basic topology] endif::testgroup[] endif::topdoc[] ==== Test sequence -. Initialize +. Set up topology and attach to target DUT . Configure single bridge with a single physical port, bridge @ IP 10.0.0.2 . Verify ping 10.0.0.2 is possible from host:data diff --git a/test/case/ietf_interfaces/bridge_basic/test.py b/test/case/ietf_interfaces/bridge_basic/test.py index 0206be46e..180d21266 100755 --- a/test/case/ietf_interfaces/bridge_basic/test.py +++ b/test/case/ietf_interfaces/bridge_basic/test.py @@ -1,18 +1,22 @@ #!/usr/bin/env python3 -# -# PING --> br0 10.0.0.2 -# / -# PC ---- e0 -# -""" +r""" Bridge basic Test basic connectivity to a bridge + +.... + + PING --> br0 (10.0.0.2) + / + PC -------- target:data + +.... + """ import infamy with infamy.Test() as test: - with test.step("Initialize"): + with test.step("Set up topology and attach to target DUT"): env = infamy.Env() target = env.attach("target", "mgmt") diff --git a/test/case/ietf_interfaces/bridge_basic/topology.dot b/test/case/ietf_interfaces/bridge_basic/topology.dot index d2689c6c9..38968cb0d 100644 --- a/test/case/ietf_interfaces/bridge_basic/topology.dot +++ b/test/case/ietf_interfaces/bridge_basic/topology.dot @@ -7,18 +7,18 @@ graph "1x2" { edge [color="cornflowerblue", penwidth="2"]; host [ - label="host | { tgt | data }", + label="host | { mgmt | data }", pos="0,12!", kind="controller", ]; target [ - label="{ mgmt | data } | target\n10.0.0.2/24 (br0)", + label="{ mgmt | data } | target", pos="10,12!", kind="infix", ]; - host:tgt -- target:mgmt [kind=mgmt] + host:mgmt -- target:mgmt [kind=mgmt, color=lightgrey] host:data -- target:data [color=black, fontcolor=black, taillabel="10.0.0.1/24"] } diff --git a/test/case/ietf_interfaces/bridge_basic/topology.png b/test/case/ietf_interfaces/bridge_basic/topology.png index a21b5282f..e717c5497 100644 Binary files a/test/case/ietf_interfaces/bridge_basic/topology.png and b/test/case/ietf_interfaces/bridge_basic/topology.png differ diff --git a/test/case/ietf_interfaces/bridge_fwd_dual_dut/Readme.adoc b/test/case/ietf_interfaces/bridge_fwd_dual_dut/Readme.adoc index eae0955f6..374ec3a43 100644 --- a/test/case/ietf_interfaces/bridge_fwd_dual_dut/Readme.adoc +++ b/test/case/ietf_interfaces/bridge_fwd_dual_dut/Readme.adoc @@ -2,6 +2,26 @@ ==== Description Ping through two bridges on two different DUTs. +.... + + ,-------------------------------------, ,-------------------------------------, + | dut1:link | | dut2:link | + | br0 ----------|-------|--------- br0 | + | / | | / \ | + |dut1:mgmt dut1:data1 | | dut2:data1 dut2:data2 dut2:mgmt | + '-------------------------------------' '-------------------------------------' + | | | | | + | | | | | +,-----------------------------------------------------------------------------------------, +| host:mgmt1 host:data11 host:data21 host:data22 host:mgmt2 | +| [10.0.0.2] [10.0.0.3] [10.0.0.4] | +| (ns11) (ns20) (ns21) | +| | +| [ HOST ] | +'-----------------------------------------------------------------------------------------' + +.... + ==== Topology ifdef::topdoc[] image::../../test/case/ietf_interfaces/bridge_fwd_dual_dut/topology.png[Bridge forwarding dual DUTs topology] @@ -15,7 +35,7 @@ image::topology.png[Bridge forwarding dual DUTs topology] endif::testgroup[] endif::topdoc[] ==== Test sequence -. Initialize +. Set up topology and attach to target DUT . Configure a bridge with triple physical port . Verify ping 10.0.0.3 and 10.0.0.4 from host:data11 diff --git a/test/case/ietf_interfaces/bridge_fwd_dual_dut/test.py b/test/case/ietf_interfaces/bridge_fwd_dual_dut/test.py index fa375bca9..d91c16a51 100755 --- a/test/case/ietf_interfaces/bridge_fwd_dual_dut/test.py +++ b/test/case/ietf_interfaces/bridge_fwd_dual_dut/test.py @@ -1,38 +1,45 @@ #!/usr/bin/env python3 -# ,-------------------------------------, ,-------------------------------------, -# | dut1:data2 | | dut2:data2 | -# | br0 ----------|-------|--------- br0 | -# | / \ | | / \ | -# |dut1:mgmt dut1:data0 dut1:data1 | | dut2:data0 dut2:data1 dut2:mgmt | -# '-------------------------------------' '-------------------------------------' -# | | | | | | -# | | | | | | -# ,-----------------------------------------------------------------------------------------, -# | host:mgmt0 host:data10 host:data11 host:data20 host:data21 host:mgmt1 | -# | [10.0.0.2] [10.0.0.3] [10.0.0.4] | -# | (ns11) (ns20) (ns21) | -# | | -# | [ HOST ] | -# '-----------------------------------------------------------------------------------------' -""" +r""" Bridge forwarding dual DUTs Ping through two bridges on two different DUTs. + +.... + + ,-------------------------------------, ,-------------------------------------, + | dut1:link | | dut2:link | + | br0 ----------|-------|--------- br0 | + | / | | / \ | + |dut1:mgmt dut1:data1 | | dut2:data1 dut2:data2 dut2:mgmt | + '-------------------------------------' '-------------------------------------' + | | | | | + | | | | | +,-----------------------------------------------------------------------------------------, +| host:mgmt1 host:data11 host:data21 host:data22 host:mgmt2 | +| [10.0.0.2] [10.0.0.3] [10.0.0.4] | +| (ns11) (ns20) (ns21) | +| | +| [ HOST ] | +'-----------------------------------------------------------------------------------------' + +.... + """ + import infamy with infamy.Test() as test: - with test.step("Initialize"): + with test.step("Set up topology and attach to target DUT"): env = infamy.Env() dut1 = env.attach("dut1", "mgmt") dut2 = env.attach("dut2", "mgmt") with test.step("Configure a bridge with triple physical port"): _, tport11 = env.ltop.xlate("dut1", "data1") - _, tport12 = env.ltop.xlate("dut1", "data2") - _, tport20 = env.ltop.xlate("dut2", "data0") + _, tport1_link = env.ltop.xlate("dut1", "link") _, tport21 = env.ltop.xlate("dut2", "data1") _, tport22 = env.ltop.xlate("dut2", "data2") + _, tport2_link = env.ltop.xlate("dut2", "link") dut1.put_config_dict("ietf-interfaces", { "interfaces": { @@ -47,7 +54,7 @@ { "vid": 10, "untagged": [ tport11 ], - "tagged": [ "br0", tport12 ] + "tagged": [ "br0", tport1_link ] } ] } @@ -62,7 +69,7 @@ } }, { - "name": tport12, + "name": tport1_link, "enabled": True, "infix-interfaces:bridge-port": { "bridge": "br0", @@ -84,15 +91,15 @@ "vlan": [ { "vid": 10, - "untagged": [ tport20, tport21 ], - "tagged": [ "br0", tport22 ] + "untagged": [ tport21, tport22 ], + "tagged": [ "br0", tport2_link ] } ] } } }, { - "name": tport20, + "name": tport21, "enabled": True, "infix-interfaces:bridge-port": { "pvid": 10, @@ -100,7 +107,7 @@ } }, { - "name": tport21, + "name": tport22, "enabled": True, "infix-interfaces:bridge-port": { "pvid": 10, @@ -108,7 +115,7 @@ } }, { - "name": tport22, + "name": tport2_link, "enabled": True, "infix-interfaces:bridge-port": { "bridge": "br0", @@ -121,16 +128,16 @@ with test.step("Verify ping 10.0.0.3 and 10.0.0.4 from host:data11"): _, hport11 = env.ltop.xlate("host", "data11") - _, hport20 = env.ltop.xlate("host", "data20") _, hport21 = env.ltop.xlate("host", "data21") + _, hport22 = env.ltop.xlate("host", "data22") with infamy.IsolatedMacVlan(hport11) as ns11, \ - infamy.IsolatedMacVlan(hport20) as ns20, \ - infamy.IsolatedMacVlan(hport21) as ns21: + infamy.IsolatedMacVlan(hport21) as ns21, \ + infamy.IsolatedMacVlan(hport22) as ns22: ns11.addip("10.0.0.2") - ns20.addip("10.0.0.3") - ns21.addip("10.0.0.4") + ns21.addip("10.0.0.3") + ns22.addip("10.0.0.4") ns11.must_reach("10.0.0.3") ns11.must_reach("10.0.0.4") diff --git a/test/case/ietf_interfaces/bridge_fwd_dual_dut/topology.dot b/test/case/ietf_interfaces/bridge_fwd_dual_dut/topology.dot index 475e7847b..b0789134a 100644 --- a/test/case/ietf_interfaces/bridge_fwd_dual_dut/topology.dot +++ b/test/case/ietf_interfaces/bridge_fwd_dual_dut/topology.dot @@ -7,32 +7,32 @@ graph "2x4" { edge [color="cornflowerblue", penwidth="2"]; host [ - label="host | { mgmt1 | data11 | <> \n\n\n| mgmt2 | data20 | data21 }", - pos="0,15!", - height=3, + label="host | { mgmt1 | data11 | <> \n\n\n| mgmt2 | data21 | data22 }", + pos="0,15!", + height=3, - kind="controller", + kind="controller", ]; dut1 [ - label="{ mgmt | data1 } | { dut1 \n\n| data2 }", - pos="4,15.68!", - kind="infix", + label="{ mgmt | data1 } | { dut1 \n\n| link }", + pos="4,15.68!", + kind="infix", ]; dut2 [ - label="{ mgmt | data0 | data1 } | { data2 | \n dut2 }", - pos="4,14.43!", - height=1.2, - kind="infix", + label="{ mgmt | data1 | data2 } | { link | \n dut2 }", + pos="4,14.43!", + height=1.2, + kind="infix", ]; - host:mgmt1 -- dut1:mgmt [kind=mgmt] + host:mgmt1 -- dut1:mgmt [kind=mgmt, color=lightgrey] host:data11 -- dut1:data1 [color=black, fontcolor=black, taillabel="10.0.0.2"] - host:mgmt2 -- dut2:mgmt [kind=mgmt] - host:data20 -- dut2:data0 [color=black, fontcolor=black, taillabel="10.0.0.3"] - host:data21 -- dut2:data1 [color=black, fontcolor=black, taillabel="10.0.0.4"] + host:mgmt2 -- dut2:mgmt [kind=mgmt, color=lightgrey] + host:data21 -- dut2:data1 [color=black, fontcolor=black, taillabel="10.0.0.3"] + host:data22 -- dut2:data2 [color=black, fontcolor=black, taillabel="10.0.0.4"] - dut1:data2 -- dut2:data2 -} \ No newline at end of file + dut1:link -- dut2:link [color=black] +} diff --git a/test/case/ietf_interfaces/bridge_fwd_dual_dut/topology.png b/test/case/ietf_interfaces/bridge_fwd_dual_dut/topology.png index ccb035e02..ef2293658 100644 Binary files a/test/case/ietf_interfaces/bridge_fwd_dual_dut/topology.png and b/test/case/ietf_interfaces/bridge_fwd_dual_dut/topology.png differ diff --git a/test/case/ietf_interfaces/bridge_fwd_sgl_dut/Readme.adoc b/test/case/ietf_interfaces/bridge_fwd_sgl_dut/Readme.adoc index 406738bf4..b54905d6b 100644 --- a/test/case/ietf_interfaces/bridge_fwd_sgl_dut/Readme.adoc +++ b/test/case/ietf_interfaces/bridge_fwd_sgl_dut/Readme.adoc @@ -2,6 +2,26 @@ ==== Description Tests forwarding through a DUT with two bridged interfaces on one DUT. +.... + +,------------------------------------------, +| | +| br0 | +| / \ | +| target:mgmt target:data1 target:data2 | +'------------------------------------------' + | | | + | | | +,------------------------------------------, +| host:mgmt host:data1 host:data2 | +| [10.0.0.1] [10.0.0.2] | +| (ns0) (ns1) | +| | +| [ HOST ] | +'------------------------------------------' + +.... + ==== Topology ifdef::topdoc[] image::../../test/case/ietf_interfaces/bridge_fwd_sgl_dut/topology.png[Bridge forwarding single DUTs topology] @@ -15,7 +35,7 @@ image::topology.png[Bridge forwarding single DUTs topology] endif::testgroup[] endif::topdoc[] ==== Test sequence -. Initialize +. Set up topology and attach to target DUT . Configure a bridge with dual physical port . Verify ping from host:data0 to 10.0.0.1 diff --git a/test/case/ietf_interfaces/bridge_fwd_sgl_dut/test.py b/test/case/ietf_interfaces/bridge_fwd_sgl_dut/test.py index 6dcd1fc8b..ada19e04d 100755 --- a/test/case/ietf_interfaces/bridge_fwd_sgl_dut/test.py +++ b/test/case/ietf_interfaces/bridge_fwd_sgl_dut/test.py @@ -1,34 +1,40 @@ #!/usr/bin/env python3 -# ,-----------------------------------------, -# | | -# | br0 | -# | / \ | -# | target:mgmt tgt:data0 tgt:data1 | -# '-----------------------------------------' -# | | | -# | | | -# ,------------------------------------------, -# | host:mgmt host:data0 host:data1 | -# | [10.0.0.1] [10.0.0.2] | -# | (ns0) (ns1) | -# | | -# | [ HOST ] | -# '------------------------------------------' -""" +r""" Bridge forwarding single DUTs Tests forwarding through a DUT with two bridged interfaces on one DUT. + +.... + +,------------------------------------------, +| | +| br0 | +| / \ | +| target:mgmt target:data1 target:data2 | +'------------------------------------------' + | | | + | | | +,------------------------------------------, +| host:mgmt host:data1 host:data2 | +| [10.0.0.1] [10.0.0.2] | +| (ns0) (ns1) | +| | +| [ HOST ] | +'------------------------------------------' + +.... + """ import infamy with infamy.Test() as test: - with test.step("Initialize"): + with test.step("Set up topology and attach to target DUT"): env = infamy.Env() target = env.attach("target", "mgmt") with test.step("Configure a bridge with dual physical port"): - _, tport0 = env.ltop.xlate("target", "data0") _, tport1 = env.ltop.xlate("target", "data1") + _, tport2 = env.ltop.xlate("target", "data2") target.put_config_dict("ietf-interfaces", { "interfaces": { @@ -39,14 +45,14 @@ "enabled": True, }, { - "name": tport0, + "name": tport1, "enabled": True, "infix-interfaces:bridge-port": { "bridge": "br0" } }, { - "name": tport1, + "name": tport2, "enabled": True, "infix-interfaces:bridge-port": { "bridge": "br0" @@ -57,15 +63,15 @@ }) with test.step("Verify ping from host:data0 to 10.0.0.1"): - _, hport0 = env.ltop.xlate("host", "data0") _, hport1 = env.ltop.xlate("host", "data1") + _, hport2 = env.ltop.xlate("host", "data2") - with infamy.IsolatedMacVlan(hport0) as ns0, \ - infamy.IsolatedMacVlan(hport1) as ns1 : + with infamy.IsolatedMacVlan(hport1) as ns1, \ + infamy.IsolatedMacVlan(hport2) as ns2 : - ns1.addip("10.0.0.2") - ns0.addip("10.0.0.1") + ns2.addip("10.0.0.2") + ns1.addip("10.0.0.1") - ns0.must_reach("10.0.0.2") + ns1.must_reach("10.0.0.2") test.succeed() diff --git a/test/case/ietf_interfaces/bridge_fwd_sgl_dut/topology.dot b/test/case/ietf_interfaces/bridge_fwd_sgl_dut/topology.dot index eedd8240b..2daa01c95 100644 --- a/test/case/ietf_interfaces/bridge_fwd_sgl_dut/topology.dot +++ b/test/case/ietf_interfaces/bridge_fwd_sgl_dut/topology.dot @@ -7,19 +7,19 @@ graph "1x3" { edge [color="cornflowerblue", penwidth="2"]; host [ - label="host | { tgt | data0 | data1 }", + label="host | { mgmt | data1 | data2 }", pos="0,12!", kind="controller", ]; target [ - label="{ mgmt | data0 | data1 } | target", + label="{ mgmt | data1 | data2 } | target", pos="10,12!", kind="infix", ]; - host:tgt -- target:mgmt [kind=mgmt] - host:data0 -- target:data0 [color=black, fontcolor=black, taillabel="10.0.0.1"] - host:data1 -- target:data1 [color=black, fontcolor=black, taillabel="10.0.0.2"] -} \ No newline at end of file + host:mgmt -- target:mgmt [kind=mgmt, color=lightgrey] + host:data1 -- target:data1 [color=black, fontcolor=black, taillabel="10.0.0.1"] + host:data2 -- target:data2 [color=black, fontcolor=black, taillabel="10.0.0.2"] +} diff --git a/test/case/ietf_interfaces/bridge_fwd_sgl_dut/topology.png b/test/case/ietf_interfaces/bridge_fwd_sgl_dut/topology.png index 9b66fc1b4..aa3517c8c 100644 Binary files a/test/case/ietf_interfaces/bridge_fwd_sgl_dut/topology.png and b/test/case/ietf_interfaces/bridge_fwd_sgl_dut/topology.png differ diff --git a/test/case/ietf_interfaces/bridge_vlan_separation/topology.png b/test/case/ietf_interfaces/bridge_vlan_separation/topology.png index ba3d32a28..e587d0975 100644 Binary files a/test/case/ietf_interfaces/bridge_vlan_separation/topology.png and b/test/case/ietf_interfaces/bridge_vlan_separation/topology.png differ diff --git a/test/case/ietf_interfaces/dual_bridge/topology.png b/test/case/ietf_interfaces/dual_bridge/topology.png index a21b5282f..e717c5497 100644 Binary files a/test/case/ietf_interfaces/dual_bridge/topology.png and b/test/case/ietf_interfaces/dual_bridge/topology.png differ diff --git a/test/case/ietf_interfaces/iface_phys_address/Readme.adoc b/test/case/ietf_interfaces/iface_phys_address/Readme.adoc index bc06b476e..223bb4418 100644 --- a/test/case/ietf_interfaces/iface_phys_address/Readme.adoc +++ b/test/case/ietf_interfaces/iface_phys_address/Readme.adoc @@ -1,6 +1,8 @@ === Custom MAC address on interface ==== Description -Test possibility to set and remove custom mac address on interfaces +Verify support for setting and removing a custom MAC address on interfaces. +Both static MAC address and derived from the chassis MAC with, or without, +an offset applied. ==== Topology ifdef::topdoc[] @@ -15,11 +17,16 @@ image::topology.png[Custom MAC address on interface topology] endif::testgroup[] endif::topdoc[] ==== Test sequence +. Verify target:data MAC address is reset to default . Initialize -. Set custom MAC address to '02:01:00:c0:ff:ee' on target:mgmt +. Set target:data static MAC address '02:01:00:c0:ff:ee' . Verify target:mgmt has MAC address '02:01:00:c0:ff:ee' -. Remove custom MAC address '02:01:00:c0:ff:ee' -. Verify that target:mgmt has the original MAC address again +. Reset target:mgmt MAC address to default +. Set target:data to chassis MAC +. Verify target:data has chassis MAC +. Set target:data to chassis MAC + offset +. Verify target:data has chassis MAC + offset +. Reset target:mgmt MAC address to default <<< diff --git a/test/case/ietf_interfaces/iface_phys_address/topology.png b/test/case/ietf_interfaces/iface_phys_address/topology.png index 448374220..5444e060b 100644 Binary files a/test/case/ietf_interfaces/iface_phys_address/topology.png and b/test/case/ietf_interfaces/iface_phys_address/topology.png differ diff --git a/test/case/ietf_interfaces/igmp_vlan/Readme.adoc b/test/case/ietf_interfaces/igmp_vlan/Readme.adoc index 51165e1b2..a3b6d0246 100644 --- a/test/case/ietf_interfaces/igmp_vlan/Readme.adoc +++ b/test/case/ietf_interfaces/igmp_vlan/Readme.adoc @@ -2,6 +2,29 @@ ==== Description Test tagged IGMP control traffic and that VLAN separation is respected for multicast +.... + + VLAN55 VLAN77 VLAN55 VLAN77 + 10.0.1.1 10.0.2.1 10.0.1.2 10.0.2.2 + \ / \ / + \ / \ / + \ / \ / + \--------------/ VLAN 1,2 T \---------------/ + | DUT1 +---------------------------------+ DUT2 | + | |dut1:link dut2:link| | + +--------------+ +-----+---------+ + | | | | + dut1:data1| |dut1:data2 dut2:data1| |dut2:data2 + VLAN55 U | | VLAN77 U VLAN55 U | | VLAN77 U + | | | | + | | | | ++-------+ | +----------+ +------------+ +--------+ +| msend +--+ | mreceive | | mreceive | | msend | ++-------+ +----------+ +------------+ +--------+ + 10.0.1.11 10.0.2.11 10.0.1.22 10.0.2.22 + +.... + ==== Topology ifdef::topdoc[] image::../../test/case/ietf_interfaces/igmp_vlan/topology.png[IGMP VLAN topology] @@ -15,17 +38,17 @@ image::topology.png[IGMP VLAN topology] endif::testgroup[] endif::topdoc[] ==== Test sequence -. Initialize +. Set up topology and attach to target DUT . Configure device -. Start multicast sender on host:data10, group 224.2.2.2 -. Start multicast sender on host:data21, group 224.1.1.1 -. Verify group 224.2.2.2 is flooded to host:data20 -. Verify group 224.1.1.1 is flooded to host:data11 -. Verify group 224.2.2.2 on host:data10, 224.1.1.1 on host:data20, 224.2.2.2 on host:data11 and 224.1.1.1 on host:data21 is not received -. Join multicast group 224.2.2.2 on host:data20 -. Verify group 224.2.2.2 on host:data10, 224.1.1.1 on host:data20, 224.2.2.2 on host:data11 and 224.1.1.1 on host:data21 is not received -. Verify group 224.2.2.2 is forwarded to host:data20 -. Verify group 224.1.1.1 is forwarded to host:data11 +. Start multicast sender on host:data11, group 224.2.2.2 +. Start multicast sender on host:data22, group 224.1.1.1 +. Verify group 224.2.2.2 is flooded to host:data21 +. Verify group 224.1.1.1 is flooded to host:data12 +. Verify group 224.2.2.2 on host:data11, 224.1.1.1 on host:data21, 224.2.2.2 on host:data12 and 224.1.1.1 on host:data22 is not received +. Join multicast group 224.2.2.2 on host:data21 +. Verify group 224.2.2.2 on host:data11, 224.1.1.1 on host:data21, 224.2.2.2 on host:data12 and 224.1.1.1 on host:data22 is not received +. Verify group 224.2.2.2 is forwarded to host:data21 +. Verify group 224.1.1.1 is forwarded to host:data12 <<< diff --git a/test/case/ietf_interfaces/igmp_vlan/test.py b/test/case/ietf_interfaces/igmp_vlan/test.py index 749727493..ec4eaa583 100755 --- a/test/case/ietf_interfaces/igmp_vlan/test.py +++ b/test/case/ietf_interfaces/igmp_vlan/test.py @@ -1,53 +1,54 @@ #!/usr/bin/env python3 -# -# -# VLAN55 VLAN77 VLAN55 VLAN77 -# 10.0.1.1 10.0.2.1 10.0.1.2 10.0.2.2 -# \ / \ / -# \ / \ / -# \ / \ / -# \--------------/ VLAN 1,2 T \---------------/ -# | DUT1 +---------------------------------+ DUT2 | -# | | | | -# +--------------+ +-----+---------+ -# VLAN55 U| VLAN77 U| VLAN55 U | | VLAN77 U -# | | | | -# | | | | -# | | | | -# | | | | -# +-------+ | +----------+ +------------+ +--------+ -# | msend +--+ | mreceive | | mreceive | | msend | -# +-------+ +----------+ +------------+ +--------+ -# 10.0.1.11 10.0.2.11 10.0.1.22 10.0.2.22 -# - -""" +r""" IGMP VLAN Test tagged IGMP control traffic and that VLAN separation is respected for multicast + +.... + + VLAN55 VLAN77 VLAN55 VLAN77 + 10.0.1.1 10.0.2.1 10.0.1.2 10.0.2.2 + \ / \ / + \ / \ / + \ / \ / + \--------------/ VLAN 1,2 T \---------------/ + | DUT1 +---------------------------------+ DUT2 | + | |dut1:link dut2:link| | + +--------------+ +-----+---------+ + | | | | + dut1:data1| |dut1:data2 dut2:data1| |dut2:data2 + VLAN55 U | | VLAN77 U VLAN55 U | | VLAN77 U + | | | | + | | | | ++-------+ | +----------+ +------------+ +--------+ +| msend +--+ | mreceive | | mreceive | | msend | ++-------+ +----------+ +------------+ +--------+ + 10.0.1.11 10.0.2.11 10.0.1.22 10.0.2.22 + +.... + """ import infamy -import time import infamy.multicast as mcast from infamy.util import parallel with infamy.Test() as test: - with test.step("Initialize"): + with test.step("Set up topology and attach to target DUT"): env = infamy.Env() dut1 = env.attach("dut1", "mgmt") - _, d1send = env.ltop.xlate("dut1", "data0") - _, d1receiver = env.ltop.xlate("dut1", "data1") - _, d1trunk = env.ltop.xlate("dut1", "data2") + _, d1send = env.ltop.xlate("dut1", "data1") + _, d1receiver = env.ltop.xlate("dut1", "data2") + _, d1trunk = env.ltop.xlate("dut1", "link") dut2 = env.attach("dut2", "mgmt") - _, d2receive = env.ltop.xlate("dut2", "data0") - _, d2sender = env.ltop.xlate("dut2", "data1") - _, d2trunk = env.ltop.xlate("dut2", "data2") + _, d2receive = env.ltop.xlate("dut2", "data1") + _, d2sender = env.ltop.xlate("dut2", "data2") + _, d2trunk = env.ltop.xlate("dut2", "link") - _, hsendd1 = env.ltop.xlate("host", "data10") - _, hreceived1 = env.ltop.xlate("host", "data11") - _, hreceived2 = env.ltop.xlate("host", "data20") - _, hsendd2 = env.ltop.xlate("host", "data21") + _, hsendd1 = env.ltop.xlate("host", "data11") + _, hreceived1 = env.ltop.xlate("host", "data12") + _, hreceived2 = env.ltop.xlate("host", "data21") + _, hsendd2 = env.ltop.xlate("host", "data22") with test.step("Configure device"): @@ -264,33 +265,33 @@ d2send_ns.addip("10.0.2.22") d1send_ns.must_reach("10.0.1.2") d1receive_ns.must_reach("10.0.2.2") - with test.step("Start multicast sender on host:data10, group 224.2.2.2"): + with test.step("Start multicast sender on host:data11, group 224.2.2.2"): vlan55_sender = mcast.MCastSender(d2send_ns, "224.2.2.2") - with test.step("Start multicast sender on host:data21, group 224.1.1.1"): + with test.step("Start multicast sender on host:data22, group 224.1.1.1"): vlan77_sender= mcast.MCastSender(d1send_ns, "224.1.1.1") with vlan55_sender, vlan77_sender: - with test.step("Verify group 224.2.2.2 is flooded to host:data20"): + with test.step("Verify group 224.2.2.2 is flooded to host:data21"): d1receive_ns.must_receive("ip dst 224.2.2.2") - with test.step("Verify group 224.1.1.1 is flooded to host:data11"): + with test.step("Verify group 224.1.1.1 is flooded to host:data12"): d2receive_ns.must_receive("ip dst 224.1.1.1") - with test.step("Verify group 224.2.2.2 on host:data10, 224.1.1.1 on host:data20, 224.2.2.2 on host:data11 and 224.1.1.1 on host:data21 is not received"): + with test.step("Verify group 224.2.2.2 on host:data11, 224.1.1.1 on host:data21, 224.2.2.2 on host:data12 and 224.1.1.1 on host:data22 is not received"): parallel(d1send_ns.must_not_receive("host 224.2.2.2"), d1receive_ns.must_not_receive("host 224.1.1.1"), d2receive_ns.must_not_receive("host 224.2.2.2"), d2send_ns.must_not_receive("host 224.1.1.1")) - with test.step("Join multicast group 224.2.2.2 on host:data20"): + with test.step("Join multicast group 224.2.2.2 on host:data21"): vlan55_receiver = mcast.MCastReceiver(d1receive_ns, "224.2.2.2") with vlan55_receiver: - with test.step("Verify group 224.2.2.2 on host:data10, 224.1.1.1 on host:data20, 224.2.2.2 on host:data11 and 224.1.1.1 on host:data21 is not received"): + with test.step("Verify group 224.2.2.2 on host:data11, 224.1.1.1 on host:data21, 224.2.2.2 on host:data12 and 224.1.1.1 on host:data22 is not received"): parallel(d1send_ns.must_not_receive("host 224.2.2.2"), d1receive_ns.must_not_receive("host 224.1.1.1"), d1send_ns.must_not_receive("host 224.2.2.2"), d2send_ns.must_not_receive("host 224.1.1.1")) - with test.step("Verify group 224.2.2.2 is forwarded to host:data20"): + with test.step("Verify group 224.2.2.2 is forwarded to host:data21"): d1receive_ns.must_receive("host 224.2.2.2") - with test.step("Verify group 224.1.1.1 is forwarded to host:data11"): + with test.step("Verify group 224.1.1.1 is forwarded to host:data12"): d2receive_ns.must_receive("ip dst 224.1.1.1") test.succeed() diff --git a/test/case/ietf_interfaces/igmp_vlan/topology.dot b/test/case/ietf_interfaces/igmp_vlan/topology.dot index a49fef1e5..dc97ed5f2 100644 --- a/test/case/ietf_interfaces/igmp_vlan/topology.dot +++ b/test/case/ietf_interfaces/igmp_vlan/topology.dot @@ -7,32 +7,32 @@ graph "2x4" { edge [color="cornflowerblue", penwidth="2"]; host [ - label="host | { mgmt1 | data10 | data11 | <> \n\n\n | mgmt2 | data20 | data21 }", - pos="0,15!", - kind="controller", + label="host | { mgmt1 | data11 | data12 | <> \n\n\n | mgmt2 | data21 | data22 }", + pos="0,15!", + kind="controller", ]; dut1 [ - label="{ mgmt | data0 | data1 } | { dut1 \nVLAN55: 10.0.1.1 \nVLAN77: 10.0.2.1 | data2 }", - pos="3,15.4!", - fontsize=12, - kind="infix", + label="{ mgmt | data1 | data2 } | { dut1 \nVLAN55: 10.0.1.1 \nVLAN77: 10.0.2.1 | link }", + pos="3,15.4!", + fontsize=12, + kind="infix", ]; dut2 [ - label="{ mgmt | data0 | data1 } | { data2 | dut2 \nVLAN55: 10.0.1.2 \nVLAN77: 10.0.2.2\n }", - pos="3,14.6!", - fontsize=12, - kind="infix", + label="{ mgmt | data1 | data2 } | { link | dut2 \nVLAN55: 10.0.1.2 \nVLAN77: 10.0.2.2\n }", + pos="3,14.6!", + fontsize=12, + kind="infix", ]; - host:mgmt1 -- dut1:mgmt [kind=mgmt] - host:data10 -- dut1:data0 [color=purple, fontcolor=purple, taillabel="10.0.1.11", headlabel="VLAN55 U"] - host:data11 -- dut1:data1 [color=darkgreen, fontcolor=darkgreen, taillabel="10.0.2.11", headlabel="VLAN77 U"] + host:mgmt1 -- dut1:mgmt [kind=mgmt, color=lightgrey] + host:data11 -- dut1:data1 [color=purple, fontcolor=purple, taillabel="10.0.1.11", headlabel="VLAN55 U"] + host:data12 -- dut1:data2 [color=darkgreen, fontcolor=darkgreen, taillabel="10.0.2.11", headlabel="VLAN77 U"] - host:mgmt2 -- dut2:mgmt [kind=mgmt] - host:data20 -- dut2:data0 [color=purple, fontcolor=purple, taillabel="10.0.1.22", headlabel="VLAN55 U"] - host:data21 -- dut2:data1 [color=darkgreen, fontcolor=darkgreen, taillabel="10.0.2.22", headlabel="VLAN77 U"] + host:mgmt2 -- dut2:mgmt [kind=mgmt, color=lightgrey] + host:data21 -- dut2:data1 [color=purple, fontcolor=purple, taillabel="10.0.1.22", headlabel="VLAN55 U"] + host:data22 -- dut2:data2 [color=darkgreen, fontcolor=darkgreen, taillabel="10.0.2.22", headlabel="VLAN77 U"] - dut1:data2 -- dut2:data2 [color=black, fontcolor=black, label="VLAN 1,2 T"] + dut1:link -- dut2:link [color=black, fontcolor=black, label="VLAN 1,2 T"] } \ No newline at end of file diff --git a/test/case/ietf_interfaces/igmp_vlan/topology.png b/test/case/ietf_interfaces/igmp_vlan/topology.png index ae902bc78..d37f09672 100644 Binary files a/test/case/ietf_interfaces/igmp_vlan/topology.png and b/test/case/ietf_interfaces/igmp_vlan/topology.png differ diff --git a/test/case/ietf_interfaces/ipv4_address/test.py b/test/case/ietf_interfaces/ipv4_address/test.py index 77d98e730..0b8af5502 100755 --- a/test/case/ietf_interfaces/ipv4_address/test.py +++ b/test/case/ietf_interfaces/ipv4_address/test.py @@ -4,7 +4,7 @@ Test that it is possible to set and remove the IPv4 address on an interface """ -import copy + import infamy import infamy.iface as iface diff --git a/test/case/ietf_interfaces/ipv4_autoconf/test.py b/test/case/ietf_interfaces/ipv4_autoconf/test.py index 99aa59a32..f721e478a 100755 --- a/test/case/ietf_interfaces/ipv4_autoconf/test.py +++ b/test/case/ietf_interfaces/ipv4_autoconf/test.py @@ -1,7 +1,4 @@ #!/usr/bin/env python3 -# -# PC ---- e0: 10.0.0.2 -# """ IPv4 link-local @@ -9,6 +6,7 @@ expected. Checks random address, the request-address setting, and address removal on autoconf disable. """ + import ipaddress import infamy import infamy.iface diff --git a/test/case/ietf_interfaces/ipv4_autoconf/topology.dot b/test/case/ietf_interfaces/ipv4_autoconf/topology.dot index a7fee6986..4f53d15af 120000 --- a/test/case/ietf_interfaces/ipv4_autoconf/topology.dot +++ b/test/case/ietf_interfaces/ipv4_autoconf/topology.dot @@ -1 +1 @@ -../bridge_basic/topology.dot \ No newline at end of file +../../../infamy/topologies/1x2.dot \ No newline at end of file diff --git a/test/case/ietf_interfaces/ipv4_autoconf/topology.png b/test/case/ietf_interfaces/ipv4_autoconf/topology.png index a21b5282f..5444e060b 100644 Binary files a/test/case/ietf_interfaces/ipv4_autoconf/topology.png and b/test/case/ietf_interfaces/ipv4_autoconf/topology.png differ diff --git a/test/case/ietf_interfaces/ipv6_address/Readme.adoc b/test/case/ietf_interfaces/ipv6_address/Readme.adoc index 321dce948..6c1345133 100644 --- a/test/case/ietf_interfaces/ipv6_address/Readme.adoc +++ b/test/case/ietf_interfaces/ipv6_address/Readme.adoc @@ -16,7 +16,7 @@ image::topology.png[Interface IPv6 autoconf for bridges topology] endif::testgroup[] endif::topdoc[] ==== Test sequence -. Connect to target +. Set up topology and attach to target DUT . Setting up bridge with IPv6 SLAAC for global prefix on target:data . Verify using sysctl that 'net.ipv6.conf.br0.autoconf' is 1 on target diff --git a/test/case/ietf_interfaces/ipv6_address/test.py b/test/case/ietf_interfaces/ipv6_address/test.py index 3e95d04b7..d3e4f311e 100755 --- a/test/case/ietf_interfaces/ipv6_address/test.py +++ b/test/case/ietf_interfaces/ipv6_address/test.py @@ -8,7 +8,7 @@ import infamy with infamy.Test() as test: - with test.step("Connect to target"): + with test.step("Set up topology and attach to target DUT"): env = infamy.Env() target = env.attach("target", "mgmt") tgtssh = env.attach("target", "mgmt", "ssh") diff --git a/test/case/ietf_interfaces/ipv6_address/topology.png b/test/case/ietf_interfaces/ipv6_address/topology.png index 448374220..5444e060b 100644 Binary files a/test/case/ietf_interfaces/ipv6_address/topology.png and b/test/case/ietf_interfaces/ipv6_address/topology.png differ diff --git a/test/case/ietf_interfaces/verify_all_interface_types/Readme.adoc b/test/case/ietf_interfaces/verify_all_interface_types/Readme.adoc index 6cc66ae73..20d268318 100644 --- a/test/case/ietf_interfaces/verify_all_interface_types/Readme.adoc +++ b/test/case/ietf_interfaces/verify_all_interface_types/Readme.adoc @@ -27,7 +27,7 @@ image::topology.png[Verify that all interface types can be created topology] endif::testgroup[] endif::topdoc[] ==== Test sequence -. Initialize +. Set up topology and attach to target DUT . Configure an empty bridge br-0 . Configure bridge br-X and associated interfaces . Configure VETH pair diff --git a/test/case/ietf_interfaces/verify_all_interface_types/test.py b/test/case/ietf_interfaces/verify_all_interface_types/test.py index 8b4ce37bb..e00585b43 100755 --- a/test/case/ietf_interfaces/verify_all_interface_types/test.py +++ b/test/case/ietf_interfaces/verify_all_interface_types/test.py @@ -34,7 +34,7 @@ def verify_interface(target, interface, expected_type): with infamy.Test() as test: - with test.step("Initialize"): + with test.step("Set up topology and attach to target DUT"): env = infamy.Env() target = env.attach("target", "mgmt") diff --git a/test/case/ietf_interfaces/verify_all_interface_types/topology.dot b/test/case/ietf_interfaces/verify_all_interface_types/topology.dot index c0b813859..fd14ce151 100644 --- a/test/case/ietf_interfaces/verify_all_interface_types/topology.dot +++ b/test/case/ietf_interfaces/verify_all_interface_types/topology.dot @@ -7,7 +7,7 @@ graph "1x3" { edge [color="cornflowerblue", penwidth="2"]; host [ - label="host | { tgt | dummy0 | dummy1 }", + label="host | { mgmt | data1 | data2 }", pos="0,12!", kind="controller", ]; @@ -19,7 +19,7 @@ graph "1x3" { kind="infix", ]; - host:tgt -- target:mgmt [kind=mgmt] - host:dummy0 -- target:ethX [color=black] - host:dummy1 -- target:ethQ [color=black] + host:mgmt -- target:mgmt [kind=mgmt, color=lightgrey] + host:data1 -- target:ethX [color=black] + host:data2 -- target:ethQ [color=black] } diff --git a/test/case/ietf_interfaces/verify_all_interface_types/topology.png b/test/case/ietf_interfaces/verify_all_interface_types/topology.png index 7a8192439..275644297 100644 Binary files a/test/case/ietf_interfaces/verify_all_interface_types/topology.png and b/test/case/ietf_interfaces/verify_all_interface_types/topology.png differ diff --git a/test/case/infix_services/services_basic/topology.dot b/test/case/infix_services/services_basic/topology.dot index f985645d6..2884294da 100644 --- a/test/case/infix_services/services_basic/topology.dot +++ b/test/case/infix_services/services_basic/topology.dot @@ -7,7 +7,7 @@ graph "1x2" { edge [color="cornflowerblue", penwidth="2"]; host [ - label="host | { tgt | data }", + label="host | { mgmt | data }", pos="0,12!", kind="controller", ]; @@ -19,7 +19,7 @@ graph "1x2" { kind="infix", ]; - host:tgt -- target:mgmt [kind=mgmt] + host:mgmt -- target:mgmt [kind=mgmt, color=lightgrey] host:data -- target:data [color=black, fontcolor=black, fontsize=12, taillabel="10.0.0.1/24", headlabel="10.0.0.10/24"] } diff --git a/test/case/infix_services/services_basic/topology.png b/test/case/infix_services/services_basic/topology.png index 239b81e8d..cf77bcb07 100644 Binary files a/test/case/infix_services/services_basic/topology.png and b/test/case/infix_services/services_basic/topology.png differ diff --git a/test/infamy/topologies/1x2.dot b/test/infamy/topologies/1x2.dot index ca5f0b385..8891e6a29 100644 --- a/test/infamy/topologies/1x2.dot +++ b/test/infamy/topologies/1x2.dot @@ -7,7 +7,7 @@ graph "1x2" { edge [color="cornflowerblue", penwidth="2"]; host [ - label="host | { tgt | data }", + label="host | { mgmt | data }", pos="0,12!", kind="controller", ]; @@ -19,6 +19,6 @@ graph "1x2" { kind="infix", ]; - host:tgt -- target:mgmt [kind=mgmt] + host:mgmt -- target:mgmt [kind=mgmt, color=lightgrey] host:data -- target:data [color=black] }