Skip to content

Commit

Permalink
Merge pull request #710 from kernelkit/fix-test-texts
Browse files Browse the repository at this point in the history
test: Update topologies and test texts
  • Loading branch information
mattiaswal authored Oct 16, 2024
2 parents 1583071 + 34cb229 commit 90bda1b
Show file tree
Hide file tree
Showing 75 changed files with 433 additions and 294 deletions.
2 changes: 1 addition & 1 deletion test/case/ietf_hardware/usb/Readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ image::topology.png[USB configuration topology]
endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Initialize
. Set up topology and attach to target DUT
. Unlock all USB ports
. Verify that all USB ports are unlocked
. Lock all USB ports
Expand Down
2 changes: 1 addition & 1 deletion test/case/ietf_hardware/usb/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from infamy.util import until, wait_boot

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")
available = usb.get_usb_ports(target)
Expand Down
Binary file modified test/case/ietf_hardware/usb/topology.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions test/case/ietf_hardware/usb_two_ports/Readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ image::topology.png[USB configuration with two USB ports topology]
endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Initialize
. Lock the first USB port, and unlock the second USB port
. Set up topology and attach to target DUTs
. Lock the first USB port and unlock the second USB port
. Verify that the correct port is locked and the correct one is unlocked
. Unlock the first USB port, and lock the second USB port
. Verify that the correct port is locked and the correct one is unlocked
Expand Down
4 changes: 2 additions & 2 deletions test/case/ietf_hardware/usb_two_ports/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
from infamy.util import until,wait_boot

with infamy.Test() as test:
with test.step("Initialize"):
with test.step("Set up topology and attach to target DUTs"):
env = infamy.Env()
target = env.attach("target", "mgmt")
available=usb.get_usb_ports(target)

if len(available) < 2:
test.skip()

with test.step("Lock the first USB port, and unlock the second USB port"):
with test.step("Lock the first USB port and unlock the second USB port"):
components = []
component = {
"name": available[0],
Expand Down
Binary file modified test/case/ietf_hardware/usb_two_ports/topology.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions test/case/ietf_interfaces/bridge_basic/topology.dot
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ graph "1x2" {
];

target [
label="{ <mgmt> mgmt | <data> data } | target",
label="{ <mgmt> mgmt | <data> data } | target\n10.0.0.2/24 (br0)",
pos="10,12!",

kind="infix",
];

host:mgmt -- target:mgmt [kind=mgmt, color=lightgrey]
host:mgmt -- target:mgmt [kind=mgmt, color="lightgray"]
host:data -- target:data [color=black, fontcolor=black, taillabel="10.0.0.1/24"]
}
Binary file modified test/case/ietf_interfaces/bridge_basic/topology.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 14 additions & 15 deletions test/case/ietf_interfaces/bridge_fwd_dual_dut/Readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@ 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 ] |
'-----------------------------------------------------------------------------------------'
,-------------------------------------, ,-------------------------------------,
| 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 ] |
'-----------------------------------------------------------------------------------'
....

Expand Down
29 changes: 14 additions & 15 deletions test/case/ietf_interfaces/bridge_fwd_dual_dut/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@
....
,-------------------------------------, ,-------------------------------------,
| 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 ] |
'-----------------------------------------------------------------------------------------'
,-------------------------------------, ,-------------------------------------,
| 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 ] |
'-----------------------------------------------------------------------------------'
....
Expand Down
Binary file modified test/case/ietf_interfaces/bridge_fwd_dual_dut/topology.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion test/case/ietf_interfaces/bridge_veth/Readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
This tests the possibility to add software added interfaces, in this case
VETH and bridge it with a physical interface

....
PING --> br0
/ \
PC- target:data veth0a -- veth0b
10.0.0.1 10.0.0.2
....

