Skip to content

Commit

Permalink
Merge pull request #702 from kernelkit/jovatn/test-spec-minor-fixes
Browse files Browse the repository at this point in the history
Jovatn/test spec minor fixes
  • Loading branch information
jovatn authored Oct 14, 2024
2 parents 53d90ae + 6d1ac9a commit 227b3a9
Show file tree
Hide file tree
Showing 35 changed files with 165 additions and 93 deletions.
13 changes: 7 additions & 6 deletions test/case/ietf_hardware/usb/Readme.adoc
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
=== USB configuration
==== Description
This will test if the configuration is consistent with hardware state,
if the USB ports are _locked_ (forbidden for use) and _unlocked_
(Ready for use) when they should. Also test if it is the case during
reboot. This does not the test actual use of the USB port, just check
that the configured state is consistent with the hardware state.
This test checks if the configuration is consistent with hardware state,
and verifies whether the USB ports are correctly _locked_ (restricted from
use) and _unlocked_ (available for use) when they should. It also verifies
this behavior during reboot. This test does not involve the actual use of
the USB port; it only ensures the configured state is consistent with the
hardware state.

If this pass you can be certeain of that the configuration of the USB
If this pass you can be certain that the configuration of the USB
port is handled correctly.

==== Topology
Expand Down
17 changes: 9 additions & 8 deletions test/case/ietf_hardware/usb/test.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/usr/bin/env python3
"""
USB configuration
"""USB configuration
This will test if the configuration is consistent with hardware state,
if the USB ports are _locked_ (forbidden for use) and _unlocked_
(Ready for use) when they should. Also test if it is the case during
reboot. This does not the test actual use of the USB port, just check
that the configured state is consistent with the hardware state.
This test checks if the configuration is consistent with hardware state,
and verifies whether the USB ports are correctly _locked_ (restricted from
use) and _unlocked_ (available for use) when they should. It also verifies
this behavior during reboot. This test does not involve the actual use of
the USB port; it only ensures the configured state is consistent with the
hardware state.
If this pass you can be certeain of that the configuration of the USB
If this pass you can be certain that the configuration of the USB
port is handled correctly.
"""
import infamy
import copy
Expand Down
2 changes: 1 addition & 1 deletion test/case/ietf_hardware/usb_two_ports/Readme.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=== USB configuration with two USB ports
==== Description
Test that the configuration is consistent
Test that the USB locked/unlocked configuration is consistent
when having two USB ports.

==== Topology
Expand Down
2 changes: 1 addition & 1 deletion test/case/ietf_hardware/usb_two_ports/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
USB configuration with two USB ports
Test that the configuration is consistent
Test that the USB locked/unlocked configuration is consistent
when having two USB ports.
"""
import infamy
Expand Down
2 changes: 1 addition & 1 deletion test/case/ietf_interfaces/bridge_fwd_dual_dut/Readme.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=== Bridge forwarding dual DUTs
==== Description
Ping through two bridges on two different DUTs,
Ping through two bridges on two different DUTs.

==== Topology
ifdef::topdoc[]
Expand Down
2 changes: 1 addition & 1 deletion test/case/ietf_interfaces/bridge_fwd_dual_dut/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""
Bridge forwarding dual DUTs
Ping through two bridges on two different DUTs,
Ping through two bridges on two different DUTs.
"""
import infamy

Expand Down
6 changes: 3 additions & 3 deletions test/case/ietf_interfaces/bridge_vlan_separation/Readme.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=== Bridge VLAN separation
==== Description
Test that two VLAN is correctly separated in the bridge
Test that two VLANs are correctly separated in the bridge

==== Topology
ifdef::topdoc[]
Expand All @@ -17,8 +17,8 @@ endif::topdoc[]
==== Test sequence
. Initialize
. Configure DUTs
. Verify ing 10.0.0.3 from host:data10
. Verify ing 10.0.0.4 from host:data11
. Verify ping 10.0.0.3 from host:data10
. Verify ping 10.0.0.4 from host:data11
. 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


Expand Down
6 changes: 3 additions & 3 deletions test/case/ietf_interfaces/bridge_vlan_separation/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""
Bridge VLAN separation
Test that two VLAN is correctly separated in the bridge
Test that two VLANs are correctly separated in the bridge
"""
import infamy

