Formatting fixes for test specification and topologies

Also including some existing test to test specification, from ietf_system
and ietf_interfaces directories.
This commit is contained in:
Jon-Olov Vatn
2024-10-17 15:11:12 +02:00
parent 484dc940dc
commit 272a7c1e69
47 changed files with 107 additions and 104 deletions
+3
View File
@@ -40,3 +40,6 @@ include::vlan_qos/Readme.adoc[]
include::verify_all_interface_types/Readme.adoc[]
include::iface_enable_disable/Readme.adoc[]
include::veth_delete/Readme.adoc[]
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 10 KiB

@@ -4,20 +4,21 @@ 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 | | link [ DUT2 ] |
| br0 -----|-------|----- br0 |
| / | | / \ |
| mgmt data1 | | data1 data2 mgmt |
'-------------------------' '-------------------------'
| | | | |
| | | | |
.---------------------------------------------------------------.
| mgmt1 data11 data21 data22 mgmt2 |
| [10.0.0.2] [10.0.0.3] [10.0.0.4] |
| (ns11) (ns20) (ns21) |
| |
| [ HOST ] |
'---------------------------------------------------------------'
....
@@ -6,20 +6,21 @@ 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 | | link [ DUT2 ] |
| br0 -----|-------|----- br0 |
| / | | / \ |
| mgmt data1 | | data1 data2 mgmt |
'-------------------------' '-------------------------'
| | | | |
| | | | |
.---------------------------------------------------------------.
| mgmt1 data11 data21 data22 mgmt2 |
| [10.0.0.2] [10.0.0.3] [10.0.0.4] |
| (ns11) (ns20) (ns21) |
| |
| [ HOST ] |
'---------------------------------------------------------------'
....
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 21 KiB

@@ -37,7 +37,7 @@ endif::topdoc[]
==== Test sequence
. 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
. Verify ping from host:data1 to 10.0.0.2
<<<
@@ -62,7 +62,7 @@ with infamy.Test() as test:
}
})
with test.step("Verify ping from host:data0 to 10.0.0.1"):
with test.step("Verify ping from host:data1 to 10.0.0.2"):
_, hport1 = env.ltop.xlate("host", "data1")
_, hport2 = env.ltop.xlate("host", "data2")
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