==== Topology
ifdef::topdoc[]
image::../../test/case/ietf_interfaces/bridge_veth/topology.png[Bridge with a physical port and a veth topology]
Expand All @@ -16,7 +25,7 @@ image::topology.png[Bridge with a physical port and a veth topology]
endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Initialize
. Set up topology and attach to target DUT
. Configure bridged eth port and veth pair with IP 10.0.0.2
. Verify ping from host:data to 10.0.0.2

Expand Down
18 changes: 12 additions & 6 deletions test/case/ietf_interfaces/bridge_veth/test.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
#!/usr/bin/env python3
#
# PING --> br0
# / \
# PC ---- e0 veth 10.0.0.2
#
"""
Bridge with a physical port and a veth
This tests the possibility to add software added interfaces, in this case
VETH and bridge it with a physical interface
....
PING --> br0
/ \\
PC- target:data veth0a -- veth0b
10.0.0.1 10.0.0.2
....
"""
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")

Expand Down
4 changes: 2 additions & 2 deletions test/case/ietf_interfaces/bridge_veth/topology.dot
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ graph "1x2" {
edge [color="cornflowerblue", penwidth="2"];

host [
label="host | { <tgt> tgt | <data> data }",
label="host | { <mgmt> mgmt | <data> data }",
pos="0,12!",
kind="controller",
];
Expand All @@ -19,6 +19,6 @@ graph "1x2" {
kind="infix",
];

host:tgt -- target:mgmt [kind=mgmt]
host:mgmt -- target:mgmt [kind=mgmt, color="lightgray"]
host:data -- target:data [color=black, fontcolor=black, taillabel="10.0.0.1/24"]
}
Binary file modified test/case/ietf_interfaces/bridge_veth/topology.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions test/case/ietf_interfaces/bridge_vlan/Readme.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
=== Bridge VLAN
==== Description
Basic test of VLAN functionality in a bridge
Basic test of VLAN functionality in a bridge, tagged/untagged traffic and a VLAN interface in the bridge.
....
¦ ¦
¦ vlan10 IP:10.0.0.2 ¦ br0 IP:10.0.0.3
¦ / ¦ /
¦ br0 <-- VLAN filtering ¦ link.10
¦ u/ \t ¦ /
PC ------data link -----------------|-- link
¦ dut1 ¦ dut2
....

==== Topology
ifdef::topdoc[]
Expand All @@ -15,8 +24,9 @@ image::topology.png[Bridge VLAN topology]
endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Set up topology and attach to target DUT
. Configure DUTs
. Verify ping from host:data1 to 10.0.0.2 and 10.0.0.3
. Verify ping from host:data to 10.0.0.2 and 10.0.0.3


<<<
Expand Down
32 changes: 18 additions & 14 deletions test/case/ietf_interfaces/bridge_vlan/test.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
#!/usr/bin/env python3
# ¦ ¦
# ¦ vlan10 IP:10.0.0.2 ¦ br0 IP:10.0.0.3
# ¦ / ¦ /
# ¦ br0 <-- VLAN filtering ¦ e0.10
# ¦ u/ \t ¦ /
# PC ------- e0 e1 ---------------------- e0
# PING --> ¦ dut1 ¦ dut2
#

"""
Bridge VLAN
Basic test of VLAN functionality in a bridge
Basic test of VLAN functionality in a bridge, tagged/untagged traffic and a VLAN interface in the bridge.
....
¦ ¦
¦ vlan10 IP:10.0.0.2 ¦ br0 IP:10.0.0.3
¦ / ¦ /
¦ br0 <-- VLAN filtering ¦ link.10
¦ u/ \\t ¦ /
PC ------data link -----------------|-- link
¦ dut1 ¦ dut2
....
"""
import infamy

with infamy.Test() as test:
with test.step("Configure DUTs"):
with test.step("Set up topology and attach to target DUT"):
env = infamy.Env()
dut1 = env.attach("dut1", "mgmt")
dut2 = env.attach("dut2", "mgmt")