Expand Down Expand Up @@ -153,10 +153,10 @@
ns20.addip("10.0.0.3")
ns21.addip("10.0.0.4")

with test.step("Verify ing 10.0.0.3 from host:data10"):
with test.step("Verify ping 10.0.0.3 from host:data10"):
ns10.must_reach("10.0.0.3")

with test.step("Verify ing 10.0.0.4 from host:data11"):
with test.step("Verify ping 10.0.0.4 from host:data11"):
ns11.must_reach("10.0.0.4")

with test.step("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"):
Expand Down
2 changes: 1 addition & 1 deletion test/case/ietf_interfaces/dual_bridge/Readme.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=== Dual bridges
==== Description
Test that it is possible to ping a bridge through a bridge to another bridge with VETH interfaces.
Verify that it is possible to ping through a bridge to another bridge via VETH interfaces.

==== Topology
ifdef::topdoc[]
Expand Down
2 changes: 1 addition & 1 deletion test/case/ietf_interfaces/dual_bridge/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""
Dual bridges
Test that it is possible to ping a bridge through a bridge to another bridge with VETH interfaces.
Verify that it is possible to ping through a bridge to another bridge via VETH interfaces.
"""
import infamy

Expand Down
4 changes: 2 additions & 2 deletions test/case/ietf_interfaces/ipv4_address/Readme.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=== Interface with IPv4
==== Description
Test that it is possible to set and remove the IPv4 address on a interface
Test that it is possible to set and remove the IPv4 address on an interface

==== Topology
ifdef::topdoc[]
Expand All @@ -17,7 +17,7 @@ endif::topdoc[]
==== Test sequence
. Set up topology and attach to target DUT
. Configure IPv4 address 10.10.10.20/24 on target:mgmt
. Verify '10.10.10.20/24' exist on target:mgmt
. Verify '10.10.10.20/24' exists on target:mgmt
. Remove all IPv4 addresses from target:mgmt
. Verify target:mgmt no longer has the address 10.10.10.20

Expand Down
4 changes: 2 additions & 2 deletions test/case/ietf_interfaces/ipv4_address/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Interface with IPv4
Test that it is possible to set and remove the IPv4 address on a interface
Test that it is possible to set and remove the IPv4 address on an interface
"""
import copy
import infamy
Expand Down Expand Up @@ -39,7 +39,7 @@

target.put_config_dict("ietf-interfaces", config)

with test.step("Verify '10.10.10.20/24' exist on target:mgmt"):
with test.step("Verify '10.10.10.20/24' exists on target:mgmt"):
until(lambda: iface.address_exist(target, interface_name, new_ip_address, proto='static'))

with test.step("Remove all IPv4 addresses from target:mgmt"):
Expand Down
4 changes: 2 additions & 2 deletions test/case/ietf_interfaces/routing_basic/Readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ endif::topdoc[]
. Initialize
. Setup host
. Enable forwarding on target:data0 and target:data1
. Verify ping from host:data0 to 10.0.0.1
. Verify ping from host:data0 to 10.0.0.10
. Verify ping from host:data1 to 192.168.0.10
. Disable forwarding on target:data0 and target:data1
. Verfify ping does not work host:data0->10.0.0.10 and host:data1->192.168.0.10
. Verify ping does not work host:data0 to 10.0.0.10 and host:data1 to 192.168.0.10


<<<
Expand Down
4 changes: 2 additions & 2 deletions test/case/ietf_interfaces/routing_basic/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def config_target(target, tport0, tport1, enable_fwd):
with test.step("Enable forwarding on target:data0 and target:data1"):
config_target(target, tport0, tport1, True)

with test.step("Verify ping from host:data0 to 10.0.0.1"):
with test.step("Verify ping from host:data0 to 10.0.0.10"):
ns0.must_reach("10.0.0.10")

with test.step("Verify ping from host:data1 to 192.168.0.10"):
Expand All @@ -86,7 +86,7 @@ def config_target(target, tport0, tport1, enable_fwd):
with test.step("Disable forwarding on target:data0 and target:data1"):
config_target(target, tport0, tport1, False)