@@ -17,16 +17,17 @@ 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 up topology and attach to target DUT
. Set target:data static MAC address '02:01:00:c0:ff:ee'
. Verify target:mgmt has MAC address '02:01:00:c0:ff:ee'
. Reset target:mgmt MAC address to default
. Verify target:data has MAC address '02:01:00:c0:ff:ee'
. Reset target:data MAC address to default
. Verify target:data MAC address is reset 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
. Reset target:data MAC address to default
. Verify target:data MAC address is reset to default
<<<
@@ -32,14 +32,12 @@ def reset_mac(tgt, port, mac):
node = "infix-interfaces:custom-phys-address"
xpath = iface.get_xpath(port, node)
tgt.delete_xpath(xpath)
with test.step("Verify target:data MAC address is reset to default"):
until(lambda: iface.get_phys_address(tgt, tport) == mac)
with infamy.Test() as test:
CMD = "jq -r '.[\"mac-address\"]' /run/system.json"
with test.step("Initialize"):
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")
@@ -65,14 +63,17 @@ with infamy.Test() as test:
}
target.put_config_dict("ietf-interfaces", config)
with test.step("Verify target:mgmt has MAC address '02:01:00:c0:ff:ee'"):
with test.step("Verify target:data has MAC address '02:01:00:c0:ff:ee'"):
mac = iface.get_phys_address(target, tport)
print(f"Current MAC: {mac}, should be: {STATIC}")
assert mac == STATIC
with test.step("Reset target:mgmt MAC address to default"):
with test.step("Reset target:data MAC address to default"):
reset_mac(target, tport, pmac)
with test.step("Verify target:data MAC address is reset to default"):
until(lambda: iface.get_phys_address(tgt, tport) == mac)
with test.step("Set target:data to chassis MAC"):
config = {
"interfaces": {
@@ -113,7 +114,11 @@ with infamy.Test() as test:
print(f"Current MAC: {mac}, should be: {BMAC} (calculated)")
assert mac == BMAC
with test.step("Reset target:mgmt MAC address to default"):
with test.step("Reset target:data MAC address to default"):
reset_mac(target, tport, pmac)
with test.step("Verify target:data MAC address is reset to default"):
until(lambda: iface.get_phys_address(tgt, tport) == mac)
test.succeed()
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

@@ -3,26 +3,20 @@
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
@@ -5,26 +5,20 @@ 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
....
"""
@@ -18,12 +18,12 @@ endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Set up topology and attach to target DUT
. Configure interface target:mgmt with IPv4 ZeroConf IP
. Verify link-local address exist on target:mgmt
. Configure target:mgmt with a specific IPv4 ZeroConf IP
. Verify target:mgmt has link-local address 169.254.42.42
. Remove IPv4 link-local addresses from target:mgmt
. Verify link-local addresses has been removed from target:mgmt
. Configure interface target:data with IPv4 ZeroConf IP
. Verify link-local address exist on target:data
. Configure target:data with a specific IPv4 ZeroConf IP
. Verify target:data has link-local address 169.254.42.42
. Remove IPv4 link-local addresses from target:data
. Verify link-local addresses has been removed from target:data
<<<
@@ -47,7 +47,7 @@ with infamy.Test() as test:
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step("Configure interface target:mgmt with IPv4 ZeroConf IP"):
with test.step("Configure interface target:data with IPv4 ZeroConf IP"):
_, tport = env.ltop.xlate("target", "data")
target.put_config_dict("ietf-interfaces", {
@@ -66,10 +66,10 @@ with infamy.Test() as test:
}
})
with test.step("Verify link-local address exist on target:mgmt"):
with test.step("Verify link-local address exist on target:data"):
until(lambda: has_linklocal(target, tport), attempts=30)
with test.step("Configure target:mgmt with a specific IPv4 ZeroConf IP"):
with test.step("Configure target:data with a specific IPv4 ZeroConf IP"):
_, tport = env.ltop.xlate("target", "data")
target.put_config_dict("ietf-interfaces", {
@@ -89,16 +89,16 @@ with infamy.Test() as test:
}
})
with test.step("Verify target:mgmt has link-local address 169.254.42.42"):
with test.step("Verify target:data has link-local address 169.254.42.42"):
until(lambda: has_linklocal(target, tport, request="169.254.42.42"),
attempts=30)
with test.step("Remove IPv4 link-local addresses from target:mgmt"):
with test.step("Remove IPv4 link-local addresses from target:data"):
xpath = f"/ietf-interfaces:interfaces/interface[name='{tport}']" \
"/ietf-ip:ipv4/infix-ip:autoconf"
target.delete_xpath(xpath)
with test.step("Verify link-local addresses has been removed from target:mgmt"):
with test.step("Verify link-local addresses has been removed from target:data"):
until(lambda: no_linklocal(target, tport), attempts=30)
test.succeed()
Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

@@ -1,7 +1,7 @@
=== Verify that VETH pairs can be deleted
==== Description
```
veth0b veth0a e1 e2
veth0b veth0a data1 data2
`---------'
```
@@ -21,13 +21,13 @@ image::topology.png[Verify that VETH pairs can be deleted topology]
endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Initialize
. Set up topology and attach to target DUT
. Create VETH pair
. Verify interfaces 'veth0a' and 'veth0b' exists
. Set IP address on target:eth0 (dummy op)
. Set IP address on target:eth1 (dummy op)
. Verify interfaces 'veth0a' and 'veth0b' exist
. Set IP address on target:data1 (dummy op)
. Set IP address on target:data2 (dummy op)
. Reset configuration
. Verify target:eth0 and target:eth1 still exist
. Verify target:data1 and target:data2 still exist
. Verify VETH pair have been removed
+14 -14
View File
@@ -2,7 +2,7 @@
"""Verify that VETH pairs can be deleted
```
veth0b veth0a e1 e2
veth0b veth0a data1 data2
`---------'
```
@@ -16,12 +16,12 @@ import infamy.iface as iface
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")
_, eth0 = env.ltop.xlate("target", "eth0")
_, eth1 = env.ltop.xlate("target", "eth1")
_, data1 = env.ltop.xlate("target", "data1")
_, data2 = env.ltop.xlate("target", "data2")
veth0a = "veth0a"
veth0b = "veth0b"
@@ -50,17 +50,17 @@ with infamy.Test() as test:
}
})
with test.step("Verify interfaces 'veth0a' and 'veth0b' exists"):
with test.step("Verify interfaces 'veth0a' and 'veth0b' exist"):
assert iface.exist(target, veth0a), \
f"Interface <{veth0a}> does not exist."
assert iface.exist(target, veth0b), \
f"Interface <{veth0b}> does not exist."
with test.step("Set IP address on target:eth0 (dummy op)"):
with test.step("Set IP address on target:data1 (dummy op)"):
target.put_config_dict("ietf-interfaces", {
"interfaces": {
"interface": [{
"name": f"{eth0}",
"name": f"{data1}",
"ipv4": {
"address": [{
"ip": "10.0.0.1",
@@ -71,11 +71,11 @@ with infamy.Test() as test:
}
})
with test.step("Set IP address on target:eth1 (dummy op)"):
with test.step("Set IP address on target:data2 (dummy op)"):
target.put_config_dict("ietf-interfaces", {
"interfaces": {
"interface": [{
"name": f"{eth1}",
"name": f"{data2}",
"ipv4": {
"address": [{
"ip": "20.0.0.1",
@@ -96,11 +96,11 @@ with infamy.Test() as test:
# Calls target.test_reset() to apply safe-config
target = env.attach("target", "mgmt")
with test.step("Verify target:eth0 and target:eth1 still exist"):
assert iface.exist(target, eth0), \
f"Interface {eth0} missing!"
assert iface.exist(target, eth1), \
f"Interface {eth1} missing!"
with test.step("Verify target:data1 and target:data2 still exist"):
assert iface.exist(target, data1), \
f"Interface {data1} missing!"
assert iface.exist(target, data2), \
f"Interface {data2} missing!"
with test.step("Verify VETH pair have been removed"):
assert not iface.exist(target, veth0a), \
@@ -7,19 +7,19 @@ graph "1x3" {
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <dummy0> dummy0 | <dummy1> dummy1 }",
label="host | { <mgmt> mgmt | <data1> data1 | <data2> data2 }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <eth0> eth0 | <eth1> eth1 } | target",
label="{ <mgmt> mgmt | <data1> data1 | <data2> data2 } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:dummy0 -- target:eth0 [color=black]
host:dummy1 -- target:eth1 [color=black]
host:mgmt -- target:mgmt [kind=mgmt, color=lightgrey]
host:data1 -- target:data1 [color=black]
host:data2 -- target:data2 [color=black]
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 29 KiB

+2 -2
View File
@@ -15,8 +15,8 @@ image::topology.png[Syslog Basic topology]
endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Initializing
. Configure DUT
. Set up topology and attach to target DUT
. Configure syslog on DUT to log to files '/log/bar.log' (absolute path) and 'foo' (non-absolute).
. Verify log files /var/log/foo and /var/log/bar.log have been created
+2 -2
View File
@@ -9,14 +9,14 @@ import infamy
import infamy.ssh as ssh
with infamy.Test() as test:
with test.step("Initializing"):
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")
factory = env.get_password("target")
address = target.get_mgmt_ip()
with test.step("Configure DUT"):
with test.step("Configure syslog on DUT to log to files '/log/bar.log' (absolute path) and 'foo' (non-absolute)."):
target.put_config_dict("ietf-syslog", {
"syslog": {
"actions": {
+1 -1
View File
@@ -15,7 +15,7 @@ image::topology.png[Remote syslog topology]
endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Initialize
. Set up topology and attach to client and server DUTs
. Configure DUTs
. Send security:notice log message from client
. Verify reception of client log message, incl. sorting to /log/security on server
+1 -1
View File
@@ -7,7 +7,7 @@ Verify logging to remote, acting as a remote, and RFC5424 log format.
import infamy
with infamy.Test() as test:
with test.step("Initialize"):
with test.step("Set up topology and attach to client and server DUTs"):
env = infamy.Env()
client = env.attach("client", "mgmt")
server = env.attach("server", "mgmt")
+2 -2
View File
@@ -24,7 +24,7 @@ graph "2x2" {
kind="infix",
];
host:cli_mgmt -- client:mgmt [kind=mgmt]
host:ser_mgmt -- server:mgmt [kind=mgmt]
host:cli_mgmt -- client:mgmt [kind=mgmt, color=lightgrey]
host:ser_mgmt -- server:mgmt [kind=mgmt, color=lightgrey]
client:link -- server:link [color=black, fontcolor=black, taillabel="10.0.0.2/24", headlabel="10.0.0.1/24"]
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 20 KiB

+4
View File
@@ -12,3 +12,7 @@ include::user_admin/Readme.adoc[]
include::timezone/Readme.adoc[]
include::timezone_utc_offset/Readme.adoc[]
include::ssh_key_authentication/Readme.adoc[]
include::upgrade/Readme.adoc[]
+1 -1
View File
@@ -61,7 +61,7 @@ with infamy.Test() as test:
target = env.attach("target", "mgmt")
_, hport = env.ltop.xlate("host", "tgt")
_, hport = env.ltop.xlate("host", "mgmt")
_, tport = env.ltop.xlate("target", "mgmt")
hip = netifaces.ifaddresses(hport)[netifaces.AF_INET6][0]["addr"]
hip = hip.replace(f"%{hport}", f"%{tport}")
+2 -2
View File
@@ -7,7 +7,7 @@ graph "1x1" {
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt }",
label="host | { <mgmt> mgmt }",
pos="0,12!",
kind="controller",
];
@@ -19,5 +19,5 @@ graph "1x1" {
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:mgmt -- target:mgmt [kind=mgmt, color=lightgrey]
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

@@ -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",
];
@@ -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, fontcolor=black, fontsize=12, taillabel="10.0.0.1/24", headlabel="10.0.0.2/24"]
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

+1 -1
View File
@@ -19,5 +19,5 @@ graph "1x1" {
kind="infix",
];
host:mgmt -- target:mgmt [kind=mgmt, color="lightgray"]
host:mgmt -- target:mgmt [kind=mgmt, color="lightgray"]
}