_, dut1_e0 = env.ltop.xlate("dut1", "data")
_, dut1_e1 = env.ltop.xlate("dut1", "to_dut2")
_, dut2_e0 = env.ltop.xlate("dut2", "to_dut1")
_, dut1_e1 = env.ltop.xlate("dut1", "link")
_, dut2_e0 = env.ltop.xlate("dut2", "link")

with test.step("Configure DUTs"):
dut1.put_config_dict("ietf-interfaces", {
"interfaces": {
"interface": [
Expand Down Expand Up @@ -117,8 +121,8 @@
}
})

with test.step("Verify ping from host:data1 to 10.0.0.2 and 10.0.0.3"):
_, hport = env.ltop.xlate("host", "data1")
with test.step("Verify ping from host:data to 10.0.0.2 and 10.0.0.3"):
_, hport = env.ltop.xlate("host", "data")

with infamy.IsolatedMacVlan(hport) as ns:
ns.addip("10.0.0.1")
Expand Down
14 changes: 7 additions & 7 deletions test/case/ietf_interfaces/bridge_vlan/topology.dot
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ graph "2x2" {
edge [color="cornflowerblue", penwidth="2"];

host [
label="host | { <mgmt1> mgmt1 | <data1> data1 | <mgmt2> mgmt2 }",
label="host | { <mgmt1> mgmt1 | <data> data | <mgmt2> mgmt2 }",
pos="0,16!",
kind="controller",
];

dut1 [
label="{ <mgmt> mgmt | <data> data | <to_dut2> to_dut2} | dut1\n(10.0.0.2) ",
label="{ <mgmt> mgmt | <data> data | <link> link} | dut1\n(10.0.0.2) ",
pos="10,16!",

kind="infix",
];
dut2 [
label="{ <to_dut1> to_dut1 | <mgmt> mgmt } | dut2\n(10.0.0.3)",
label="{ <link> link | <mgmt> mgmt } | dut2\n(10.0.0.3)",
pos="10,12!",

kind="infix",
];
host:mgmt1 -- dut1:mgmt [kind=mgmt]
host:mgmt2 -- dut2:mgmt [kind=mgmt]
host:data1 -- dut1:data [color=black]
host:mgmt1 -- dut1:mgmt [kind=mgmt, color="lightgray"]
host:mgmt2 -- dut2:mgmt [kind=mgmt, color="lightgray"]
host:data -- dut1:data [color=black]

dut1:to_dut2 -- dut2:to_dut1
dut1:link -- dut2:link [color=black]
}
Binary file modified test/case/ietf_interfaces/bridge_vlan/topology.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 20 additions & 1 deletion test/case/ietf_interfaces/bridge_vlan_separation/Readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@
==== Description
Test that two VLANs are correctly separated in the bridge

....
,-----------------------------------, ,----------------------------------,
| dut1:link | | dut2:link |
| br0 --------|---|--------- br0 |
| / \ | | / \ |
|dut1:mgmt dut1:data1 dut1:data2 | | dut2:data1 dut2:data2 dut2:mgmt |
'-----------------------------------' '----------------------------------'
| | | | | |
| | | | | |
,------------------------------------------------------------------------------,
| host:mgmt0 host:data10 host:data11 host:data20 host:data21 host:mgmt1 |
| [10.0.0.1] [10.0.0.2] [10.0.0.3] [10.0.0.4] |
| (ns10) (ns11) (s20) (ns21) |
| |
| [ HOST ] |
'------------------------------------------------------------------------------'
....

==== Topology
ifdef::topdoc[]
image::../../test/case/ietf_interfaces/bridge_vlan_separation/topology.png[Bridge VLAN separation topology]
Expand All @@ -15,7 +34,7 @@ image::topology.png[Bridge VLAN separation topology]
endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Initialize
. Set up topology and attach to target DUT
. Configure DUTs
. Verify ping 10.0.0.3 from host:data10
. Verify ping 10.0.0.4 from host:data11
Expand Down
Loading

0 comments on commit 90bda1b

Please sign in to comment.