with test.step("Verfify ping does not work host:data0->10.0.0.10 and host:data1->192.168.0.10"):
with test.step("Verify ping does not work host:data0 to 10.0.0.10 and host:data1 to 192.168.0.10"):
infamy.parallel(lambda: ns0.must_not_reach("10.0.0.10"),
lambda: ns1.must_not_reach("192.168.0.10"))

Expand Down
44 changes: 44 additions & 0 deletions test/case/ietf_interfaces/verify_all_interface_types/Readme.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
=== Verify that all interface types can be created
==== Description
This test verifies that all interface types can be created and also
checks the configuration when applied sequentially. This method takes
slightly longer than sending the entire configuration at once.

....
lo br-0 br-Q.40 br-D br-X
| | | | |
o o ethQ.10 br-Q veth0a.20 ethX.30
\ / \ | |
ethQ veth0b veth0a ethX
`---------'
....

==== Topology
ifdef::topdoc[]
image::../../test/case/ietf_interfaces/verify_all_interface_types/topology.png[Verify that all interface types can be created topology]
endif::topdoc[]
ifndef::topdoc[]
ifdef::testgroup[]
image::verify_all_interface_types/topology.png[Verify that all interface types can be created topology]
endif::testgroup[]
ifndef::testgroup[]
image::topology.png[Verify that all interface types can be created topology]
endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Initialize
. Configure an empty bridge br-0
. Configure bridge br-X and associated interfaces
. Configure VETH pair
. Configure bridge br-D and associated interfaces
. Configure br-Q and associated interfaces
. Verify interface 'lo' is of type loopback
. Verify interfaces 'ethX' and 'ethQ' are of type 'ethernet' (or etherlike if running Qemu)
. Verify interfaces 'br-0', 'br-X', 'br-D' and 'br-Q' are of type 'bridge'
. Verify interfaces 'veth0a' and 'veth0b' are of type 'veth'
. Verify interfaces 'veth0a.20', 'ethQ.10', 'ethX.30', 'ethQ.10' and 'br-Q.40' are of type 'vlan'


<<<

25 changes: 13 additions & 12 deletions test/case/ietf_interfaces/verify_all_interface_types/test.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env python3
r"""
Verify that all interface types can be created
r"""Verify that all interface types can be created
This test verifies that all interface types can be created and also
checks the configuration when applied sequentially. This method takes
slightly longer than sending the entire configuration at once.
This test verify that all interface types can be created
and also, tesing setting the configuration in sequal (this
takes a little longer time than send it once)
....
lo br-0 br-Q.40 br-D br-X
Expand All @@ -14,6 +14,7 @@
ethQ veth0b veth0a ethX
`---------'
....
"""

import infamy
Expand Down Expand Up @@ -56,7 +57,7 @@ def verify_interface(target, interface, expected_type):

loopback = "lo"

with test.step("Configure an empty bridge"):
with test.step("Configure an empty bridge br-0"):
target.put_config_dict("ietf-interfaces", {
"interfaces": {
"interface": [
Expand All @@ -69,7 +70,7 @@ def verify_interface(target, interface, expected_type):
}
})

with test.step("Configure bridge brX and associated interfaces"):
with test.step("Configure bridge br-X and associated interfaces"):
target.put_config_dict("ietf-interfaces", {
"interfaces": {
"interface": [
Expand Down Expand Up @@ -118,7 +119,7 @@ def verify_interface(target, interface, expected_type):
}
})

with test.step("Configure bridge brD and associated interfaces"):
with test.step("Configure bridge br-D and associated interfaces"):
target.put_config_dict("ietf-interfaces", {
"interfaces": {
"interface": [
Expand Down Expand Up @@ -192,21 +193,21 @@ def verify_interface(target, interface, expected_type):
with test.step("Verify interface 'lo' is of type loopback"):
verify_interface(target, "lo", "loopback")

with test.step("Verify interfaces 'ethX' and 'ethQ' is of type 'ethernet' (or etherlike if running Qemu)"):
with test.step("Verify interfaces 'ethX' and 'ethQ' are of type 'ethernet' (or etherlike if running Qemu)"):
verify_interface(target, eth_X, "etherlike")
verify_interface(target, eth_Q, "etherlike")

with test.step("Verify interfaces 'br-0', 'br-X', 'br-D' and 'br-Q' is of type 'bridge'"):
with test.step("Verify interfaces 'br-0', 'br-X', 'br-D' and 'br-Q' are of type 'bridge'"):
verify_interface(target, "br-0", "bridge")
verify_interface(target, "br-X", "bridge")
verify_interface(target, "br-Q", "bridge")
verify_interface(target, "br-D", "bridge")

with test.step("Verify interfaces 'veth0a' and 'veth0b' is of type 'veth'"):
with test.step("Verify interfaces 'veth0a' and 'veth0b' are of type 'veth'"):
verify_interface(target, "veth0a", "veth")
verify_interface(target, "veth0b", "veth")

with test.step("Verify interfaces 'veth0a.20', 'ethQ.10', 'ethX.30', 'ethQ.10' and 'br-Q.40' is of type 'vlan'"):
with test.step("Verify interfaces 'veth0a.20', 'ethQ.10', 'ethX.30', 'ethQ.10' and 'br-Q.40' are of type 'vlan'"):
verify_interface(target, "veth0a.20", "vlan")
verify_interface(target, f"{eth_X}.30", "vlan")
verify_interface(target, f"{eth_Q}.10", "vlan")
Expand Down
4 changes: 2 additions & 2 deletions test/case/ietf_interfaces/vlan_ping/Readme.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=== VLAN ping connectivity
==== Description
Very basic test if the VLAN configuration works.
Very basic test if the VLAN interface configuration works.

==== Topology
ifdef::topdoc[]
Expand All @@ -15,7 +15,7 @@ image::topology.png[VLAN ping connectivity topology]
endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Configure VLAN 10 on target:data with IP 10.0.0.2
. Configure VLAN 10 interface on target:data with IP 10.0.0.2
. Waiting for links to come up
. Ping 10.0.0.2 from VLAN 10 on host:data with IP 10.0.0.1
. Remove VLAN interface from target:data, and test again (should not be able to ping)
Expand Down
4 changes: 2 additions & 2 deletions test/case/ietf_interfaces/vlan_ping/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
VLAN ping connectivity
Very basic test if the VLAN configuration works.
Very basic test if the VLAN interface configuration works.
"""
import infamy
import infamy.iface as iface
Expand All @@ -25,7 +25,7 @@ def test_ping(hport, should_pass):
ns.must_not_reach("10.0.0.2")

with infamy.Test() as test:
with test.step("Configure VLAN 10 on target:data with IP 10.0.0.2"):
with test.step("Configure VLAN 10 interface on target:data with IP 10.0.0.2"):
env = infamy.Env()
target = env.attach("target", "mgmt")
_, tport = env.ltop.xlate("target", "data")
Expand Down
12 changes: 6 additions & 6 deletions test/case/ietf_routing/ospf_multiarea/Readme.adoc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
=== OSPF with multiple areas
==== Description
This test test alot of features inside OSPF using 3 areas (one NSSA area, with no summary)
to test the distribution of routes is deterministic (using cost), also test
link breaks using BFD (not implemented in infamy though)
This test evaluates various OSPF features across three areas (one NSSA area, with no summary)
to ensure that route distribution is deterministic (based on cost). It also tests link
failures using BFD, though BFD is not yet implemented in test framework (Infamy).

This test also verify broadcast and point-to-point interface type on /30 network and
This test also verifies broadcast and point-to-point interface types on /30 network, and
explicit router-id.

==== Topology
Expand All @@ -21,13 +21,13 @@ endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Configure targets
. Wait for all neighbor to peer
. Wait for all neighbors to peer
. Wait for routes from OSPF on all routers
. Verify Area 0.0.0.1 on R3 is NSSA area
. Verify R1:ring2 is of type point-to-point
. Verify R4:ring1 is of type point-to-point
. Verify on R3, there are no routes beyond 10.0.23.1, just a default route
. Testing connectivitiy through NSSA area, from PC:data3 to 11.0.8.1
. Testing connectivity through NSSA area, from PC:data3 to 11.0.8.1
. Verify that the route to 10.0.0.3 from PC:data4, go through 10.0.41.2
. Break link R1:ring2 --- R4:ring1
. Verify that the route to 10.0.0.3 from PC:data4, go through 10.0.24.1
Expand Down
Loading

0 comments on commit 227b3a9

Please sign in to comment.