diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f63827ed..8b507305 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,7 +39,7 @@ env: jobs: test: name: Regression Test ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.name || inputs.name }} ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target || inputs.target }} - runs-on: [ self-hosted, regression ] + runs-on: [self-hosted, regression] steps: - name: Checkout infix repo uses: actions/checkout@v4 @@ -87,7 +87,7 @@ jobs: fi make test - - name: Publish Test Result for ${{ env.TARGET }} + - name: Publish Test Result for ${{ env.TARGET }} # Ensure this runs even if Regression Test fails if: always() run: cat $TEST_PATH/.log/last/result-gh.md >> $GITHUB_STEP_SUMMARY @@ -96,15 +96,10 @@ jobs: # Ensure this runs even if Regression Test fails if: always() run: | - asciidoctor-pdf \ - --theme $TEST_PATH/9pm/report/theme.yml \ - -a pdf-fontsdir=$TEST_PATH/9pm/report/fonts \ - $TEST_PATH/.log/last/report.adoc \ - -o $TEST_PATH/.log/last/report.pdf + make test-dir="$(pwd)/$TEST_PATH" test-report - name: Upload Test Report as Artifact uses: actions/upload-artifact@v4 with: name: test-report - path: ${{ env.TEST_PATH }}/.log/last/report.pdf - + path: output/images/test-report.pdf diff --git a/board/common/mkdisk.sh b/board/common/mkdisk.sh index ababde0f..dfb472b3 100755 --- a/board/common/mkdisk.sh +++ b/board/common/mkdisk.sh @@ -83,7 +83,7 @@ genboot() { if [ -d "$bootdata" ]; then bootimg=$(cat < br0 .... ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/bridge_veth/topology.svg[Bridge with a physical port and a veth topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::bridge_veth/topology.svg[Bridge with a physical port and a veth topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Bridge with a physical port and a veth topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Bridge with a physical port and a veth topology, align=center, scaledwidth=75%] + +==== Sequence + . 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 -<<< - diff --git a/test/case/ietf_interfaces/bridge_vlan/Readme.adoc b/test/case/ietf_interfaces/bridge_vlan/Readme.adoc index 8e63bba6..ae32c841 120000 --- a/test/case/ietf_interfaces/bridge_vlan/Readme.adoc +++ b/test/case/ietf_interfaces/bridge_vlan/Readme.adoc @@ -1 +1 @@ -bridge_vlan.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/bridge_vlan/bridge_vlan.adoc b/test/case/ietf_interfaces/bridge_vlan/bridge_vlan.adoc deleted file mode 100644 index 913f75e5..00000000 --- a/test/case/ietf_interfaces/bridge_vlan/bridge_vlan.adoc +++ /dev/null @@ -1,38 +0,0 @@ -=== Bridge VLAN -==== Description -Verify VLAN filtering bridge, with a VLAN trunk to a neighboring device, -which in turn untags one VLAN outisde a non-VLAN filtering bridge. - -.Logical network setup -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/bridge_vlan/bridge-vlan.svg[] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::bridge_vlan/bridge-vlan.svg[] -endif::testgroup[] -ifndef::testgroup[] -image::bridge-vlan.svg[] -endif::testgroup[] -endif::topdoc[] - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/bridge_vlan/topology.svg[Bridge VLAN topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::bridge_vlan/topology.svg[Bridge VLAN topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Bridge VLAN topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUT -. Configure DUTs -. Verify ping from host:data to 10.0.0.2 and 10.0.0.3 - - -<<< - diff --git a/test/case/ietf_interfaces/bridge_vlan/test.adoc b/test/case/ietf_interfaces/bridge_vlan/test.adoc new file mode 100644 index 00000000..a6deb7cb --- /dev/null +++ b/test/case/ietf_interfaces/bridge_vlan/test.adoc @@ -0,0 +1,23 @@ +=== Bridge VLAN + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/bridge_vlan] + +==== Description + +Verify VLAN filtering bridge, with a VLAN trunk to a neighboring device, +which in turn untags one VLAN outisde a non-VLAN filtering bridge. + +.Logical network setup +image::bridge-vlan.svg[align=center, scaledwidth=75%] + +==== Topology + +image::topology.svg[Bridge VLAN topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUT +. Configure DUTs +. Verify ping from host:data to 10.0.0.2 and 10.0.0.3 + + diff --git a/test/case/ietf_interfaces/bridge_vlan/test.py b/test/case/ietf_interfaces/bridge_vlan/test.py index 5a2e58c4..d722ff0e 100755 --- a/test/case/ietf_interfaces/bridge_vlan/test.py +++ b/test/case/ietf_interfaces/bridge_vlan/test.py @@ -6,7 +6,7 @@ Verify VLAN filtering bridge, with a VLAN trunk to a neighboring device, which in turn untags one VLAN outisde a non-VLAN filtering bridge. .Logical network setup -image::bridge-vlan.svg[] +image::bridge-vlan.svg[align=center, scaledwidth=75%] """ import infamy diff --git a/test/case/ietf_interfaces/bridge_vlan_separation/Readme.adoc b/test/case/ietf_interfaces/bridge_vlan_separation/Readme.adoc index 239034ef..ae32c841 120000 --- a/test/case/ietf_interfaces/bridge_vlan_separation/Readme.adoc +++ b/test/case/ietf_interfaces/bridge_vlan_separation/Readme.adoc @@ -1 +1 @@ -bridge_vlan_separation.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/bridge_vlan_separation/bridge_vlan_separation.adoc b/test/case/ietf_interfaces/bridge_vlan_separation/test.adoc similarity index 81% rename from test/case/ietf_interfaces/bridge_vlan_separation/bridge_vlan_separation.adoc rename to test/case/ietf_interfaces/bridge_vlan_separation/test.adoc index 2d3816c9..12d6aab7 100644 --- a/test/case/ietf_interfaces/bridge_vlan_separation/bridge_vlan_separation.adoc +++ b/test/case/ietf_interfaces/bridge_vlan_separation/test.adoc @@ -1,5 +1,9 @@ === Bridge VLAN separation + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/bridge_vlan_separation] + ==== Description + Test that two VLANs are correctly separated in the bridge .... @@ -22,18 +26,11 @@ Test that two VLANs are correctly separated in the bridge .... ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/bridge_vlan_separation/topology.svg[Bridge VLAN separation topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::bridge_vlan_separation/topology.svg[Bridge VLAN separation topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Bridge VLAN separation topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Bridge VLAN separation topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Configure DUTs . Verify ping 10.0.0.3 from host:data10 @@ -45,5 +42,3 @@ endif::topdoc[] . Verify broadcast is NOT received on host:data11 and host:data21 -<<< - diff --git a/test/case/ietf_interfaces/dual_bridge/Readme.adoc b/test/case/ietf_interfaces/dual_bridge/Readme.adoc index 8add916e..ae32c841 120000 --- a/test/case/ietf_interfaces/dual_bridge/Readme.adoc +++ b/test/case/ietf_interfaces/dual_bridge/Readme.adoc @@ -1 +1 @@ -dual_bridge.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/dual_bridge/dual_bridge.adoc b/test/case/ietf_interfaces/dual_bridge/dual_bridge.adoc deleted file mode 100644 index 00d08f40..00000000 --- a/test/case/ietf_interfaces/dual_bridge/dual_bridge.adoc +++ /dev/null @@ -1,30 +0,0 @@ -=== Dual bridges on one device -==== Description -Verify that it is possible to ping through a bridge to another bridge via VETH interfaces. - -.... - PING --> br0 br1 10.0.0.2 - / \ / -PC - target:data veth0a - veth0b -.... - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/dual_bridge/topology.svg[Dual bridges on one device topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::dual_bridge/topology.svg[Dual bridges on one device topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Dual bridges on one device topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUTs -. Configure two bridges linked and a veth pair -. Verify ping from host:data to 10.0.0.2 - - -<<< - diff --git a/test/case/ietf_interfaces/dual_bridge/test.adoc b/test/case/ietf_interfaces/dual_bridge/test.adoc new file mode 100644 index 00000000..3e9f03e1 --- /dev/null +++ b/test/case/ietf_interfaces/dual_bridge/test.adoc @@ -0,0 +1,26 @@ +=== Dual bridges on one device + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/dual_bridge] + +==== Description + +Verify that it is possible to ping through a bridge to another bridge +via a VETH pair connected to both. + +.... + PING --> br0 br1 10.0.0.2 + / \ / +PC - target:data veth0a - veth0b +.... + +==== Topology + +image::topology.svg[Dual bridges on one device topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUTs +. Configure two bridges linked and a veth pair +. Verify ping from host:data to 10.0.0.2 + + diff --git a/test/case/ietf_interfaces/dual_bridge/test.py b/test/case/ietf_interfaces/dual_bridge/test.py index 93cbdfa7..49782c27 100755 --- a/test/case/ietf_interfaces/dual_bridge/test.py +++ b/test/case/ietf_interfaces/dual_bridge/test.py @@ -1,16 +1,15 @@ #!/usr/bin/env python3 -# +"""Dual bridges on one device -""" -Dual bridges on one device - -Verify that it is possible to ping through a bridge to another bridge via VETH interfaces. +Verify that it is possible to ping through a bridge to another bridge +via a VETH pair connected to both. .... PING --> br0 br1 10.0.0.2 / \\ / PC - target:data veth0a - veth0b .... + """ import infamy diff --git a/test/case/ietf_interfaces/ietf_interfaces.yaml b/test/case/ietf_interfaces/ietf_interfaces.yaml deleted file mode 100644 index 1ff61d90..00000000 --- a/test/case/ietf_interfaces/ietf_interfaces.yaml +++ /dev/null @@ -1,51 +0,0 @@ ---- -- name: vlan_ping - case: vlan_ping/test.py - -- name: ipv4_address - case: ipv4_address/test.py - -- name: ipv6_address - case: ipv6_address/test.py - -- name: ifalias - case: ifalias/test.py - -- name: iface_phys_address - case: iface_phys_address/test.py - -- name: routing_basic - case: routing_basic/test.py - -- name: vlan_qos - case: vlan_qos/test.py - -- name: speed_duplex_copper - case: speed_duplex_copper/test.py - -- name: verify_all_interface_types - case: verify_all_interface_types/test.py - -- name: iface_enable_disable - case: iface_enable_disable/test.py - -- name: vlan_iface_termination - case: vlan_iface_termination/test.py - -- name: veth_delete - case: veth_delete/test.py - -- name: ipv4_autoconf - case: ipv4_autoconf/test.py - -- name: bridge - suite: bridge.yaml - -- name: link_aggregation - suite: lag.yaml - -- name: igmp - suite: igmp.yaml - -- name: tunnels - suite: tunnels.yaml diff --git a/test/case/ietf_interfaces/iface_enable_disable/Readme.adoc b/test/case/ietf_interfaces/iface_enable_disable/Readme.adoc index a892dfe7..ae32c841 120000 --- a/test/case/ietf_interfaces/iface_enable_disable/Readme.adoc +++ b/test/case/ietf_interfaces/iface_enable_disable/Readme.adoc @@ -1 +1 @@ -iface_enable_disable.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/iface_enable_disable/iface_enable_disable.adoc b/test/case/ietf_interfaces/iface_enable_disable/test.adoc similarity index 56% rename from test/case/ietf_interfaces/iface_enable_disable/iface_enable_disable.adoc rename to test/case/ietf_interfaces/iface_enable_disable/test.adoc index 7b76870c..da3fff3e 100644 --- a/test/case/ietf_interfaces/iface_enable_disable/iface_enable_disable.adoc +++ b/test/case/ietf_interfaces/iface_enable_disable/test.adoc @@ -1,23 +1,20 @@ === Interface status + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/iface_enable_disable] + ==== Description + Verify interface status properly propagate changes when an interface is disabled and then re-enabled. Both admin-status and oper-status are verified. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/iface_enable_disable/topology.svg[Interface status topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::iface_enable_disable/topology.svg[Interface status topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Interface status topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Interface status topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUTs . Configure bridge and associated interfaces in target1 . Disable interface in target2 @@ -27,5 +24,3 @@ endif::topdoc[] . Verify it is possible to ping the interface -<<< - diff --git a/test/case/ietf_interfaces/iface_phys_address/Readme.adoc b/test/case/ietf_interfaces/iface_phys_address/Readme.adoc index 0a5e97b6..ae32c841 120000 --- a/test/case/ietf_interfaces/iface_phys_address/Readme.adoc +++ b/test/case/ietf_interfaces/iface_phys_address/Readme.adoc @@ -1 +1 @@ -iface_phys_address.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/iface_phys_address/iface_phys_address.adoc b/test/case/ietf_interfaces/iface_phys_address/test.adoc similarity index 63% rename from test/case/ietf_interfaces/iface_phys_address/iface_phys_address.adoc rename to test/case/ietf_interfaces/iface_phys_address/test.adoc index de35542d..31101b38 100644 --- a/test/case/ietf_interfaces/iface_phys_address/iface_phys_address.adoc +++ b/test/case/ietf_interfaces/iface_phys_address/test.adoc @@ -1,22 +1,19 @@ === Custom MAC address on interface + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/iface_phys_address] + ==== Description + 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[] -image::{topdoc}../../test/case/ietf_interfaces/iface_phys_address/topology.svg[Custom MAC address on interface topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::iface_phys_address/topology.svg[Custom MAC address on interface topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Custom MAC address on interface topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Custom MAC address on interface topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Set target:data static MAC address '02:01:00:c0:ff:ee' . Verify target:data has MAC address '02:01:00:c0:ff:ee' @@ -30,5 +27,3 @@ endif::topdoc[] . Verify target:data MAC address is reset to default -<<< - diff --git a/test/case/ietf_interfaces/ifalias/Readme.adoc b/test/case/ietf_interfaces/ifalias/Readme.adoc index de7cff80..ae32c841 120000 --- a/test/case/ietf_interfaces/ifalias/Readme.adoc +++ b/test/case/ietf_interfaces/ifalias/Readme.adoc @@ -1 +1 @@ -ifalias.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/ifalias/ifalias.adoc b/test/case/ietf_interfaces/ifalias/ifalias.adoc deleted file mode 100644 index 6fa679e9..00000000 --- a/test/case/ietf_interfaces/ifalias/ifalias.adoc +++ /dev/null @@ -1,25 +0,0 @@ -=== Interface Description (ifAlias) -==== Description -Verify interface description (ifAlias) can be set on an interface and -then be read back from the operational datastore. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/ifalias/topology.svg[Interface Description (ifAlias) topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ifalias/topology.svg[Interface Description (ifAlias) topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Interface Description (ifAlias) topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUT -. Set up interface target:data with description -. Verify description can be read back from operational - - -<<< - diff --git a/test/case/ietf_interfaces/ifalias/test.adoc b/test/case/ietf_interfaces/ifalias/test.adoc new file mode 100644 index 00000000..0f8062a7 --- /dev/null +++ b/test/case/ietf_interfaces/ifalias/test.adoc @@ -0,0 +1,20 @@ +=== Interface Description (ifAlias) + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/ifalias] + +==== Description + +Verify interface description (ifAlias) can be set on an interface and +then be read back from the operational datastore. + +==== Topology + +image::topology.svg[Interface Description (ifAlias) topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUT +. Set up interface target:data with description +. Verify description can be read back from operational + + diff --git a/test/case/ietf_interfaces/igmp.yaml b/test/case/ietf_interfaces/igmp.yaml index 3892dd40..b52c351f 100644 --- a/test/case/ietf_interfaces/igmp.yaml +++ b/test/case/ietf_interfaces/igmp.yaml @@ -1,9 +1,9 @@ --- -- name: igmp_basic +- name: IGMP basic case: igmp_basic/test.py -- name: igmp_vlan +- name: IGMP VLAN case: igmp_vlan/test.py -- name: static_multicast_filters +- name: Static multicast filters case: static_multicast_filters/test.py diff --git a/test/case/ietf_interfaces/igmp_basic/Readme.adoc b/test/case/ietf_interfaces/igmp_basic/Readme.adoc index d1e426bf..ae32c841 120000 --- a/test/case/ietf_interfaces/igmp_basic/Readme.adoc +++ b/test/case/ietf_interfaces/igmp_basic/Readme.adoc @@ -1 +1 @@ -igmp_basic.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/igmp_basic/igmp_basic.adoc b/test/case/ietf_interfaces/igmp_basic/test.adoc similarity index 71% rename from test/case/ietf_interfaces/igmp_basic/igmp_basic.adoc rename to test/case/ietf_interfaces/igmp_basic/test.adoc index ce8554c8..976c110e 100644 --- a/test/case/ietf_interfaces/igmp_basic/igmp_basic.adoc +++ b/test/case/ietf_interfaces/igmp_basic/test.adoc @@ -1,5 +1,9 @@ === IGMP basic + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/igmp_basic] + ==== Description + Verify that all multicast get flooded when no IGMP join exists in the system and the flooding stops as soon a join arrives @@ -17,18 +21,11 @@ the flooding stops as soon a join arrives HOST ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/igmp_basic/topology.svg[IGMP basic topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::igmp_basic/topology.svg[IGMP basic topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[IGMP basic topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[IGMP basic topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUTs . Configure device . Start multicast sender on host:data0, group 224.1.1.1 @@ -38,5 +35,3 @@ endif::topdoc[] . Verify that the group 224.1.1.1 is no longer received on host:data3 -<<< - diff --git a/test/case/ietf_interfaces/igmp_vlan/Readme.adoc b/test/case/ietf_interfaces/igmp_vlan/Readme.adoc index af62b041..ae32c841 120000 --- a/test/case/ietf_interfaces/igmp_vlan/Readme.adoc +++ b/test/case/ietf_interfaces/igmp_vlan/Readme.adoc @@ -1 +1 @@ -igmp_vlan.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/igmp_vlan/igmp_vlan.adoc b/test/case/ietf_interfaces/igmp_vlan/test.adoc similarity index 85% rename from test/case/ietf_interfaces/igmp_vlan/igmp_vlan.adoc rename to test/case/ietf_interfaces/igmp_vlan/test.adoc index 230f2ece..56fcc737 100644 --- a/test/case/ietf_interfaces/igmp_vlan/igmp_vlan.adoc +++ b/test/case/ietf_interfaces/igmp_vlan/test.adoc @@ -1,5 +1,9 @@ === IGMP VLAN + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/igmp_vlan] + ==== Description + Test tagged IGMP control traffic and that VLAN separation is respected for multicast .... @@ -20,18 +24,11 @@ Test tagged IGMP control traffic and that VLAN separation is respected for multi .... ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/igmp_vlan/topology.svg[IGMP VLAN topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::igmp_vlan/topology.svg[IGMP VLAN topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[IGMP VLAN topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[IGMP VLAN topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Configure device . Start multicast sender on host:data11, group 224.2.2.2 @@ -45,5 +42,3 @@ endif::topdoc[] . Verify group 224.1.1.1 is forwarded to host:data12 -<<< - diff --git a/test/case/ietf_interfaces/ipv4_address/Readme.adoc b/test/case/ietf_interfaces/ipv4_address/Readme.adoc index e252c2ab..ae32c841 120000 --- a/test/case/ietf_interfaces/ipv4_address/Readme.adoc +++ b/test/case/ietf_interfaces/ipv4_address/Readme.adoc @@ -1 +1 @@ -ipv4_address.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/ipv4_address/ipv4_address.adoc b/test/case/ietf_interfaces/ipv4_address/test.adoc similarity index 50% rename from test/case/ietf_interfaces/ipv4_address/ipv4_address.adoc rename to test/case/ietf_interfaces/ipv4_address/test.adoc index 4e75f8d0..5d9ed8b3 100644 --- a/test/case/ietf_interfaces/ipv4_address/ipv4_address.adoc +++ b/test/case/ietf_interfaces/ipv4_address/test.adoc @@ -1,20 +1,17 @@ === Interface with IPv4 + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/ipv4_address] + ==== Description + Test that it is possible to set and remove the IPv4 address on an interface ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/ipv4_address/topology.svg[Interface with IPv4 topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ipv4_address/topology.svg[Interface with IPv4 topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Interface with IPv4 topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Interface with IPv4 topology, align=center, scaledwidth=75%] + +==== 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' exists on target:mgmt @@ -22,5 +19,3 @@ endif::topdoc[] . Verify target:mgmt no longer has the address 10.10.10.20 -<<< - diff --git a/test/case/ietf_interfaces/ipv4_autoconf/Readme.adoc b/test/case/ietf_interfaces/ipv4_autoconf/Readme.adoc index ee7471c8..ae32c841 120000 --- a/test/case/ietf_interfaces/ipv4_autoconf/Readme.adoc +++ b/test/case/ietf_interfaces/ipv4_autoconf/Readme.adoc @@ -1 +1 @@ -ipv4_autoconf.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/ipv4_autoconf/ipv4_autoconf.adoc b/test/case/ietf_interfaces/ipv4_autoconf/test.adoc similarity index 62% rename from test/case/ietf_interfaces/ipv4_autoconf/ipv4_autoconf.adoc rename to test/case/ietf_interfaces/ipv4_autoconf/test.adoc index f64cc6de..32943a63 100644 --- a/test/case/ietf_interfaces/ipv4_autoconf/ipv4_autoconf.adoc +++ b/test/case/ietf_interfaces/ipv4_autoconf/test.adoc @@ -1,22 +1,19 @@ === IPv4 link-local + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/ipv4_autoconf] + ==== Description + Verifies that link-local (IPv4LL/ZeroConf) address assignment work as expected. Checks random address, the request-address setting, and address removal on autoconf disable. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/ipv4_autoconf/topology.svg[IPv4 link-local topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ipv4_autoconf/topology.svg[IPv4 link-local topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[IPv4 link-local topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[IPv4 link-local topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Configure interface target:data with IPv4 ZeroConf IP . Verify link-local address exist on target:data @@ -26,5 +23,3 @@ endif::topdoc[] . Verify link-local addresses has been removed from target:data -<<< - diff --git a/test/case/ietf_interfaces/ipv6_address/Readme.adoc b/test/case/ietf_interfaces/ipv6_address/Readme.adoc index aad67e46..ae32c841 120000 --- a/test/case/ietf_interfaces/ipv6_address/Readme.adoc +++ b/test/case/ietf_interfaces/ipv6_address/Readme.adoc @@ -1 +1 @@ -ipv6_address.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/ipv6_address/ipv6_address.adoc b/test/case/ietf_interfaces/ipv6_address/test.adoc similarity index 53% rename from test/case/ietf_interfaces/ipv6_address/ipv6_address.adoc rename to test/case/ietf_interfaces/ipv6_address/test.adoc index 511e19ef..de19c0ef 100644 --- a/test/case/ietf_interfaces/ipv6_address/ipv6_address.adoc +++ b/test/case/ietf_interfaces/ipv6_address/test.adoc @@ -1,25 +1,20 @@ === Interface IPv6 autoconf for bridges + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/ipv6_address] + ==== Description + Verify IPv6 autoconf on a bridge is properly set up for global prefix. See issue #473 for details. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/ipv6_address/topology.svg[Interface IPv6 autoconf for bridges topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ipv6_address/topology.svg[Interface IPv6 autoconf for bridges topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Interface IPv6 autoconf for bridges topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Interface IPv6 autoconf for bridges topology, align=center, scaledwidth=75%] + +==== Sequence + . 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/lag.yaml b/test/case/ietf_interfaces/lag.yaml index 7cf2b3af..229422a9 100644 --- a/test/case/ietf_interfaces/lag.yaml +++ b/test/case/ietf_interfaces/lag.yaml @@ -1,5 +1,5 @@ --- -- name: lag_basic +- name: Ling Aggregation Basic case: lag_basic/test.py -- name: lag_failure +- name: LACP Aggregate w/ Degraded Link case: lag_failure/test.py diff --git a/test/case/ietf_interfaces/lag_basic/Readme.adoc b/test/case/ietf_interfaces/lag_basic/Readme.adoc index ae7efc4b..ae32c841 120000 --- a/test/case/ietf_interfaces/lag_basic/Readme.adoc +++ b/test/case/ietf_interfaces/lag_basic/Readme.adoc @@ -1 +1 @@ -lag_basic.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/lag_basic/lag_basic.adoc b/test/case/ietf_interfaces/lag_basic/lag_basic.adoc deleted file mode 100644 index f5d73866..00000000 --- a/test/case/ietf_interfaces/lag_basic/lag_basic.adoc +++ /dev/null @@ -1,43 +0,0 @@ -=== Ling Aggregation Basic -==== Description -Verify communication over a link aggregate in static and LACP operating -modes during basic failure scenarios. - -.Internal network setup, PC verifies connectivity with dut2 via dut1 -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/lag_basic/lag-basic.svg[Internal networks] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::lag_basic/lag-basic.svg[Internal networks] -endif::testgroup[] -ifndef::testgroup[] -image::lag-basic.svg[Internal networks] -endif::testgroup[] -endif::topdoc[] - -The host verifies connectivity with dut2 via dut1 over the aggregate for -each test step using the `mon` interface. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/lag_basic/topology.svg[Ling Aggregation Basic topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::lag_basic/topology.svg[Ling Aggregation Basic topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Ling Aggregation Basic topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUTs -. Set up LACP link aggregate, lag0, on dut1 and dut2 -. Verify failure modes for lacp mode -. Set up static link aggregate, lag0, on dut1 and dut2 -. Verify failure modes for static mode - - -<<< - diff --git a/test/case/ietf_interfaces/lag_basic/test.adoc b/test/case/ietf_interfaces/lag_basic/test.adoc new file mode 100644 index 00000000..9985f2a3 --- /dev/null +++ b/test/case/ietf_interfaces/lag_basic/test.adoc @@ -0,0 +1,28 @@ +=== Ling Aggregation Basic + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/lag_basic] + +==== Description + +Verify communication over a link aggregate in static and LACP operating +modes during basic failure scenarios. + +.Internal network setup, PC verifies connectivity with dut2 via dut1 +image::lag-basic.svg[align=center, scaledwidth=75%] + +The host verifies connectivity with dut2 via dut1 over the aggregate for +each test step using the `mon` interface. + +==== Topology + +image::topology.svg[Ling Aggregation Basic topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUTs +. Set up LACP link aggregate, lag0, on dut1 and dut2 +. Verify failure modes for lacp mode +. Set up static link aggregate, lag0, on dut1 and dut2 +. Verify failure modes for static mode + + diff --git a/test/case/ietf_interfaces/lag_basic/test.py b/test/case/ietf_interfaces/lag_basic/test.py index 7bb01045..0e646462 100755 --- a/test/case/ietf_interfaces/lag_basic/test.py +++ b/test/case/ietf_interfaces/lag_basic/test.py @@ -5,7 +5,7 @@ Verify communication over a link aggregate in static and LACP operating modes during basic failure scenarios. .Internal network setup, PC verifies connectivity with dut2 via dut1 -image::lag-basic.svg[Internal networks] +image::lag-basic.svg[align=center, scaledwidth=75%] The host verifies connectivity with dut2 via dut1 over the aggregate for each test step using the `mon` interface. diff --git a/test/case/ietf_interfaces/lag_failure/Readme.adoc b/test/case/ietf_interfaces/lag_failure/Readme.adoc index ede0d845..ae32c841 120000 --- a/test/case/ietf_interfaces/lag_failure/Readme.adoc +++ b/test/case/ietf_interfaces/lag_failure/Readme.adoc @@ -1 +1 @@ -lag_failure.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/lag_failure/lag_failure.adoc b/test/case/ietf_interfaces/lag_failure/lag_failure.adoc deleted file mode 100644 index c0caa57c..00000000 --- a/test/case/ietf_interfaces/lag_failure/lag_failure.adoc +++ /dev/null @@ -1,42 +0,0 @@ -=== LACP Aggregate w/ Degraded Link -==== Description -Verify communication over an LACP link aggregate when individual member -links stop forwarding traffic, without carrier loss. - -.Logical network setup, link breakers (lb1 & lb2) here managed by host PC -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/lag_failure/lag-failure.svg[] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::lag_failure/lag-failure.svg[] -endif::testgroup[] -ifndef::testgroup[] -image::lag-failure.svg[] -endif::testgroup[] -endif::topdoc[] - -The host verifies connectivity with dut2 via dut1 over the aggregate for -each failure mode step using the `mon` interface. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/lag_failure/topology.svg[LACP Aggregate w/ Degraded Link topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::lag_failure/topology.svg[LACP Aggregate w/ Degraded Link topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[LACP Aggregate w/ Degraded Link topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUTs -. Set up link aggregate, lag0, between dut1 and dut2 -. Initial connectivity check ... -. Verify failure modes - - -<<< - diff --git a/test/case/ietf_interfaces/lag_failure/test.adoc b/test/case/ietf_interfaces/lag_failure/test.adoc new file mode 100644 index 00000000..d50a375a --- /dev/null +++ b/test/case/ietf_interfaces/lag_failure/test.adoc @@ -0,0 +1,27 @@ +=== LACP Aggregate w/ Degraded Link + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/lag_failure] + +==== Description + +Verify communication over an LACP link aggregate when individual member +links stop forwarding traffic, without carrier loss. + +.Logical network setup, link breakers (lb1 & lb2) here managed by host PC +image::lag-failure.svg[align=center, scaledwidth=75%] + +The host verifies connectivity with dut2 via dut1 over the aggregate for +each failure mode step using the `mon` interface. + +==== Topology + +image::topology.svg[LACP Aggregate w/ Degraded Link topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUTs +. Set up link aggregate, lag0, between dut1 and dut2 +. Initial connectivity check ... +. Verify failure modes + + diff --git a/test/case/ietf_interfaces/lag_failure/test.py b/test/case/ietf_interfaces/lag_failure/test.py index a5ee002b..fa86381f 100755 --- a/test/case/ietf_interfaces/lag_failure/test.py +++ b/test/case/ietf_interfaces/lag_failure/test.py @@ -5,7 +5,7 @@ Verify communication over an LACP link aggregate when individual member links stop forwarding traffic, without carrier loss. .Logical network setup, link breakers (lb1 & lb2) here managed by host PC -image::lag-failure.svg[] +image::lag-failure.svg[align=center, scaledwidth=75%] The host verifies connectivity with dut2 via dut1 over the aggregate for each failure mode step using the `mon` interface. diff --git a/test/case/ietf_interfaces/routing_basic/Readme.adoc b/test/case/ietf_interfaces/routing_basic/Readme.adoc index f0fde0f7..ae32c841 120000 --- a/test/case/ietf_interfaces/routing_basic/Readme.adoc +++ b/test/case/ietf_interfaces/routing_basic/Readme.adoc @@ -1 +1 @@ -routing_basic.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/routing_basic/routing_basic.adoc b/test/case/ietf_interfaces/routing_basic/test.adoc similarity index 58% rename from test/case/ietf_interfaces/routing_basic/routing_basic.adoc rename to test/case/ietf_interfaces/routing_basic/test.adoc index 0e6179ec..facaab42 100644 --- a/test/case/ietf_interfaces/routing_basic/routing_basic.adoc +++ b/test/case/ietf_interfaces/routing_basic/test.adoc @@ -1,21 +1,18 @@ === Routing basic + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/routing_basic] + ==== Description + Verify routing between interfaces is possible. That enable/disable routing in configuration has the expected result. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/routing_basic/topology.svg[Routing basic topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::routing_basic/topology.svg[Routing basic topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Routing basic topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Routing basic topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUTs . Setup host . Enable forwarding on target:data1 and target:data2 @@ -25,5 +22,3 @@ endif::topdoc[] . Verify ping does not work host:data1 to 10.0.0.10 and host:data2 to 192.168.0.10 -<<< - diff --git a/test/case/ietf_interfaces/speed_duplex_copper/Readme.adoc b/test/case/ietf_interfaces/speed_duplex_copper/Readme.adoc index 22d678f6..ae32c841 120000 --- a/test/case/ietf_interfaces/speed_duplex_copper/Readme.adoc +++ b/test/case/ietf_interfaces/speed_duplex_copper/Readme.adoc @@ -1 +1 @@ -speed_duplex_copper.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/speed_duplex_copper/speed_duplex_copper.adoc b/test/case/ietf_interfaces/speed_duplex_copper/test.adoc similarity index 67% rename from test/case/ietf_interfaces/speed_duplex_copper/speed_duplex_copper.adoc rename to test/case/ietf_interfaces/speed_duplex_copper/test.adoc index 4e8d6c20..c4fbbd9b 100644 --- a/test/case/ietf_interfaces/speed_duplex_copper/speed_duplex_copper.adoc +++ b/test/case/ietf_interfaces/speed_duplex_copper/test.adoc @@ -1,5 +1,9 @@ === Interface Speed Duplex (Copper) + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/speed_duplex_copper] + ==== Description + Verify that the interface operates at the expected speed/duplex in two scenarios: 1. Fixed configuration – host and target are both manually set to a specific speed/duplex @@ -7,18 +11,11 @@ Verify that the interface operates at the expected speed/duplex in two scenarios to the highest common speed/duplex. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/speed_duplex_copper/topology.svg[Interface Speed Duplex (Copper) topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::speed_duplex_copper/topology.svg[Interface Speed Duplex (Copper) topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Interface Speed Duplex (Copper) topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Interface Speed Duplex (Copper) topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Enable target interface . Verify fixed 10/full @@ -34,5 +31,3 @@ endif::topdoc[] . Verify auto-negotiation to 10/half + 10/full + 100/half + 100/full + 1000/full -<<< - diff --git a/test/case/ietf_interfaces/static_multicast_filters/Readme.adoc b/test/case/ietf_interfaces/static_multicast_filters/Readme.adoc index d7139d5f..ae32c841 120000 --- a/test/case/ietf_interfaces/static_multicast_filters/Readme.adoc +++ b/test/case/ietf_interfaces/static_multicast_filters/Readme.adoc @@ -1 +1 @@ -static_multicast_filters.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/static_multicast_filters/static_multicast_filters.adoc b/test/case/ietf_interfaces/static_multicast_filters/test.adoc similarity index 75% rename from test/case/ietf_interfaces/static_multicast_filters/static_multicast_filters.adoc rename to test/case/ietf_interfaces/static_multicast_filters/test.adoc index e0b3b694..9ffa6c28 100644 --- a/test/case/ietf_interfaces/static_multicast_filters/static_multicast_filters.adoc +++ b/test/case/ietf_interfaces/static_multicast_filters/test.adoc @@ -1,5 +1,9 @@ === Static multicast filters + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/static_multicast_filters] + ==== Description + Verify that static multicast filters work (remember that snooping needs to enabled when using static multicast filters) @@ -19,18 +23,11 @@ enabled when using static multicast filters) .... ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/static_multicast_filters/topology.svg[Static multicast filters topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::static_multicast_filters/topology.svg[Static multicast filters topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Static multicast filters topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Static multicast filters topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUTs . Configure device without static filter . Start multicast sender on host:data1, group 224.1.1.1 @@ -45,5 +42,3 @@ endif::topdoc[] . Verify that the MAC group is no longer forwarded to host:data3 -<<< - diff --git a/test/case/ietf_interfaces/tunnel_basic/Readme.adoc b/test/case/ietf_interfaces/tunnel_basic/Readme.adoc index 79d3c027..08628abf 100644 --- a/test/case/ietf_interfaces/tunnel_basic/Readme.adoc +++ b/test/case/ietf_interfaces/tunnel_basic/Readme.adoc @@ -1,6 +1,10 @@ -include::gre_basic.adoc[] +include::gre.adoc[] -include::gretap_basic.adoc[] +<<< -include::vxlan_basic.adoc[] +include::gretap.adoc[] + +<<< + +include::vxlan.adoc[] diff --git a/test/case/ietf_interfaces/tunnel_basic/gre.adoc b/test/case/ietf_interfaces/tunnel_basic/gre.adoc new file mode 100644 index 00000000..96fcbbbe --- /dev/null +++ b/test/case/ietf_interfaces/tunnel_basic/gre.adoc @@ -0,0 +1,26 @@ +=== GRE point-to-point + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/tunnel_basic] + +==== Description + +Set up a tunnel between two DUTs, host connected to the first DUT. Enable +IP forwarding on first DUT's interface to host and the tunnel interface to +the second DUT. On host, add route to IP network of second DUT and verify +connectivity with the second DUT through the tunnel. + +- Tunnel types: GRE, GRETAP, and VxLAN +- Connectivity: IPv4 and IPv6 + +==== Topology + +image::topology.svg[GRE point-to-point topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUTs +. Configure DUTs with tunnel gre +. Verify connectivity host:data to 10.0.0.2 +. Verify connectivity host:data to 2001:db8::c0a8:0a02 + + diff --git a/test/case/ietf_interfaces/tunnel_basic/gre.py b/test/case/ietf_interfaces/tunnel_basic/gre.py new file mode 120000 index 00000000..94656643 --- /dev/null +++ b/test/case/ietf_interfaces/tunnel_basic/gre.py @@ -0,0 +1 @@ +test.py \ No newline at end of file diff --git a/test/case/ietf_interfaces/tunnel_basic/gre_basic.adoc b/test/case/ietf_interfaces/tunnel_basic/gre_basic.adoc deleted file mode 100644 index c1ec9746..00000000 --- a/test/case/ietf_interfaces/tunnel_basic/gre_basic.adoc +++ /dev/null @@ -1,26 +0,0 @@ -=== GRE point-to-point -==== Description -Test setting up gre tunnels using IPv4 and IPv6, -and ends with a connectivity test. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/tunnel_basic/topology.svg[GRE point-to-point topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::tunnel_basic/topology.svg[GRE point-to-point topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[GRE point-to-point topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUTs -. Configure DUTs -. Verify connectivity host:data to 10.0.0.2 -. Verify connectivity host:data to 2001:db8::c0a8:0a02 - - -<<< - diff --git a/test/case/ietf_interfaces/tunnel_basic/gretap.adoc b/test/case/ietf_interfaces/tunnel_basic/gretap.adoc new file mode 100644 index 00000000..d08dfeb1 --- /dev/null +++ b/test/case/ietf_interfaces/tunnel_basic/gretap.adoc @@ -0,0 +1,26 @@ +=== GRETAP point-to-point + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/tunnel_basic] + +==== Description + +Set up a tunnel between two DUTs, host connected to the first DUT. Enable +IP forwarding on first DUT's interface to host and the tunnel interface to +the second DUT. On host, add route to IP network of second DUT and verify +connectivity with the second DUT through the tunnel. + +- Tunnel types: GRE, GRETAP, and VxLAN +- Connectivity: IPv4 and IPv6 + +==== Topology + +image::topology.svg[GRETAP point-to-point topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUTs +. Configure DUTs with tunnel gretap +. Verify connectivity host:data to 10.0.0.2 +. Verify connectivity host:data to 2001:db8::c0a8:0a02 + + diff --git a/test/case/ietf_interfaces/tunnel_basic/gretap.py b/test/case/ietf_interfaces/tunnel_basic/gretap.py new file mode 120000 index 00000000..94656643 --- /dev/null +++ b/test/case/ietf_interfaces/tunnel_basic/gretap.py @@ -0,0 +1 @@ +test.py \ No newline at end of file diff --git a/test/case/ietf_interfaces/tunnel_basic/gretap_basic.adoc b/test/case/ietf_interfaces/tunnel_basic/gretap_basic.adoc deleted file mode 100644 index 2ca105f6..00000000 --- a/test/case/ietf_interfaces/tunnel_basic/gretap_basic.adoc +++ /dev/null @@ -1,26 +0,0 @@ -=== GRETAP point-to-point -==== Description -Test setting up gretap tunnels using IPv4 and IPv6, -and ends with a connectivity test. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/tunnel_basic/topology.svg[GRETAP point-to-point topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::tunnel_basic/topology.svg[GRETAP point-to-point topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[GRETAP point-to-point topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUTs -. Configure DUTs -. Verify connectivity host:data to 10.0.0.2 -. Verify connectivity host:data to 2001:db8::c0a8:0a02 - - -<<< - diff --git a/test/case/ietf_interfaces/tunnel_basic/test.py b/test/case/ietf_interfaces/tunnel_basic/test.py index 6c33f231..07506ea9 100755 --- a/test/case/ietf_interfaces/tunnel_basic/test.py +++ b/test/case/ietf_interfaces/tunnel_basic/test.py @@ -2,27 +2,34 @@ """ Basic tunnel connectivity test -Test setting up {type} tunnels using IPv4 and IPv6, -and ends with a connectivity test. +Set up a tunnel between two DUTs, host connected to the first DUT. Enable +IP forwarding on first DUT's interface to host and the tunnel interface to +the second DUT. On host, add route to IP network of second DUT and verify +connectivity with the second DUT through the tunnel. + +- Tunnel types: GRE, GRETAP, and VxLAN +- Connectivity: IPv4 and IPv6 """ import infamy + class ArgumentParser(infamy.ArgumentParser): def __init__(self): super().__init__() - self.add_argument("--type") + self.add_argument("--tunnel") + with infamy.Test() as test: with test.step("Set up topology and attach to target DUTs"): - args=ArgumentParser() - env = infamy.Env(args=args) - type = env.args.type + arg = ArgumentParser() + env = infamy.Env(args=arg) + tunnel = env.args.tunnel left = env.attach("left", "mgmt") right = env.attach("right", "mgmt") - with test.step("Configure DUTs"): - container_left4 = { + with test.step("Configure DUTs with tunnel {tunnel}"): + container_left4 = { "local": "192.168.50.1", "remote": "192.168.50.2" } @@ -30,7 +37,7 @@ with infamy.Test() as test: "local": "2001:db8:3c4d:50::1", "remote": "2001:db8:3c4d:50::2", } - container_right4 = { + container_right4 = { "local": "192.168.50.2", "remote": "192.168.50.1" } @@ -38,10 +45,11 @@ with infamy.Test() as test: "local": "2001:db8:3c4d:50::2", "remote": "2001:db8:3c4d:50::1", } - if type == "gretap" or type == "gre": - container_name = "gre" - if type == "vxlan": - container_name = "vxlan" + + if tunnel in ("gretap", "gre"): + CONTAINER_TYPE = "gre" + else: + CONTAINER_TYPE = tunnel container_left4.update({ "vni": 4 }) @@ -55,11 +63,9 @@ with infamy.Test() as test: "vni": 6 }) - - left.put_config_dicts({ "ietf-interfaces": { + left.put_config_dicts({"ietf-interfaces": { "interfaces": { - "interface": [ - { + "interface": [{ "name": left["link"], "ipv4": { "address": [{ @@ -75,8 +81,7 @@ with infamy.Test() as test: }], "forwarding": True } - }, - { + }, { "name": left["data"], "ipv4": { "address": [{ @@ -92,10 +97,9 @@ with infamy.Test() as test: }], "forwarding": True } - }, - { - "name": f"{type}4", - "type": f"infix-if-type:{type}", + }, { + "name": f"{tunnel}4", + "type": f"infix-if-type:{tunnel}", "ipv4": { "address": [{ "ip": "192.168.30.1", @@ -103,28 +107,25 @@ with infamy.Test() as test: }], "forwarding": True }, - container_name: container_left4 - }, - { - "name": f"{type}6", - "type": f"infix-if-type:{type}", + CONTAINER_TYPE: container_left4 + }, { + "name": f"{tunnel}6", + "type": f"infix-if-type:{tunnel}", "ipv6": { "address": [{ "ip": "2001:db8:3c4d:30::1", "prefix-length": 64 }] }, - container_name: container_left6 + CONTAINER_TYPE: container_left6 }] } - } - }) + }}) right.put_config_dicts({ "ietf-interfaces": { "interfaces": { - "interface": [ - { + "interface": [{ "name": right["link"], "ipv4": { "address": [{ @@ -139,10 +140,9 @@ with infamy.Test() as test: "prefix-length": 64 }] } - }, - { - "name": f"{type}4", - "type": f"infix-if-type:{type}", + }, { + "name": f"{tunnel}4", + "type": f"infix-if-type:{tunnel}", "ipv4": { "address": [{ "ip": "192.168.30.2", @@ -150,18 +150,17 @@ with infamy.Test() as test: }], "forwarding": True }, - container_name: container_right4 - }, - { - "name": f"{type}", - "type": f"infix-if-type:{type}", + CONTAINER_TYPE: container_right4 + }, { + "name": f"{tunnel}", + "type": f"infix-if-type:{tunnel}", "ipv6": { "address": [{ "ip": "2001:db8:3c4d:30::2", "prefix-length": 64 }] }, - container_name: container_right6 + CONTAINER_TYPE: container_right6 }] } }, @@ -194,6 +193,7 @@ with infamy.Test() as test: } } }) + _, hport = env.ltop.xlate("host", "data") with test.step("Verify connectivity host:data to 10.0.0.2"): with infamy.IsolatedMacVlan(hport) as ns0: diff --git a/test/case/ietf_interfaces/tunnel_basic/test.yaml b/test/case/ietf_interfaces/tunnel_basic/test.yaml index a56130f7..a658e1bd 100644 --- a/test/case/ietf_interfaces/tunnel_basic/test.yaml +++ b/test/case/ietf_interfaces/tunnel_basic/test.yaml @@ -1,18 +1,15 @@ --- -- name: gre_basic - case: test.py - opts: ["--type", "gre"] - infamy: - title: GRE point-to-point +- settings: + test-spec: .adoc -- name: gretap_basic - case: test.py - opts: ["--type", "gretap"] - infamy: - title: GRETAP point-to-point +- name: GRE point-to-point + case: gre.py + opts: ["--tunnel", "gre"] -- name: vxlan_basic - case: test.py - opts: ["--type", "vxlan"] - infamy: - title: VXLAN point-to-point +- name: GRETAP point-to-point + case: gretap.py + opts: ["--tunnel", "gretap"] + +- name: VXLAN point-to-point + case: vxlan.py + opts: ["--tunnel", "vxlan"] diff --git a/test/case/ietf_interfaces/tunnel_basic/vxlan.adoc b/test/case/ietf_interfaces/tunnel_basic/vxlan.adoc new file mode 100644 index 00000000..900f08a0 --- /dev/null +++ b/test/case/ietf_interfaces/tunnel_basic/vxlan.adoc @@ -0,0 +1,26 @@ +=== VXLAN point-to-point + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/tunnel_basic] + +==== Description + +Set up a tunnel between two DUTs, host connected to the first DUT. Enable +IP forwarding on first DUT's interface to host and the tunnel interface to +the second DUT. On host, add route to IP network of second DUT and verify +connectivity with the second DUT through the tunnel. + +- Tunnel types: GRE, GRETAP, and VxLAN +- Connectivity: IPv4 and IPv6 + +==== Topology + +image::topology.svg[VXLAN point-to-point topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUTs +. Configure DUTs with tunnel vxlan +. Verify connectivity host:data to 10.0.0.2 +. Verify connectivity host:data to 2001:db8::c0a8:0a02 + + diff --git a/test/case/ietf_interfaces/tunnel_basic/vxlan.py b/test/case/ietf_interfaces/tunnel_basic/vxlan.py new file mode 120000 index 00000000..94656643 --- /dev/null +++ b/test/case/ietf_interfaces/tunnel_basic/vxlan.py @@ -0,0 +1 @@ +test.py \ No newline at end of file diff --git a/test/case/ietf_interfaces/tunnel_basic/vxlan_basic.adoc b/test/case/ietf_interfaces/tunnel_basic/vxlan_basic.adoc deleted file mode 100644 index b413c0e5..00000000 --- a/test/case/ietf_interfaces/tunnel_basic/vxlan_basic.adoc +++ /dev/null @@ -1,26 +0,0 @@ -=== VXLAN point-to-point -==== Description -Test setting up vxlan tunnels using IPv4 and IPv6, -and ends with a connectivity test. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/tunnel_basic/topology.svg[VXLAN point-to-point topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::tunnel_basic/topology.svg[VXLAN point-to-point topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[VXLAN point-to-point topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUTs -. Configure DUTs -. Verify connectivity host:data to 10.0.0.2 -. Verify connectivity host:data to 2001:db8::c0a8:0a02 - - -<<< - diff --git a/test/case/ietf_interfaces/tunnel_bridged/Readme.adoc b/test/case/ietf_interfaces/tunnel_bridged/Readme.adoc index cab52edf..f021948e 100644 --- a/test/case/ietf_interfaces/tunnel_bridged/Readme.adoc +++ b/test/case/ietf_interfaces/tunnel_bridged/Readme.adoc @@ -1,4 +1,6 @@ -include::gretap_bridged.adoc[] +include::gretap.adoc[] -include::vxlan_bridged.adoc[] +<<< + +include::vxlan.adoc[] diff --git a/test/case/ietf_interfaces/tunnel_bridged/gretap.adoc b/test/case/ietf_interfaces/tunnel_bridged/gretap.adoc new file mode 100644 index 00000000..3c0f984d --- /dev/null +++ b/test/case/ietf_interfaces/tunnel_bridged/gretap.adoc @@ -0,0 +1,24 @@ +=== GRETAP bridged with physical interface + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/tunnel_bridged] + +==== Description + +Set up a layer-2 tunnel between two DUTs, host is connected to the first DUT. +Bridge the interface connected to the host and the tunnel interface on the +first DUT. On host, verify connectivity with the second DUT through tunnel. + +- Tunnel types: GRETAP, and VxLAN +- Connectivity: IPv4 + +==== Topology + +image::topology.svg[GRETAP bridged with physical interface topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUTs +. Configure DUTs with tunnel gretap +. Test connectivity host:data to right:gretap0 at 192.168.10.2 + + diff --git a/test/case/ietf_interfaces/tunnel_bridged/gretap.py b/test/case/ietf_interfaces/tunnel_bridged/gretap.py new file mode 120000 index 00000000..94656643 --- /dev/null +++ b/test/case/ietf_interfaces/tunnel_bridged/gretap.py @@ -0,0 +1 @@ +test.py \ No newline at end of file diff --git a/test/case/ietf_interfaces/tunnel_bridged/gretap_bridged.adoc b/test/case/ietf_interfaces/tunnel_bridged/gretap_bridged.adoc deleted file mode 100644 index 8b24dc12..00000000 --- a/test/case/ietf_interfaces/tunnel_bridged/gretap_bridged.adoc +++ /dev/null @@ -1,24 +0,0 @@ -=== GRETAP bridged with physical interface -==== Description -Test that gretap works as it should and that it possible to bridge it. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/tunnel_bridged/topology.svg[GRETAP bridged with physical interface topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::tunnel_bridged/topology.svg[GRETAP bridged with physical interface topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[GRETAP bridged with physical interface topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUTs -. Configure DUTs -. Test connectivity host:data to right:gretap0 at 192.168.10.2 - - -<<< - diff --git a/test/case/ietf_interfaces/tunnel_bridged/test.py b/test/case/ietf_interfaces/tunnel_bridged/test.py index 685b8696..15b28322 100755 --- a/test/case/ietf_interfaces/tunnel_bridged/test.py +++ b/test/case/ietf_interfaces/tunnel_bridged/test.py @@ -2,36 +2,42 @@ """ Tunnel interface bridged with physical -Test that {type} works as it should and that it possible to bridge it. +Set up a layer-2 tunnel between two DUTs, host is connected to the first DUT. +Bridge the interface connected to the host and the tunnel interface on the +first DUT. On host, verify connectivity with the second DUT through tunnel. +- Tunnel types: GRETAP, and VxLAN +- Connectivity: IPv4 """ import infamy + class ArgumentParser(infamy.ArgumentParser): def __init__(self): super().__init__() - self.add_argument("--type") + self.add_argument("--tunnel") + with infamy.Test() as test: with test.step("Set up topology and attach to target DUTs"): - args=ArgumentParser() - env = infamy.Env(args=args) + arg = ArgumentParser() + env = infamy.Env(args=arg) left = env.attach("left", "mgmt") right = env.attach("right", "mgmt") - type = env.args.type + tunnel = env.args.tunnel - with test.step("Configure DUTs"): - if type == "gretap": - container_name = "gre" + with test.step("Configure DUTs with tunnel {tunnel}"): + if tunnel == "gretap": + CONTAINER_TYPE = "gre" else: - container_name = type + CONTAINER_TYPE = tunnel - container_left = { + container_left = { "local": "192.168.50.1", "remote": "192.168.50.2" } - container_right = { + container_right = { "local": "192.168.50.2", "remote": "192.168.50.1" } @@ -41,10 +47,10 @@ with infamy.Test() as test: container_right.update({ "vni": 4 }) - left.put_config_dicts({ "ietf-interfaces": { + + left.put_config_dicts({"ietf-interfaces": { "interfaces": { - "interface": [ - { + "interface": [{ "name": left["link"], "ipv4": { "address": [{ @@ -53,36 +59,30 @@ with infamy.Test() as test: }], "forwarding": True } - }, - { + }, { "name": left["data"], "bridge-port": { "bridge": "br0" } - }, - { + }, { "name": "br0", "type": "infix-if-type:bridge" - }, - { - "name": f"{type}0", - "type": f"infix-if-type:{type}", - container_name: container_left, + }, { + "name": f"{tunnel}0", + "type": f"infix-if-type:{tunnel}", + CONTAINER_TYPE: container_left, "bridge-port": { "bridge": "br0" } - } - ] - } - } - }) + }] + } + }}) right.put_config_dicts({ "ietf-interfaces": { "interfaces": { - "interface": [ - { + "interface": [{ "name": right["link"], "ipv4": { "address": [{ @@ -97,10 +97,9 @@ with infamy.Test() as test: "prefix-length": 64 }] } - }, - { - "name": f"{type}0", - "type": f"infix-if-type:{type}", + }, { + "name": f"{tunnel}0", + "type": f"infix-if-type:{tunnel}", "ipv4": { "address": [{ "ip": "192.168.10.2", @@ -108,13 +107,14 @@ with infamy.Test() as test: }], "forwarding": True }, - container_name: container_right, + CONTAINER_TYPE: container_right, }] } } }) + _, hport = env.ltop.xlate("host", "data") - with test.step(f"Test connectivity host:data to right:{type}0 at 192.168.10.2"): + with test.step(f"Test connectivity host:data to right:{tunnel}0 at 192.168.10.2"): with infamy.IsolatedMacVlan(hport) as ns0: ns0.addip("192.168.10.1") ns0.must_reach("192.168.10.2") diff --git a/test/case/ietf_interfaces/tunnel_bridged/test.yaml b/test/case/ietf_interfaces/tunnel_bridged/test.yaml index 58b53673..b65bbb4a 100644 --- a/test/case/ietf_interfaces/tunnel_bridged/test.yaml +++ b/test/case/ietf_interfaces/tunnel_bridged/test.yaml @@ -1,12 +1,11 @@ --- -- name: gretap_bridged - case: test.py - opts: ["--type", "gretap"] - infamy: - title: GRETAP bridged with physical interface +- settings: + test-spec: .adoc -- name: vxlan_bridged - case: test.py - opts: ["--type", "vxlan"] - infamy: - title: VXLAN bridged with physical interface +- name: GRETAP bridged with physical interface + case: gretap.py + opts: ["--tunnel", "gretap"] + +- name: VXLAN bridged with physical interface + case: vxlan.py + opts: ["--tunnel", "vxlan"] diff --git a/test/case/ietf_interfaces/tunnel_bridged/vxlan.adoc b/test/case/ietf_interfaces/tunnel_bridged/vxlan.adoc new file mode 100644 index 00000000..7f6c8a25 --- /dev/null +++ b/test/case/ietf_interfaces/tunnel_bridged/vxlan.adoc @@ -0,0 +1,24 @@ +=== VXLAN bridged with physical interface + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/tunnel_bridged] + +==== Description + +Set up a layer-2 tunnel between two DUTs, host is connected to the first DUT. +Bridge the interface connected to the host and the tunnel interface on the +first DUT. On host, verify connectivity with the second DUT through tunnel. + +- Tunnel types: GRETAP, and VxLAN +- Connectivity: IPv4 + +==== Topology + +image::topology.svg[VXLAN bridged with physical interface topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUTs +. Configure DUTs with tunnel vxlan +. Test connectivity host:data to right:vxlan0 at 192.168.10.2 + + diff --git a/test/case/ietf_interfaces/tunnel_bridged/vxlan.py b/test/case/ietf_interfaces/tunnel_bridged/vxlan.py new file mode 120000 index 00000000..94656643 --- /dev/null +++ b/test/case/ietf_interfaces/tunnel_bridged/vxlan.py @@ -0,0 +1 @@ +test.py \ No newline at end of file diff --git a/test/case/ietf_interfaces/tunnel_bridged/vxlan_bridged.adoc b/test/case/ietf_interfaces/tunnel_bridged/vxlan_bridged.adoc deleted file mode 100644 index 92647592..00000000 --- a/test/case/ietf_interfaces/tunnel_bridged/vxlan_bridged.adoc +++ /dev/null @@ -1,24 +0,0 @@ -=== VXLAN bridged with physical interface -==== Description -Test that vxlan works as it should and that it possible to bridge it. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/tunnel_bridged/topology.svg[VXLAN bridged with physical interface topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::tunnel_bridged/topology.svg[VXLAN bridged with physical interface topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[VXLAN bridged with physical interface topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUTs -. Configure DUTs -. Test connectivity host:data to right:vxlan0 at 192.168.10.2 - - -<<< - diff --git a/test/case/ietf_interfaces/tunnels.yaml b/test/case/ietf_interfaces/tunnels.yaml index 0ebfada8..dd0b8242 100644 --- a/test/case/ietf_interfaces/tunnels.yaml +++ b/test/case/ietf_interfaces/tunnels.yaml @@ -1,6 +1,6 @@ --- -- name: tunnel_basic +- name: Basic tunnel connectivity test suite: tunnel_basic/test.yaml -- name: tunnel_bridged +- name: Tunnel interface bridged with physical suite: tunnel_bridged/test.yaml 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 fe419baa..ae32c841 120000 --- a/test/case/ietf_interfaces/verify_all_interface_types/Readme.adoc +++ b/test/case/ietf_interfaces/verify_all_interface_types/Readme.adoc @@ -1 +1 @@ -verify_all_interface_types.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/verify_all_interface_types/verify_all_interface_types.adoc b/test/case/ietf_interfaces/verify_all_interface_types/test.adoc similarity index 78% rename from test/case/ietf_interfaces/verify_all_interface_types/verify_all_interface_types.adoc rename to test/case/ietf_interfaces/verify_all_interface_types/test.adoc index 298a3bec..5392a3bb 100644 --- a/test/case/ietf_interfaces/verify_all_interface_types/verify_all_interface_types.adoc +++ b/test/case/ietf_interfaces/verify_all_interface_types/test.adoc @@ -1,5 +1,9 @@ === Verify that all interface types can be created + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/verify_all_interface_types] + ==== 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. @@ -15,18 +19,11 @@ slightly longer than sending the entire configuration at once. .... ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/verify_all_interface_types/topology.svg[Verify that all interface types can be created topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::verify_all_interface_types/topology.svg[Verify that all interface types can be created topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Verify that all interface types can be created topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Verify that all interface types can be created topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Configure an empty bridge br-0 . Configure bridge br-X and associated interfaces @@ -44,5 +41,3 @@ endif::topdoc[] . Verify VxLAN interfaces 'vxlan-v4' and 'vxlan-v6' -<<< - diff --git a/test/case/ietf_interfaces/veth_delete/Readme.adoc b/test/case/ietf_interfaces/veth_delete/Readme.adoc index 7892befc..ae32c841 120000 --- a/test/case/ietf_interfaces/veth_delete/Readme.adoc +++ b/test/case/ietf_interfaces/veth_delete/Readme.adoc @@ -1 +1 @@ -veth_delete.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/veth_delete/veth_delete.adoc b/test/case/ietf_interfaces/veth_delete/test.adoc similarity index 64% rename from test/case/ietf_interfaces/veth_delete/veth_delete.adoc rename to test/case/ietf_interfaces/veth_delete/test.adoc index 1cefb4c0..0053ae6a 100644 --- a/test/case/ietf_interfaces/veth_delete/veth_delete.adoc +++ b/test/case/ietf_interfaces/veth_delete/test.adoc @@ -1,5 +1,9 @@ === Verify that VETH pairs can be deleted + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/veth_delete] + ==== Description + ``` veth0b veth0a data1 data2 `---------' @@ -9,18 +13,11 @@ Each test step to create, add address, or delete an interace is distinct from any other step. This to trigger a new configuration "generation". ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/veth_delete/topology.svg[Verify that VETH pairs can be deleted topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::veth_delete/topology.svg[Verify that VETH pairs can be deleted topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Verify that VETH pairs can be deleted topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Verify that VETH pairs can be deleted topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Create VETH pair . Verify interfaces 'veth0a' and 'veth0b' exist @@ -31,5 +28,3 @@ endif::topdoc[] . Verify VETH pair have been removed -<<< - diff --git a/test/case/ietf_interfaces/vlan_iface_termination/Readme.adoc b/test/case/ietf_interfaces/vlan_iface_termination/Readme.adoc index b986458d..ae32c841 120000 --- a/test/case/ietf_interfaces/vlan_iface_termination/Readme.adoc +++ b/test/case/ietf_interfaces/vlan_iface_termination/Readme.adoc @@ -1 +1 @@ -vlan_iface_termination.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/vlan_iface_termination/vlan_iface_termination.adoc b/test/case/ietf_interfaces/vlan_iface_termination/test.adoc similarity index 73% rename from test/case/ietf_interfaces/vlan_iface_termination/vlan_iface_termination.adoc rename to test/case/ietf_interfaces/vlan_iface_termination/test.adoc index cc955c6b..ed1a8939 100644 --- a/test/case/ietf_interfaces/vlan_iface_termination/vlan_iface_termination.adoc +++ b/test/case/ietf_interfaces/vlan_iface_termination/test.adoc @@ -1,5 +1,9 @@ === VLAN Interface Termination + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/vlan_iface_termination] + ==== Description + Verify that VLANs stacked on top of an interfaces that are also attached to a VLAN filtering bridge are always locally terminated. @@ -26,18 +30,11 @@ both `data1` and `data2`, _bridging_ of packets from one to the other must _not_ be allowed. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/vlan_iface_termination/topology.svg[VLAN Interface Termination topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::vlan_iface_termination/topology.svg[VLAN Interface Termination topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[VLAN Interface Termination topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[VLAN Interface Termination topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target . Configure bridge and VLAN interfaces on target . Configure IP addresses and VLAN interfaces on host @@ -47,5 +44,3 @@ endif::topdoc[] . Verify that host:data2 can reach target on VLAN 10 -<<< - diff --git a/test/case/ietf_interfaces/vlan_ping/Readme.adoc b/test/case/ietf_interfaces/vlan_ping/Readme.adoc index bdc22d63..ae32c841 120000 --- a/test/case/ietf_interfaces/vlan_ping/Readme.adoc +++ b/test/case/ietf_interfaces/vlan_ping/Readme.adoc @@ -1 +1 @@ -vlan_ping.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/vlan_ping/vlan_ping.adoc b/test/case/ietf_interfaces/vlan_ping/test.adoc similarity index 53% rename from test/case/ietf_interfaces/vlan_ping/vlan_ping.adoc rename to test/case/ietf_interfaces/vlan_ping/test.adoc index 38e45dc7..fb2f10e6 100644 --- a/test/case/ietf_interfaces/vlan_ping/vlan_ping.adoc +++ b/test/case/ietf_interfaces/vlan_ping/test.adoc @@ -1,20 +1,17 @@ === VLAN ping connectivity + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/vlan_ping] + ==== Description + Very basic test if the VLAN interface configuration works. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/vlan_ping/topology.svg[VLAN ping connectivity topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::vlan_ping/topology.svg[VLAN ping connectivity topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[VLAN ping connectivity topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[VLAN ping connectivity topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Set up VLAN interface on host:data with IP 10.0.0.1 . Configure VLAN 10 interface on target:data with IP 10.0.0.2 @@ -24,5 +21,3 @@ endif::topdoc[] . Verify that host:data can no longer reach 10.0.0.2 -<<< - diff --git a/test/case/ietf_interfaces/vlan_qos/Readme.adoc b/test/case/ietf_interfaces/vlan_qos/Readme.adoc index a298e055..ae32c841 120000 --- a/test/case/ietf_interfaces/vlan_qos/Readme.adoc +++ b/test/case/ietf_interfaces/vlan_qos/Readme.adoc @@ -1 +1 @@ -vlan_qos.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_interfaces/vlan_qos/vlan_qos.adoc b/test/case/ietf_interfaces/vlan_qos/test.adoc similarity index 77% rename from test/case/ietf_interfaces/vlan_qos/vlan_qos.adoc rename to test/case/ietf_interfaces/vlan_qos/test.adoc index ab485e66..e8993e4d 100644 --- a/test/case/ietf_interfaces/vlan_qos/vlan_qos.adoc +++ b/test/case/ietf_interfaces/vlan_qos/test.adoc @@ -1,5 +1,9 @@ === VLAN Interface Ingress/Egress QoS + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_interfaces/vlan_qos] + ==== Description + Inject different packets from the host and verify that the VLAN priority is handled correctly for traffic ingressing and egressing a VLAN interface. @@ -15,18 +19,11 @@ correctly to PCP on egress ('from internal priority' or static '0..7'). { "id": 6, "pcp": 6, "ingress": "from-pcp", "egress": "from-priority", "expect": 6 }, ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_interfaces/vlan_qos/topology.svg[VLAN Interface Ingress/Egress QoS topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::vlan_qos/topology.svg[VLAN Interface Ingress/Egress QoS topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[VLAN Interface Ingress/Egress QoS topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[VLAN Interface Ingress/Egress QoS topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Apply initial config without priority mapping . Setup host VLANs @@ -38,5 +35,3 @@ endif::topdoc[] . Verify that packet with id=6 egressed with pcp=6 -<<< - diff --git a/test/case/ietf_interfaces/vlan_qos/topology.dot b/test/case/ietf_interfaces/vlan_qos/topology.dot index 4efe0fee..07e11a52 100644 --- a/test/case/ietf_interfaces/vlan_qos/topology.dot +++ b/test/case/ietf_interfaces/vlan_qos/topology.dot @@ -22,4 +22,4 @@ graph "1x3" { host:mgmt -- target:mgmt [requires="mgmt", color=lightgrey] host:data0 -- target:data0 [color=black, fontcolor=black, fontsize=12, taillabel="(vlan10) 192.168.10.2/24", headlabel="192.168.10.1/24 (vlan10)"] host:data1 -- target:data1 [color=black, fontcolor=black, fontsize=12, taillabel="(vlan11) 192.168.11.2/24", headlabel="192.168.11.1/24 (vlan11)"] -} \ No newline at end of file +} diff --git a/test/case/ietf_routing/Readme.adoc b/test/case/ietf_routing/Readme.adoc index d0287187..20a01aa7 100644 --- a/test/case/ietf_routing/Readme.adoc +++ b/test/case/ietf_routing/Readme.adoc @@ -1,23 +1,48 @@ :testgroup: - == ietf-routing -<<< +Tests verifying IETF standard routing protocols and configuration: + + - Static routing configuration and forwarding behavior + - OSPF basic neighbor discovery and LSA exchange + - OSPF unnumbered interface configuration + - OSPF multi-area configuration and inter-area routing + - OSPF with BFD (Bidirectional Forwarding Detection) + - OSPF default route advertisement and propagation + - Route preference handling for OSPF routes + - Route preference handling for DHCP-learned routes + - Administrative distance configuration (route preference 255) include::static_routing/Readme.adoc[] +<<< + include::ospf_basic/Readme.adoc[] +<<< + include::ospf_unnumbered_interface/Readme.adoc[] +<<< + include::ospf_multiarea/Readme.adoc[] +<<< + include::ospf_bfd/Readme.adoc[] +<<< + include::ospf_default_route_advertise/Readme.adoc[] +<<< + include::route_pref_ospf/Readme.adoc[] +<<< + include::route_pref_dhcp/Readme.adoc[] +<<< + include::route_pref_255/Readme.adoc[] diff --git a/test/case/ietf_routing/all.yaml b/test/case/ietf_routing/all.yaml new file mode 100644 index 00000000..3c9c6e10 --- /dev/null +++ b/test/case/ietf_routing/all.yaml @@ -0,0 +1,27 @@ +--- +- name: Static routing + case: static_routing/test.py + +- name: OSPF Basic + case: ospf_basic/test.py + +- name: OSPF unnumbered interfaces + case: ospf_unnumbered_interface/test.py + +- name: OSPF with multiple areas + case: ospf_multiarea/test.py + +- name: OSPF BFD + case: ospf_bfd/test.py + +- name: "Route preference: OSPF vs Static" + case: route_pref_ospf/test.py + +- name: "Route preference: DHCP vs Static" + case: route_pref_dhcp/test.py + +- name: "Route preference: Static Route Activation and Maximum Distance" + case: route_pref_255/test.py + +- name: OSPF Default route advertise + case: ospf_default_route_advertise/test.py diff --git a/test/case/ietf_routing/ietf_routing.yaml b/test/case/ietf_routing/ietf_routing.yaml deleted file mode 100644 index 7a2fc28b..00000000 --- a/test/case/ietf_routing/ietf_routing.yaml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: static_routing - case: static_routing/test.py - -- name: ospf_basic - case: ospf_basic/test.py - -- name: ospf_unnumbered_interface - case: ospf_unnumbered_interface/test.py - -- name: ospf_multiarea - case: ospf_multiarea/test.py - -- name: ospf_bfd - case: ospf_bfd/test.py - -- name: route_pref_ospf - case: route_pref_ospf/test.py - -- name: route_pref_dhcp - case: route_pref_dhcp/test.py - -- name: route_pref_255 - case: route_pref_255/test.py - -- name: ospf_default_route_advertise - case: ospf_default_route_advertise/test.py diff --git a/test/case/ietf_routing/ospf_basic/Readme.adoc b/test/case/ietf_routing/ospf_basic/Readme.adoc index 2c6367ac..ae32c841 120000 --- a/test/case/ietf_routing/ospf_basic/Readme.adoc +++ b/test/case/ietf_routing/ospf_basic/Readme.adoc @@ -1 +1 @@ -ospf_basic.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_routing/ospf_basic/ospf_basic.adoc b/test/case/ietf_routing/ospf_basic/ospf_basic.adoc deleted file mode 100644 index d260f6df..00000000 --- a/test/case/ietf_routing/ospf_basic/ospf_basic.adoc +++ /dev/null @@ -1,26 +0,0 @@ -=== OSPF Basic -==== Description -Very basic OSPF test just test that OSPF sends HELLO packets between the DUTs -and that they exchange routes, ending with a simple connectivity check. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_routing/ospf_basic/topology.svg[OSPF Basic topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ospf_basic/topology.svg[OSPF Basic topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[OSPF Basic topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUTs -. Configure targets -. Wait for OSPF routes -. Test connectivity from PC:data to 192.168.200.1 - - -<<< - diff --git a/test/case/ietf_routing/ospf_basic/test.adoc b/test/case/ietf_routing/ospf_basic/test.adoc new file mode 100644 index 00000000..a9842a28 --- /dev/null +++ b/test/case/ietf_routing/ospf_basic/test.adoc @@ -0,0 +1,21 @@ +=== OSPF Basic + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_routing/ospf_basic] + +==== Description + +Very basic OSPF test just test that OSPF sends HELLO packets between the DUTs +and that they exchange routes, ending with a simple connectivity check. + +==== Topology + +image::topology.svg[OSPF Basic topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUTs +. Configure targets +. Wait for OSPF routes +. Test connectivity from PC:data to 192.168.200.1 + + diff --git a/test/case/ietf_routing/ospf_bfd/Readme.adoc b/test/case/ietf_routing/ospf_bfd/Readme.adoc index a6c7dd03..ae32c841 120000 --- a/test/case/ietf_routing/ospf_bfd/Readme.adoc +++ b/test/case/ietf_routing/ospf_bfd/Readme.adoc @@ -1 +1 @@ -ospf_bfd.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_routing/ospf_bfd/ospf_bfd.adoc b/test/case/ietf_routing/ospf_bfd/test.adoc similarity index 69% rename from test/case/ietf_routing/ospf_bfd/ospf_bfd.adoc rename to test/case/ietf_routing/ospf_bfd/test.adoc index 70809484..d55bae3b 100644 --- a/test/case/ietf_routing/ospf_bfd/ospf_bfd.adoc +++ b/test/case/ietf_routing/ospf_bfd/test.adoc @@ -1,5 +1,9 @@ === OSPF BFD + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_routing/ospf_bfd] + ==== Description + Verify that a router running OSPF, with Bidirectional Forwarding Detection (BFD) enabled, will detect link faults even when the physical layer is still operational. @@ -9,18 +13,11 @@ perspective, is made up of multiple physical links containing media converters without link fault forwarding. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_routing/ospf_bfd/topology.svg[OSPF BFD topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ospf_bfd/topology.svg[OSPF BFD topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[OSPF BFD topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[OSPF BFD topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUTs . Setup TPMR between R1fast and R2fast . Configure R1 and R2 @@ -31,5 +28,3 @@ endif::topdoc[] . Verify connectivity from PC:src to PC:dst via slow link -<<< - diff --git a/test/case/ietf_routing/ospf_default_route_advertise/Readme.adoc b/test/case/ietf_routing/ospf_default_route_advertise/Readme.adoc index 66314470..ae32c841 120000 --- a/test/case/ietf_routing/ospf_default_route_advertise/Readme.adoc +++ b/test/case/ietf_routing/ospf_default_route_advertise/Readme.adoc @@ -1 +1 @@ -ospf_default_route_advertise.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_routing/ospf_default_route_advertise/ospf_default_route_advertise.adoc b/test/case/ietf_routing/ospf_default_route_advertise/test.adoc similarity index 82% rename from test/case/ietf_routing/ospf_default_route_advertise/ospf_default_route_advertise.adoc rename to test/case/ietf_routing/ospf_default_route_advertise/test.adoc index 04df9f7b..4e92ae63 100644 --- a/test/case/ietf_routing/ospf_default_route_advertise/ospf_default_route_advertise.adoc +++ b/test/case/ietf_routing/ospf_default_route_advertise/test.adoc @@ -1,5 +1,9 @@ === OSPF Default route advertise + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_routing/ospf_default_route_advertise] + ==== Description + Verify _default-route-advertising_ in OSPF, sometimes called 'redistribute origin'. Verify both always (regardless if a local default route exist or not) and only redistribute when local default route exist. @@ -28,18 +32,11 @@ unless _always_ is set for _default-route-advertising_. .... ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_routing/ospf_default_route_advertise/topology.svg[OSPF Default route advertise topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ospf_default_route_advertise/topology.svg[OSPF Default route advertise topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[OSPF Default route advertise topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[OSPF Default route advertise topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUTs . Configure targets . Verify R2 has a default route and 192.168.100.1/32 from OSPF @@ -53,5 +50,3 @@ endif::topdoc[] . Verify connectivity from PC:data2 to 10.10.10.10 -<<< - diff --git a/test/case/ietf_routing/ospf_multiarea/Readme.adoc b/test/case/ietf_routing/ospf_multiarea/Readme.adoc index 417502b8..ae32c841 120000 --- a/test/case/ietf_routing/ospf_multiarea/Readme.adoc +++ b/test/case/ietf_routing/ospf_multiarea/Readme.adoc @@ -1 +1 @@ -ospf_multiarea.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_routing/ospf_multiarea/ospf_multiarea.adoc b/test/case/ietf_routing/ospf_multiarea/test.adoc similarity index 80% rename from test/case/ietf_routing/ospf_multiarea/ospf_multiarea.adoc rename to test/case/ietf_routing/ospf_multiarea/test.adoc index bc68de2c..e1ed2945 100644 --- a/test/case/ietf_routing/ospf_multiarea/ospf_multiarea.adoc +++ b/test/case/ietf_routing/ospf_multiarea/test.adoc @@ -1,5 +1,9 @@ === OSPF with multiple areas + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_routing/ospf_multiarea] + ==== Description + 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). @@ -23,18 +27,11 @@ explicit router-id. .... ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_routing/ospf_multiarea/topology.svg[OSPF with multiple areas topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ospf_multiarea/topology.svg[OSPF with multiple areas topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[OSPF with multiple areas topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[OSPF with multiple areas topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUTs . Configure targets . Wait for all neighbors to peer @@ -49,5 +46,3 @@ endif::topdoc[] . Verify that the route to 10.0.0.3 from PC:data4, go through 10.0.24.1 -<<< - diff --git a/test/case/ietf_routing/ospf_unnumbered_interface/Readme.adoc b/test/case/ietf_routing/ospf_unnumbered_interface/Readme.adoc index ef814f1d..ae32c841 120000 --- a/test/case/ietf_routing/ospf_unnumbered_interface/Readme.adoc +++ b/test/case/ietf_routing/ospf_unnumbered_interface/Readme.adoc @@ -1 +1 @@ -ospf_unnumbered_interface.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_routing/ospf_unnumbered_interface/ospf_unnumbered_interface.adoc b/test/case/ietf_routing/ospf_unnumbered_interface/test.adoc similarity index 58% rename from test/case/ietf_routing/ospf_unnumbered_interface/ospf_unnumbered_interface.adoc rename to test/case/ietf_routing/ospf_unnumbered_interface/test.adoc index 8c2ecd31..26b0f7cd 100644 --- a/test/case/ietf_routing/ospf_unnumbered_interface/ospf_unnumbered_interface.adoc +++ b/test/case/ietf_routing/ospf_unnumbered_interface/test.adoc @@ -1,5 +1,9 @@ === OSPF unnumbered interfaces + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_routing/ospf_unnumbered_interface] + ==== Description + This test that a configuration expecting unnumbered interfaces get that also in OSPF. Also verify that passive interface in the configuration gets activated in OSPF. @@ -8,18 +12,11 @@ When this test pass, you can expect unnumbered interfaces, interface type configuration and passive to function ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_routing/ospf_unnumbered_interface/topology.svg[OSPF unnumbered interfaces topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ospf_unnumbered_interface/topology.svg[OSPF unnumbered interfaces topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[OSPF unnumbered interfaces topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[OSPF unnumbered interfaces topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUTs . Configure targets . Wait for OSPF routes @@ -28,5 +25,3 @@ endif::topdoc[] . Test connectivity from PC:data to 192.168.200.1 -<<< - diff --git a/test/case/ietf_routing/route_pref_255/Readme.adoc b/test/case/ietf_routing/route_pref_255/Readme.adoc index d9c6d3c2..ae32c841 120000 --- a/test/case/ietf_routing/route_pref_255/Readme.adoc +++ b/test/case/ietf_routing/route_pref_255/Readme.adoc @@ -1 +1 @@ -route_pref_255.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_routing/route_pref_255/route_pref_255.adoc b/test/case/ietf_routing/route_pref_255/test.adoc similarity index 60% rename from test/case/ietf_routing/route_pref_255/route_pref_255.adoc rename to test/case/ietf_routing/route_pref_255/test.adoc index a5875051..076e3678 100644 --- a/test/case/ietf_routing/route_pref_255/route_pref_255.adoc +++ b/test/case/ietf_routing/route_pref_255/test.adoc @@ -1,23 +1,20 @@ === Route preference: Static Route Activation and Maximum Distance + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_routing/route_pref_255] + ==== Description + This test configures a device with a static route to a destination with a moderate routing preference (254), verifying that it becomes active. Then, the routing preference is increased to the maximum value (255), which should prevent the route from becoming active. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_routing/route_pref_255/topology.svg[Route preference: Static Route Activation and Maximum Distance topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::route_pref_255/topology.svg[Route preference: Static Route Activation and Maximum Distance topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Route preference: Static Route Activation and Maximum Distance topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Route preference: Static Route Activation and Maximum Distance topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUTs . Configure targets with active static route . Verify that static route with preference 254 is active @@ -25,5 +22,3 @@ endif::topdoc[] . Verify that high-preference static route (255) does not become active -<<< - diff --git a/test/case/ietf_routing/route_pref_dhcp/Readme.adoc b/test/case/ietf_routing/route_pref_dhcp/Readme.adoc index 80ec01bb..ae32c841 120000 --- a/test/case/ietf_routing/route_pref_dhcp/Readme.adoc +++ b/test/case/ietf_routing/route_pref_dhcp/Readme.adoc @@ -1 +1 @@ -route_pref_dhcp.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_routing/route_pref_dhcp/route_pref_dhcp.adoc b/test/case/ietf_routing/route_pref_dhcp/test.adoc similarity index 61% rename from test/case/ietf_routing/route_pref_dhcp/route_pref_dhcp.adoc rename to test/case/ietf_routing/route_pref_dhcp/test.adoc index 7f416eaf..20b3add8 100644 --- a/test/case/ietf_routing/route_pref_dhcp/route_pref_dhcp.adoc +++ b/test/case/ietf_routing/route_pref_dhcp/test.adoc @@ -1,5 +1,9 @@ === Route preference: DHCP vs Static + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_routing/route_pref_dhcp] + ==== Description + This test configures a device with both a DHCP-acquired route on a dedicated interface and a static route to the same destination on another interface. @@ -9,18 +13,11 @@ route takes precedence by adjusting the routing preference value to the one lower than DHCP. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_routing/route_pref_dhcp/topology.svg[Route preference: DHCP vs Static topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::route_pref_dhcp/topology.svg[Route preference: DHCP vs Static topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Route preference: DHCP vs Static topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Route preference: DHCP vs Static topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUTs . Configure targets. Assign higher priority to the dhcp route . Wait for DHCP and static routes @@ -29,5 +26,3 @@ endif::topdoc[] . Verify connectivity from PC:data12 to R2:lo via static route -<<< - diff --git a/test/case/ietf_routing/route_pref_ospf/Readme.adoc b/test/case/ietf_routing/route_pref_ospf/Readme.adoc index 65bc4ceb..ae32c841 120000 --- a/test/case/ietf_routing/route_pref_ospf/Readme.adoc +++ b/test/case/ietf_routing/route_pref_ospf/Readme.adoc @@ -1 +1 @@ -route_pref_ospf.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_routing/route_pref_ospf/route_pref_ospf.adoc b/test/case/ietf_routing/route_pref_ospf/test.adoc similarity index 64% rename from test/case/ietf_routing/route_pref_ospf/route_pref_ospf.adoc rename to test/case/ietf_routing/route_pref_ospf/test.adoc index 3e7c7ad7..78cb7ccf 100644 --- a/test/case/ietf_routing/route_pref_ospf/route_pref_ospf.adoc +++ b/test/case/ietf_routing/route_pref_ospf/test.adoc @@ -1,5 +1,9 @@ === Route preference: OSPF vs Static + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_routing/route_pref_ospf] + ==== Description + This test configures a device with both an OSPF-acquired route on a dedicated interface and a static route to the same destination on another interface. The static route has a higher preference value than @@ -9,18 +13,11 @@ Initially, the device should prefer the OSPF route; if the OSPF route becomes unavailable, the static route should take over. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_routing/route_pref_ospf/topology.svg[Route preference: OSPF vs Static topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::route_pref_ospf/topology.svg[Route preference: OSPF vs Static topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Route preference: OSPF vs Static topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Route preference: OSPF vs Static topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUTs . Set up TPMR between R1ospf and R2ospf . Configure targets @@ -31,5 +28,3 @@ endif::topdoc[] . Verify connectivity via static route after OSPF failover -<<< - diff --git a/test/case/ietf_routing/static_routing/Readme.adoc b/test/case/ietf_routing/static_routing/Readme.adoc index 0e8f8830..ae32c841 120000 --- a/test/case/ietf_routing/static_routing/Readme.adoc +++ b/test/case/ietf_routing/static_routing/Readme.adoc @@ -1 +1 @@ -static_routing.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_routing/static_routing/static_routing.adoc b/test/case/ietf_routing/static_routing/test.adoc similarity index 59% rename from test/case/ietf_routing/static_routing/static_routing.adoc rename to test/case/ietf_routing/static_routing/test.adoc index 26b047a8..c3f83258 100644 --- a/test/case/ietf_routing/static_routing/static_routing.adoc +++ b/test/case/ietf_routing/static_routing/test.adoc @@ -1,21 +1,18 @@ === Static routing + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_routing/static_routing] + ==== Description + Verify that it is possible to add static routes, both IPv4 and IPv6, and that data forwarding works as expected via an intermediate device. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_routing/static_routing/topology.svg[Static routing topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::static_routing/topology.svg[Static routing topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Static routing topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Static routing topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUTs . Configure targets . Wait for routes @@ -26,5 +23,3 @@ endif::topdoc[] . Verify R2 is no longer reachable on either IPv4 or IPv6 from PC:data -<<< - diff --git a/test/case/ietf_syslog/Readme.adoc b/test/case/ietf_syslog/Readme.adoc index 03d35e42..f867424b 100644 --- a/test/case/ietf_syslog/Readme.adoc +++ b/test/case/ietf_syslog/Readme.adoc @@ -1,8 +1,13 @@ :testgroup: == ietf-syslog -<<< +Tests verifying IETF standard syslog configuration and operation: + + - Basic local syslog functionality and log generation + - Remote syslog forwarding and network logging include::basic/Readme.adoc[] +<<< + include::remote/Readme.adoc[] diff --git a/test/case/ietf_syslog/ietf_syslog.yaml b/test/case/ietf_syslog/all.yaml similarity index 52% rename from test/case/ietf_syslog/ietf_syslog.yaml rename to test/case/ietf_syslog/all.yaml index 166199ca..87a495a1 100644 --- a/test/case/ietf_syslog/ietf_syslog.yaml +++ b/test/case/ietf_syslog/all.yaml @@ -1,6 +1,6 @@ --- -- name: basic +- name: Syslog Basic case: basic/test.py - -- name: remote + +- name: Remote syslog case: remote/test.py diff --git a/test/case/ietf_syslog/basic/Readme.adoc b/test/case/ietf_syslog/basic/Readme.adoc index 885dcc59..ae32c841 120000 --- a/test/case/ietf_syslog/basic/Readme.adoc +++ b/test/case/ietf_syslog/basic/Readme.adoc @@ -1 +1 @@ -basic.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_syslog/basic/basic.adoc b/test/case/ietf_syslog/basic/test.adoc similarity index 50% rename from test/case/ietf_syslog/basic/basic.adoc rename to test/case/ietf_syslog/basic/test.adoc index d57e4067..c02d26e8 100644 --- a/test/case/ietf_syslog/basic/basic.adoc +++ b/test/case/ietf_syslog/basic/test.adoc @@ -1,24 +1,19 @@ === Syslog Basic + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_syslog/basic] + ==== Description + Add syslog actions to log to local files, then verify new log files have been created. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_syslog/basic/topology.svg[Syslog Basic topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::basic/topology.svg[Syslog Basic topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Syslog Basic topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Syslog Basic topology, align=center, scaledwidth=75%] + +==== Sequence + . 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 -<<< - diff --git a/test/case/ietf_syslog/remote/Readme.adoc b/test/case/ietf_syslog/remote/Readme.adoc index 4c41fe25..ae32c841 120000 --- a/test/case/ietf_syslog/remote/Readme.adoc +++ b/test/case/ietf_syslog/remote/Readme.adoc @@ -1 +1 @@ -remote.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_syslog/remote/remote.adoc b/test/case/ietf_syslog/remote/test.adoc similarity index 54% rename from test/case/ietf_syslog/remote/remote.adoc rename to test/case/ietf_syslog/remote/test.adoc index 9a21eb79..c7b7069b 100644 --- a/test/case/ietf_syslog/remote/remote.adoc +++ b/test/case/ietf_syslog/remote/test.adoc @@ -1,25 +1,20 @@ === Remote syslog + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_syslog/remote] + ==== Description + Verify logging to remote, acting as a remote, and RFC5424 log format. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_syslog/remote/topology.svg[Remote syslog topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::remote/topology.svg[Remote syslog topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Remote syslog topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Remote syslog topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to client and server DUTs . Configure client DUT as syslog client with server DUT as remote, and configure server DUT as syslog server . Send security:notice log message from client . Verify reception of client log message, incl. sorting to /log/security on server -<<< - diff --git a/test/case/ietf_syslog/remote/topology.dot b/test/case/ietf_syslog/remote/topology.dot index 3ba42e6a..f1be10c2 100644 --- a/test/case/ietf_syslog/remote/topology.dot +++ b/test/case/ietf_syslog/remote/topology.dot @@ -1,7 +1,7 @@ graph "2x2" { layout="neato"; overlap="false"; - esep="+60"; + esep="+80"; node [shape=record, fontname="DejaVu Sans Mono, Book"]; edge [color="cornflowerblue", penwidth="2", fontname="DejaVu Serif, Book"]; diff --git a/test/case/ietf_syslog/remote/topology.svg b/test/case/ietf_syslog/remote/topology.svg index b07f7f68..3405b44e 100644 --- a/test/case/ietf_syslog/remote/topology.svg +++ b/test/case/ietf_syslog/remote/topology.svg @@ -3,57 +3,57 @@ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> - - + + 2x2 - + host - -host - -mgmt1 - -mgmt2 + +host + +mgmt1 + +mgmt2 client - -mgmt - -link - -client + +mgmt + +link + +client host:mgmt1--client:mgmt - + server - -link - -mgmt - -server + +link + +mgmt + +server host:mgmt2--server:mgmt - + client:link--server:link - -10.0.0.1/24 -10.0.0.2/24 + +10.0.0.1/24 +10.0.0.2/24 diff --git a/test/case/ietf_system/Readme.adoc b/test/case/ietf_system/Readme.adoc index 61f368d3..e0371c95 100644 --- a/test/case/ietf_system/Readme.adoc +++ b/test/case/ietf_system/Readme.adoc @@ -1,18 +1,38 @@ :testgroup: == ietf-system -<<< +Tests verifying IETF standard system configuration and management: + + - System hostname configuration and persistence + - User account creation, modification, and deletion + - Administrative user privilege management + - System timezone configuration and handling + - UTC offset timezone configuration + - System upgrade and firmware management + - NTP client configuration and time synchronization include::hostname/Readme.adoc[] +<<< + include::add_delete_user/Readme.adoc[] +<<< + include::user_admin/Readme.adoc[] +<<< + include::timezone/Readme.adoc[] +<<< + include::timezone_utc_offset/Readme.adoc[] +<<< + include::upgrade/Readme.adoc[] +<<< + include::ntp_client/Readme.adoc[] diff --git a/test/case/ietf_system/add_delete_user/Readme.adoc b/test/case/ietf_system/add_delete_user/Readme.adoc index 385fa57d..ae32c841 120000 --- a/test/case/ietf_system/add_delete_user/Readme.adoc +++ b/test/case/ietf_system/add_delete_user/Readme.adoc @@ -1 +1 @@ -add_delete_user.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_system/add_delete_user/add_delete_user.adoc b/test/case/ietf_system/add_delete_user/test.adoc similarity index 55% rename from test/case/ietf_system/add_delete_user/add_delete_user.adoc rename to test/case/ietf_system/add_delete_user/test.adoc index 55378b00..0d63e98f 100644 --- a/test/case/ietf_system/add_delete_user/add_delete_user.adoc +++ b/test/case/ietf_system/add_delete_user/test.adoc @@ -1,21 +1,18 @@ === Add/delete user + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_system/add_delete_user] + ==== Description + Verify that it is possible to add/delete a user. The user password is hashed with yescrypt. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_system/add_delete_user/topology.svg[Add/delete user topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::add_delete_user/topology.svg[Add/delete user topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Add/delete user topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Add/delete user topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Add new user 'newuser01' with password 'newuser01password' . Verify user 'newuser01' exist in operational @@ -25,5 +22,3 @@ endif::topdoc[] . Verify that 'newuser01' is removed from /etc/passwd -<<< - diff --git a/test/case/ietf_system/ietf_system.yaml b/test/case/ietf_system/all.yaml similarity index 50% rename from test/case/ietf_system/ietf_system.yaml rename to test/case/ietf_system/all.yaml index 3c866bab..7dd876c8 100644 --- a/test/case/ietf_system/ietf_system.yaml +++ b/test/case/ietf_system/all.yaml @@ -1,21 +1,21 @@ --- -- name: hostname +- name: Set hostname case: hostname/test.py -- name: add_delete_user +- name: Add/delete user case: add_delete_user/test.py -- name: user_admin +- name: Add admin user case: user_admin/test.py -- name: timezone +- name: Set timezone using timezone name case: timezone/test.py -- name: timezone_utc_offset +- name: Set timezone with UTC offset case: timezone_utc_offset/test.py -- name: ntp_client +- name: Basic NTP client test case: ntp_client/test.py -- name: upgrade +- name: System upgrade case: upgrade/test.py diff --git a/test/case/ietf_system/hostname/Readme.adoc b/test/case/ietf_system/hostname/Readme.adoc index 8f64235d..ae32c841 120000 --- a/test/case/ietf_system/hostname/Readme.adoc +++ b/test/case/ietf_system/hostname/Readme.adoc @@ -1 +1 @@ -hostname.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_system/hostname/hostname.adoc b/test/case/ietf_system/hostname/hostname.adoc deleted file mode 100644 index 69b2e2c9..00000000 --- a/test/case/ietf_system/hostname/hostname.adoc +++ /dev/null @@ -1,33 +0,0 @@ -=== Set hostname -==== Description -Verify that it is possible to change hostname both normal -and using format %h-%m. - -The %h-%m format expands to -, -where MAC is the last three bytes of the base MAC address. - -e.g. ix-01-01-01. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_system/hostname/topology.svg[Set hostname topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::hostname/topology.svg[Set hostname topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Set hostname topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUT -. Set hostname to 'h0stn4m3' -. Verify new hostname 'h0stn4m3' -. Set hostname to '%h-%m' -. Verify hostname is %h-%m in running configuration -. Verify hostname format in operational - - -<<< - diff --git a/test/case/ietf_system/hostname/test.adoc b/test/case/ietf_system/hostname/test.adoc new file mode 100644 index 00000000..f0f28699 --- /dev/null +++ b/test/case/ietf_system/hostname/test.adoc @@ -0,0 +1,25 @@ +=== Set hostname + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_system/hostname] + +==== Description + +Verify that it is possible to set hostname using both regular text and +format specificers, like '%h-%m'. These format specifiers expand to +'-', where MAC is the last three bytes of the +base MAC address. E.g., ix-01-01-01. + +==== Topology + +image::topology.svg[Set hostname topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUT +. Set hostname to 'h0stn4m3' +. Verify new hostname 'h0stn4m3' +. Set hostname to '%h-%m' +. Verify hostname is %h-%m in running configuration +. Verify hostname format in operational + + diff --git a/test/case/ietf_system/hostname/test.py b/test/case/ietf_system/hostname/test.py index 74f9854b..e45226dd 100755 --- a/test/case/ietf_system/hostname/test.py +++ b/test/case/ietf_system/hostname/test.py @@ -1,14 +1,11 @@ #!/usr/bin/env python3 -""" -Set hostname +"""Set hostname -Verify that it is possible to change hostname both normal -and using format %h-%m. +Verify that it is possible to set hostname using both regular text and +format specificers, like '%h-%m'. These format specifiers expand to +'-', where MAC is the last three bytes of the +base MAC address. E.g., ix-01-01-01. -The %h-%m format expands to -, -where MAC is the last three bytes of the base MAC address. - -e.g. ix-01-01-01. """ import re import infamy diff --git a/test/case/ietf_system/ntp_client/Readme.adoc b/test/case/ietf_system/ntp_client/Readme.adoc index 0ef39de7..ae32c841 120000 --- a/test/case/ietf_system/ntp_client/Readme.adoc +++ b/test/case/ietf_system/ntp_client/Readme.adoc @@ -1 +1 @@ -ntp_client.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_system/ntp_client/ntp_client.adoc b/test/case/ietf_system/ntp_client/ntp_client.adoc deleted file mode 100644 index 4353a8d0..00000000 --- a/test/case/ietf_system/ntp_client/ntp_client.adoc +++ /dev/null @@ -1,25 +0,0 @@ -=== Basic NTP client test -==== Description -Verify NTP client with multiple servers, ensure one get selected. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_system/ntp_client/topology.svg[Basic NTP client test topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ntp_client/topology.svg[Basic NTP client test topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Basic NTP client test topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUT -. Configure NTP client on 'target' -. Verify one source is in 'selected' state on 'target' -. Verify three sources exist in NTP client on 'target' - - -<<< - diff --git a/test/case/ietf_system/ntp_client/test.adoc b/test/case/ietf_system/ntp_client/test.adoc new file mode 100644 index 00000000..1bb4c3ec --- /dev/null +++ b/test/case/ietf_system/ntp_client/test.adoc @@ -0,0 +1,20 @@ +=== Basic NTP client test + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_system/ntp_client] + +==== Description + +Verify NTP client with multiple servers, ensure one get selected. + +==== Topology + +image::topology.svg[Basic NTP client test topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUT +. Configure NTP client on 'target' +. Verify one source is in 'selected' state on 'target' +. Verify three sources exist in NTP client on 'target' + + diff --git a/test/case/ietf_system/timezone/Readme.adoc b/test/case/ietf_system/timezone/Readme.adoc index a27be4c4..ae32c841 120000 --- a/test/case/ietf_system/timezone/Readme.adoc +++ b/test/case/ietf_system/timezone/Readme.adoc @@ -1 +1 @@ -timezone.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_system/timezone/test.adoc b/test/case/ietf_system/timezone/test.adoc new file mode 100644 index 00000000..ecc5c692 --- /dev/null +++ b/test/case/ietf_system/timezone/test.adoc @@ -0,0 +1,19 @@ +=== Set timezone using timezone name + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_system/timezone] + +==== Description + +Verify that it is possible to set timezone using timezone names. + +==== Topology + +image::topology.svg[Set timezone using timezone name topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUT +. Set timezone to Australia/Perth +. Verify timezone is Australia/Perth + + diff --git a/test/case/ietf_system/timezone/timezone.adoc b/test/case/ietf_system/timezone/timezone.adoc deleted file mode 100644 index af76d503..00000000 --- a/test/case/ietf_system/timezone/timezone.adoc +++ /dev/null @@ -1,24 +0,0 @@ -=== Set timezone using timezone name -==== Description -Verify that it is possible to set timezone using timezone names. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_system/timezone/topology.svg[Set timezone using timezone name topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::timezone/topology.svg[Set timezone using timezone name topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Set timezone using timezone name topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUT -. Set timezone to Australia/Perth -. Verify timezone is Australia/Perth - - -<<< - diff --git a/test/case/ietf_system/timezone_utc_offset/Readme.adoc b/test/case/ietf_system/timezone_utc_offset/Readme.adoc index 23d00aaf..ae32c841 120000 --- a/test/case/ietf_system/timezone_utc_offset/Readme.adoc +++ b/test/case/ietf_system/timezone_utc_offset/Readme.adoc @@ -1 +1 @@ -timezone_utc_offset.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_system/timezone_utc_offset/test.adoc b/test/case/ietf_system/timezone_utc_offset/test.adoc new file mode 100644 index 00000000..f2048815 --- /dev/null +++ b/test/case/ietf_system/timezone_utc_offset/test.adoc @@ -0,0 +1,19 @@ +=== Set timezone with UTC offset + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_system/timezone_utc_offset] + +==== Description + +Verify that it is possible to set timezone using UTC offset + +==== Topology + +image::topology.svg[Set timezone with UTC offset topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUT +. Set timezone UTC offset to +12 +. Verify current timezone is UTC+12:00 + + diff --git a/test/case/ietf_system/timezone_utc_offset/timezone_utc_offset.adoc b/test/case/ietf_system/timezone_utc_offset/timezone_utc_offset.adoc deleted file mode 100644 index 8f2daefb..00000000 --- a/test/case/ietf_system/timezone_utc_offset/timezone_utc_offset.adoc +++ /dev/null @@ -1,24 +0,0 @@ -=== Set timezone with UTC offset -==== Description -Verify that it is possible to set timezone using UTC offset - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_system/timezone_utc_offset/topology.svg[Set timezone with UTC offset topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::timezone_utc_offset/topology.svg[Set timezone with UTC offset topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Set timezone with UTC offset topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUT -. Set timezone UTC offset to +12 -. Verify current timezone is UTC+12:00 - - -<<< - diff --git a/test/case/ietf_system/upgrade/Readme.adoc b/test/case/ietf_system/upgrade/Readme.adoc index d15b94f0..ae32c841 120000 --- a/test/case/ietf_system/upgrade/Readme.adoc +++ b/test/case/ietf_system/upgrade/Readme.adoc @@ -1 +1 @@ -upgrade.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_system/upgrade/test.adoc b/test/case/ietf_system/upgrade/test.adoc new file mode 100644 index 00000000..81ab81db --- /dev/null +++ b/test/case/ietf_system/upgrade/test.adoc @@ -0,0 +1,21 @@ +=== System upgrade + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_system/upgrade] + +==== Description + +Verify system upgrade functionality. + +==== Topology + +image::topology.svg[System upgrade topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUT +. Start installation of selected package +. Wait for upgrade to finish +. Verify boot order has changed and reboot +. Verify that the partition is the booted + + diff --git a/test/case/ietf_system/upgrade/test.py b/test/case/ietf_system/upgrade/test.py index e4cf8397..80931dcc 100755 --- a/test/case/ietf_system/upgrade/test.py +++ b/test/case/ietf_system/upgrade/test.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 """ -Upgrade +System upgrade -Verify it is possible to upgrade. +Verify system upgrade functionality. """ # NOTE: THIS TEST IS HARDCODED TO NETCONF # There is a bug somewhere in the restconf-code (infamy or rousette) diff --git a/test/case/ietf_system/upgrade/upgrade.adoc b/test/case/ietf_system/upgrade/upgrade.adoc deleted file mode 100644 index a94cba31..00000000 --- a/test/case/ietf_system/upgrade/upgrade.adoc +++ /dev/null @@ -1,26 +0,0 @@ -=== Upgrade -==== Description -Verify it is possible to upgrade. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_system/upgrade/topology.svg[Upgrade topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::upgrade/topology.svg[Upgrade topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Upgrade topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUT -. Start installation of selected package -. Wait for upgrade to finish -. Verify boot order has changed and reboot -. Verify that the partition is the booted - - -<<< - diff --git a/test/case/ietf_system/user_admin/Readme.adoc b/test/case/ietf_system/user_admin/Readme.adoc index aa61466b..ae32c841 120000 --- a/test/case/ietf_system/user_admin/Readme.adoc +++ b/test/case/ietf_system/user_admin/Readme.adoc @@ -1 +1 @@ -user_admin.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/ietf_system/user_admin/user_admin.adoc b/test/case/ietf_system/user_admin/test.adoc similarity index 64% rename from test/case/ietf_system/user_admin/user_admin.adoc rename to test/case/ietf_system/user_admin/test.adoc index 6b9d1387..148f2b2e 100644 --- a/test/case/ietf_system/user_admin/user_admin.adoc +++ b/test/case/ietf_system/user_admin/test.adoc @@ -1,21 +1,18 @@ === Add admin user + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/ietf_system/user_admin] + ==== Description + Test that a non-admin user is not an admin in Linux, and check that it when added as admin it is also the case in Linux. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/ietf_system/user_admin/topology.svg[Add admin user topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::user_admin/topology.svg[Add admin user topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Add admin user topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Add admin user topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Add new user 'jacky' with no NACM access . Verify regular user jacky exists @@ -29,5 +26,3 @@ endif::topdoc[] . Verify user jacky can log in with SSH -<<< - diff --git a/test/case/infix_containers/Readme.adoc b/test/case/infix_containers/Readme.adoc index fc4c21b3..726d2c1a 100644 --- a/test/case/infix_containers/Readme.adoc +++ b/test/case/infix_containers/Readme.adoc @@ -1,33 +1,47 @@ :testgroup: == infix-containers -Verifies Infix Docker container support: +Tests verifying Infix Docker container support: - Basic web server container running in host network mode - - Container enable/disable functionality via configuration + - Container enable/disable functionality via configuration - Container environment variable configuration and access - - Common setup with a docker0 bridge, automatic VETH pairs to container(s) - - Connecting a container with a VETH pair to a standard Linux bridge - - Assigning a physical Ethernet interface to a container - - Upgrading a container with a volume, verifying volume data is intact - - Basic firewall container running in host network mode and full privileges - -<<< + - Common setup with docker0 bridge and automatic VETH pairs + - Connecting containers with VETH pairs to standard Linux bridges + - Assigning physical Ethernet interfaces to containers + - Container upgrades with persistent volume data + - Firewall container running in host network mode with full privileges include::container_basic/Readme.adoc[] +<<< + include::container_enabled/Readme.adoc[] +<<< + include::container_environment/Readme.adoc[] +<<< + include::container_bridge/Readme.adoc[] +<<< + include::container_phys/Readme.adoc[] +<<< + include::container_veth/Readme.adoc[] +<<< + include::container_volume/Readme.adoc[] +<<< + include::container_firewall_basic/Readme.adoc[] +<<< + include::container_host_commands/Readme.adoc[] diff --git a/test/case/infix_containers/all.yaml b/test/case/infix_containers/all.yaml new file mode 100644 index 00000000..53ec2915 --- /dev/null +++ b/test/case/infix_containers/all.yaml @@ -0,0 +1,28 @@ +--- + +- name: Container basic + case: container_basic/test.py + +- name: Container enabled/disabled + case: container_enabled/test.py + +- name: Container environment variables + case: container_environment/test.py + +- name: Container with bridge network + case: container_bridge/test.py + +- name: Container with physical interface + case: container_phys/test.py + +- name: Container with VETH pair + case: container_veth/test.py + +- name: Container Volume Persistence + case: container_volume/test.py + +- name: Basic Firewall Container + case: container_firewall_basic/test.py + +- name: Host Command Execution from Container + case: container_host_commands/test.py diff --git a/test/case/infix_containers/container_basic/Readme.adoc b/test/case/infix_containers/container_basic/Readme.adoc index 895abdfa..ae32c841 120000 --- a/test/case/infix_containers/container_basic/Readme.adoc +++ b/test/case/infix_containers/container_basic/Readme.adoc @@ -1 +1 @@ -container_basic.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_containers/container_basic/container_basic.adoc b/test/case/infix_containers/container_basic/test.adoc similarity index 65% rename from test/case/infix_containers/container_basic/container_basic.adoc rename to test/case/infix_containers/container_basic/test.adoc index b1a032dd..8205adbb 100644 --- a/test/case/infix_containers/container_basic/container_basic.adoc +++ b/test/case/infix_containers/container_basic/test.adoc @@ -1,5 +1,9 @@ === Container basic + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_containers/container_basic] + ==== Description + Verify that a simple web server container can be configured to run with host networking, on port 80. Operation is verified using a simple GET request for index.html and checking for a key phrase. @@ -7,18 +11,11 @@ simple GET request for index.html and checking for a key phrase. The RPC actions: stop + start, and restart are also verified. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_containers/container_basic/topology.svg[Container basic topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::container_basic/topology.svg[Container basic topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Container basic topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Container basic topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Set hostname to 'container-host' . Create container 'web' from bundled OCI image @@ -30,5 +27,3 @@ endif::topdoc[] . Verify container 'web' is reachable on http://container-host.local:91 -<<< - diff --git a/test/case/infix_containers/container_bridge/Readme.adoc b/test/case/infix_containers/container_bridge/Readme.adoc index eccc28dc..ae32c841 120000 --- a/test/case/infix_containers/container_bridge/Readme.adoc +++ b/test/case/infix_containers/container_bridge/Readme.adoc @@ -1 +1 @@ -container_bridge.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_containers/container_bridge/container_bridge.adoc b/test/case/infix_containers/container_bridge/test.adoc similarity index 58% rename from test/case/infix_containers/container_bridge/container_bridge.adoc rename to test/case/infix_containers/container_bridge/test.adoc index 9c86bf06..faf9160f 100644 --- a/test/case/infix_containers/container_bridge/container_bridge.adoc +++ b/test/case/infix_containers/container_bridge/test.adoc @@ -1,5 +1,9 @@ === Container with bridge network + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_containers/container_bridge] + ==== Description + Verify connectivity with a simple web server container from behind a docker0 bridge. As an added twist, this test also verifies content mounts, i.e., custom index.html from running-config. @@ -8,18 +12,11 @@ This also verifies port forwarding from container internal port to a port accessed from the host. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_containers/container_bridge/topology.svg[Container with bridge network topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::container_bridge/topology.svg[Container with bridge network topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Container with bridge network topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Container with bridge network topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Create httpd container from bundled OCI image . Verify container has started @@ -27,5 +24,3 @@ endif::topdoc[] . Verify container is reachable on http://10.0.0.2:8080 -<<< - diff --git a/test/case/infix_containers/container_enabled/Readme.adoc b/test/case/infix_containers/container_enabled/Readme.adoc index 867ff7a3..ae32c841 120000 --- a/test/case/infix_containers/container_enabled/Readme.adoc +++ b/test/case/infix_containers/container_enabled/Readme.adoc @@ -1 +1 @@ -container_enabled.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_containers/container_enabled/container_enabled.adoc b/test/case/infix_containers/container_enabled/test.adoc similarity index 60% rename from test/case/infix_containers/container_enabled/container_enabled.adoc rename to test/case/infix_containers/container_enabled/test.adoc index 69b698fa..047b08c8 100644 --- a/test/case/infix_containers/container_enabled/container_enabled.adoc +++ b/test/case/infix_containers/container_enabled/test.adoc @@ -1,5 +1,9 @@ === Container enabled/disabled + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_containers/container_enabled] + ==== Description + Verify that a container can be enabled and disabled via configuration. Tests the 'enabled' leaf functionality by: @@ -10,28 +14,18 @@ Tests the 'enabled' leaf functionality by: Uses operational datastore to verify container running status. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_containers/container_enabled/topology.svg[Container enabled/disabled topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::container_enabled/topology.svg[Container enabled/disabled topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Container enabled/disabled topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Container enabled/disabled topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Set hostname to 'container-host' . Create enabled container from bundled OCI image . Verify container has started -. Let container settle . Disable container . Verify container has stopped . Re-enable container . Verify container has started again -<<< - diff --git a/test/case/infix_containers/container_environment/Readme.adoc b/test/case/infix_containers/container_environment/Readme.adoc index acda1027..ae32c841 120000 --- a/test/case/infix_containers/container_environment/Readme.adoc +++ b/test/case/infix_containers/container_environment/Readme.adoc @@ -1 +1 @@ -container_environment.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_containers/container_environment/container_environment.adoc b/test/case/infix_containers/container_environment/container_environment.adoc deleted file mode 100644 index d7050ef4..00000000 --- a/test/case/infix_containers/container_environment/container_environment.adoc +++ /dev/null @@ -1,36 +0,0 @@ -=== Container environment variables -==== Description -Verify that environment variables can be set in container configuration -and are available inside the running container. Tests the 'env' list -functionality by: - -1. Creating a container with multiple environment variables -2. Using a custom script to extract env vars and serve them via HTTP -3. Fetching the served content to verify environment variables are set correctly - -Uses the nftables container image with custom rc.local script. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_containers/container_environment/topology.svg[Container environment variables topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::container_environment/topology.svg[Container environment variables topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Container environment variables topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUT -. Configure data interface with static IPv4 -. Create container with environment variables -. Verify container has started -. Verify environment variables are available via HTTP -. Verify basic connectivity to data interface -. Verify environment variables in HTTP response - - -<<< - diff --git a/test/case/infix_containers/container_environment/test.adoc b/test/case/infix_containers/container_environment/test.adoc new file mode 100644 index 00000000..5e67da5a --- /dev/null +++ b/test/case/infix_containers/container_environment/test.adoc @@ -0,0 +1,27 @@ +=== Container environment variables + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_containers/container_environment] + +==== Description + +Verify that environment variables can be set in container configuration +and are available inside the running container. + +1 Set up a container config with multiple environment variables +2. Serve variables back to host using a CGI script in container +3. Verify served content against environment variables + +==== Topology + +image::topology.svg[Container environment variables topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUT +. Configure data interface with static IPv4 +. Set up container with environment variables +. Verify container has started +. Verify basic connectivity to data interface +. Verify environment variables in CGI response + + diff --git a/test/case/infix_containers/container_environment/test.py b/test/case/infix_containers/container_environment/test.py index f571fcfb..eb2d5189 100755 --- a/test/case/infix_containers/container_environment/test.py +++ b/test/case/infix_containers/container_environment/test.py @@ -3,27 +3,32 @@ Container environment variables Verify that environment variables can be set in container configuration -and are available inside the running container. Tests the 'env' list -functionality by: +and are available inside the running container. -1. Creating a container with multiple environment variables -2. Using a custom script to extract env vars and serve them via HTTP -3. Fetching the served content to verify environment variables are set correctly - -Uses the nftables container image with custom rc.local script. +1 Set up a container config with multiple environment variables +2. Serve variables back to host using a CGI script in container +3. Verify served content against environment variables """ import infamy from infamy.util import until, to_binary with infamy.Test() as test: + ENV_VARS = [ + {"key": "TEST_VAR", "value": "hello-world"}, + {"key": "APP_PORT", "value": "8080"}, + {"key": "DEBUG_MODE", "value": "true"}, + {"key": "PATH_WITH_SPACES", "value": "/path with spaces/test"} + ] NAME = "web-env" DUTIP = "10.0.0.2" OURIP = "10.0.0.1" + url = infamy.Furl(f"http://{DUTIP}:8080/cgi-bin/env.cgi") with test.step("Set up topology and attach to target DUT"): env = infamy.Env() target = env.attach("target", "mgmt") + _, hport = env.ltop.xlate("host", "data") if not target.has_model("infix-containers"): test.skip() @@ -44,44 +49,33 @@ with infamy.Test() as test: } }) - with test.step("Create container with environment variables"): - script = to_binary("""#!/bin/sh -# Create HTTP response with environment variables -printf "HTTP/1.1 200 OK\\r\\n" > /var/www/response.txt -printf "Content-Type: text/plain\\r\\n" >> /var/www/response.txt -printf "Connection: close\\r\\n\\r\\n" >> /var/www/response.txt + with test.step("Set up container with environment variables"): + cgi = [ + '#!/bin/sh', + '# CGI script to output environment variables', + 'echo "Content-Type: text/plain"', + 'echo ""' + ] -# Add environment variables using printf to control encoding -printf "TEST_VAR=\\"%s\\"\\n" "$TEST_VAR" >> /var/www/response.txt -printf "APP_PORT=%s\\n" "$APP_PORT" >> /var/www/response.txt -printf "DEBUG_MODE=\\"%s\\"\\n" "$DEBUG_MODE" >> /var/www/response.txt -printf "PATH_WITH_SPACES=\\"%s\\"\\n" "$PATH_WITH_SPACES" >> /var/www/response.txt - -while true; do - nc -l -p 8080 < /var/www/response.txt 2>>/var/www/debug.log || sleep 1 -done -""") + for var in ENV_VARS: + cgi.append(f'echo "{var["key"]}=${var["key"]}"') target.put_config_dict("infix-containers", { "containers": { "container": [ { "name": f"{NAME}", - "image": f"oci-archive:{infamy.Container.NFTABLES_IMAGE}", - "env": [ - {"key": "TEST_VAR", "value": "hello-world"}, - {"key": "APP_PORT", "value": "8080"}, - {"key": "DEBUG_MODE", "value": "true"}, - {"key": "PATH_WITH_SPACES", "value": "/path with spaces/test"} - ], + "image": f"oci-archive:{infamy.Container.HTTPD_IMAGE}", + "command": "/usr/sbin/httpd -f -v -p 8080", + "env": ENV_VARS, "network": { "host": True }, "mount": [ { - "name": "rc.local", - "content": script, - "target": "/etc/rc.local", + "name": "env.cgi", + "content": to_binary('\n'.join(cgi) + '\n'), + "target": "/var/www/cgi-bin/env.cgi", "mode": "0755" } ], @@ -98,20 +92,17 @@ done c = infamy.Container(target) until(lambda: c.running(NAME), attempts=60) - with test.step("Verify environment variables are available via HTTP"): - _, hport = env.ltop.xlate("host", "data") - url = infamy.Furl(f"http://{DUTIP}:8080/env.html") + with infamy.IsolatedMacVlan(hport) as ns: + ns.addip(OURIP) - with infamy.IsolatedMacVlan(hport) as ns: - ns.addip(OURIP) + with test.step("Verify basic connectivity to data interface"): + ns.must_reach(DUTIP) - with test.step("Verify basic connectivity to data interface"): - ns.must_reach(DUTIP) + with test.step("Verify environment variables in CGI response"): + expected_strings = [] + for var in ENV_VARS: + expected_strings.append(f'{var["key"]}={var["value"]}') - with test.step("Verify environment variables in HTTP response"): - until(lambda: url.nscheck(ns, "TEST_VAR=\"hello-world\""), attempts=10) - until(lambda: url.nscheck(ns, "APP_PORT=8080"), attempts=10) - until(lambda: url.nscheck(ns, "DEBUG_MODE=\"true\""), attempts=10) - until(lambda: url.nscheck(ns, "PATH_WITH_SPACES=\"/path with spaces/test\""), attempts=10) + until(lambda: url.nscheck(ns, expected_strings)) test.succeed() diff --git a/test/case/infix_containers/container_firewall_basic/Readme.adoc b/test/case/infix_containers/container_firewall_basic/Readme.adoc index d52fc4b5..ae32c841 120000 --- a/test/case/infix_containers/container_firewall_basic/Readme.adoc +++ b/test/case/infix_containers/container_firewall_basic/Readme.adoc @@ -1 +1 @@ -container_firewall_basic.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_containers/container_firewall_basic/container_firewall_basic.adoc b/test/case/infix_containers/container_firewall_basic/test.adoc similarity index 80% rename from test/case/infix_containers/container_firewall_basic/container_firewall_basic.adoc rename to test/case/infix_containers/container_firewall_basic/test.adoc index 075fba77..45d288ab 100644 --- a/test/case/infix_containers/container_firewall_basic/container_firewall_basic.adoc +++ b/test/case/infix_containers/container_firewall_basic/test.adoc @@ -1,5 +1,9 @@ === Basic Firewall Container + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_containers/container_firewall_basic] + ==== Description + Verify that an nftables container can be used for IP masquerading and port forwarding to another container running a basic web server. @@ -26,18 +30,11 @@ phrase, is only reachable from the public interface `ext0`, on 192.168.0.1:8080. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_containers/container_firewall_basic/topology.svg[Basic Firewall Container topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::container_firewall_basic/topology.svg[Basic Firewall Container topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Basic Firewall Container topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Basic Firewall Container topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Set hostname to 'container-host' . Create VETH pair for web server container @@ -50,5 +47,3 @@ endif::topdoc[] . Verify 'web' is reachable on http://container-host.local:8080 -<<< - diff --git a/test/case/infix_containers/container_host_commands/Readme.adoc b/test/case/infix_containers/container_host_commands/Readme.adoc index 8195248c..ae32c841 120000 --- a/test/case/infix_containers/container_host_commands/Readme.adoc +++ b/test/case/infix_containers/container_host_commands/Readme.adoc @@ -1 +1 @@ -container_host_commands.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_containers/container_host_commands/container_host_commands.adoc b/test/case/infix_containers/container_host_commands/test.adoc similarity index 58% rename from test/case/infix_containers/container_host_commands/container_host_commands.adoc rename to test/case/infix_containers/container_host_commands/test.adoc index 032fd214..d6f88d8a 100644 --- a/test/case/infix_containers/container_host_commands/container_host_commands.adoc +++ b/test/case/infix_containers/container_host_commands/test.adoc @@ -1,22 +1,19 @@ === Host Command Execution from Container + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_containers/container_host_commands] + ==== Description + This test verifies that a container running on Infix can execute commands that affect the host system. Specifically, it confirms that the container can change the hostname of the host. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_containers/container_host_commands/topology.svg[Host Command Execution from Container topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::container_host_commands/topology.svg[Host Command Execution from Container topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Host Command Execution from Container topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Host Command Execution from Container topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Set initial hostname . Verify initial hostname in operational @@ -25,5 +22,3 @@ endif::topdoc[] . Verify the new hostname set by the container -<<< - diff --git a/test/case/infix_containers/container_phys/Readme.adoc b/test/case/infix_containers/container_phys/Readme.adoc index f4db88d3..ae32c841 120000 --- a/test/case/infix_containers/container_phys/Readme.adoc +++ b/test/case/infix_containers/container_phys/Readme.adoc @@ -1 +1 @@ -container_phys.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_containers/container_phys/container_phys.adoc b/test/case/infix_containers/container_phys/test.adoc similarity index 54% rename from test/case/infix_containers/container_phys/container_phys.adoc rename to test/case/infix_containers/container_phys/test.adoc index eb02a4cb..977854bc 100644 --- a/test/case/infix_containers/container_phys/container_phys.adoc +++ b/test/case/infix_containers/container_phys/test.adoc @@ -1,21 +1,18 @@ === Container with physical interface + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_containers/container_phys] + ==== Description + Verify connectivity with a simple web server container that's been given a physical interface instead of an end of a VETH pair. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_containers/container_phys/topology.svg[Container with physical interface topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::container_phys/topology.svg[Container with physical interface topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Container with physical interface topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Container with physical interface topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Create httpd container from bundled OCI image . Verify container has started @@ -25,5 +22,3 @@ endif::topdoc[] . Verify server is restarted and returns new content -<<< - diff --git a/test/case/infix_containers/container_veth/Readme.adoc b/test/case/infix_containers/container_veth/Readme.adoc index 360cb99a..ae32c841 120000 --- a/test/case/infix_containers/container_veth/Readme.adoc +++ b/test/case/infix_containers/container_veth/Readme.adoc @@ -1 +1 @@ -container_veth.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_containers/container_veth/container_veth.adoc b/test/case/infix_containers/container_veth/test.adoc similarity index 68% rename from test/case/infix_containers/container_veth/container_veth.adoc rename to test/case/infix_containers/container_veth/test.adoc index 819c00d2..fa4edc70 100644 --- a/test/case/infix_containers/container_veth/container_veth.adoc +++ b/test/case/infix_containers/container_veth/test.adoc @@ -1,5 +1,9 @@ === Container with VETH pair + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_containers/container_veth] + ==== Description + Verify connectivity with a simple web server container from behind a regular bridge, a VETH pair connects the container to the bridge. @@ -14,18 +18,11 @@ regular bridge, a VETH pair connects the container to the bridge. .... ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_containers/container_veth/topology.svg[Container with VETH pair topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::container_veth/topology.svg[Container with VETH pair topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Container with VETH pair topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Container with VETH pair topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Create 'web-br0-veth' container from bundled OCI image . Verify container 'web-br0-veth' has started @@ -33,5 +30,3 @@ endif::topdoc[] . Verify container 'web-br0-veth' is reachable on http://10.0.0.2:91 -<<< - diff --git a/test/case/infix_containers/container_volume/Readme.adoc b/test/case/infix_containers/container_volume/Readme.adoc index 9beaf0a3..ae32c841 120000 --- a/test/case/infix_containers/container_volume/Readme.adoc +++ b/test/case/infix_containers/container_volume/Readme.adoc @@ -1 +1 @@ -container_volume.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_containers/container_volume/container_volume.adoc b/test/case/infix_containers/container_volume/test.adoc similarity index 55% rename from test/case/infix_containers/container_volume/container_volume.adoc rename to test/case/infix_containers/container_volume/test.adoc index 20fbfc05..e56587a7 100644 --- a/test/case/infix_containers/container_volume/container_volume.adoc +++ b/test/case/infix_containers/container_volume/test.adoc @@ -1,22 +1,19 @@ === Container Volume Persistence + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_containers/container_volume] + ==== Description + Verify that a container created from a local OCI archive, with a volume for persistent content, can be upgraded at runtime, without losing the content in the volume on restart. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_containers/container_volume/topology.svg[Container Volume Persistence topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::container_volume/topology.svg[Container Volume Persistence topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Container Volume Persistence topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[Container Volume Persistence topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Create container with volume from bundled OCI image . Verify container has started @@ -26,5 +23,3 @@ endif::topdoc[] . Verify container volume content survived upgrade -<<< - diff --git a/test/case/infix_containers/infix_containers.yaml b/test/case/infix_containers/infix_containers.yaml deleted file mode 100644 index 83d07fd7..00000000 --- a/test/case/infix_containers/infix_containers.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- - -- name: container_basic - case: container_basic/test.py - -- name: container_enabled - case: container_enabled/test.py - -# Disabled for v25.08, new/unstable -# - name: container_environment -# case: container_environment/test.py - -- name: container_bridge - case: container_bridge/test.py - -- name: container_phys - case: container_phys/test.py - -- name: container_veth - case: container_veth/test.py - -- name: container_volume - case: container_volume/test.py - -- name: container_firewall_basic - case: container_firewall_basic/test.py - -- name: container_host_commands - case: container_host_commands/test.py diff --git a/test/case/infix_dhcp/Readme.adoc b/test/case/infix_dhcp/Readme.adoc index e16f5503..2354144a 100644 --- a/test/case/infix_dhcp/Readme.adoc +++ b/test/case/infix_dhcp/Readme.adoc @@ -1,16 +1,33 @@ :testgroup: == infix-dhcp -<<< +Tests verifying DHCP client and server functionality in Infix: + + - Basic DHCP client lease acquisition and configuration + - DHCP client with default gateway assignment + - DHCP client with static route configuration + - Basic DHCP server operation and lease assignment + - DHCP server with host-specific IP reservations + - DHCP server with multiple subnet configurations include::client_basic/Readme.adoc[] +<<< + include::client_default_gw/Readme.adoc[] +<<< + include::client_routes/Readme.adoc[] +<<< + include::server_basic/Readme.adoc[] +<<< + include::server_host/Readme.adoc[] +<<< + include::server_subnets/Readme.adoc[] diff --git a/test/case/infix_dhcp/infix_dhcp.yaml b/test/case/infix_dhcp/all.yaml similarity index 52% rename from test/case/infix_dhcp/infix_dhcp.yaml rename to test/case/infix_dhcp/all.yaml index fcda0980..0ebf9f4a 100644 --- a/test/case/infix_dhcp/infix_dhcp.yaml +++ b/test/case/infix_dhcp/all.yaml @@ -1,6 +1,6 @@ --- -- name: dhcp_client +- name: DHCP Client Tests suite: dhcp_client.yaml -- name: dhcp_server +- name: DHCP Server Tests suite: dhcp_server.yaml diff --git a/test/case/infix_dhcp/client_basic/Readme.adoc b/test/case/infix_dhcp/client_basic/Readme.adoc index 85034254..ae32c841 120000 --- a/test/case/infix_dhcp/client_basic/Readme.adoc +++ b/test/case/infix_dhcp/client_basic/Readme.adoc @@ -1 +1 @@ -client_basic.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_dhcp/client_basic/client_basic.adoc b/test/case/infix_dhcp/client_basic/client_basic.adoc deleted file mode 100644 index 9ae2e12c..00000000 --- a/test/case/infix_dhcp/client_basic/client_basic.adoc +++ /dev/null @@ -1,25 +0,0 @@ -=== DHCP Basic -==== Description -This is a very basic DHCP test that requests an IPv4 lease -from a DHCP server and checks that the lease is set on the -interface. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_dhcp/client_basic/topology.svg[DHCP Basic topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::client_basic/topology.svg[DHCP Basic topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[DHCP Basic topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Initialize -. Verify client lease for 10.0.0.42 - - -<<< - diff --git a/test/case/infix_dhcp/client_basic/dhcp_basic.adoc b/test/case/infix_dhcp/client_basic/dhcp_basic.adoc deleted file mode 100644 index e4c203fe..00000000 --- a/test/case/infix_dhcp/client_basic/dhcp_basic.adoc +++ /dev/null @@ -1,25 +0,0 @@ -=== DHCP Basic -==== Description -This is a very basic DHCP test that requests an IPv4 lease -from a DHCP server and checks that the lease is set on the -interface. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_dhcp/dhcp_basic/topology.svg[DHCP Basic topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::dhcp_basic/topology.svg[DHCP Basic topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[DHCP Basic topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Initialize -. Verify client get DHCP lease for 10.0.0.42 on client:data - - -<<< - diff --git a/test/case/infix_dhcp/client_basic/test.adoc b/test/case/infix_dhcp/client_basic/test.adoc new file mode 100644 index 00000000..439c6ad6 --- /dev/null +++ b/test/case/infix_dhcp/client_basic/test.adoc @@ -0,0 +1,20 @@ +=== DHCP Basic + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_dhcp/client_basic] + +==== Description + +This is a very basic DHCP test that requests an IPv4 lease +from a DHCP server and checks that the lease is set on the +interface. + +==== Topology + +image::topology.svg[DHCP Basic topology, align=center, scaledwidth=75%] + +==== Sequence + +. Initialize +. Verify client lease for 10.0.0.42 + + diff --git a/test/case/infix_dhcp/client_default_gw/Readme.adoc b/test/case/infix_dhcp/client_default_gw/Readme.adoc index 227eac89..ae32c841 120000 --- a/test/case/infix_dhcp/client_default_gw/Readme.adoc +++ b/test/case/infix_dhcp/client_default_gw/Readme.adoc @@ -1 +1 @@ -client_default_gw.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_dhcp/client_default_gw/dhcp_router.adoc b/test/case/infix_dhcp/client_default_gw/dhcp_router.adoc deleted file mode 100644 index 719563f4..00000000 --- a/test/case/infix_dhcp/client_default_gw/dhcp_router.adoc +++ /dev/null @@ -1,24 +0,0 @@ -=== DHCP router -==== Description -Verify that the DHCP client receives default gateway (DHCP option 3, router) -and that route exists in operational datastore. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_dhcp/dhcp_router/topology.svg[DHCP router topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::dhcp_router/topology.svg[DHCP router topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[DHCP router topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Initialize -. Verify client to set up default route via 192.168.0.254 - - -<<< - diff --git a/test/case/infix_dhcp/client_default_gw/client_default_gw.adoc b/test/case/infix_dhcp/client_default_gw/test.adoc similarity index 51% rename from test/case/infix_dhcp/client_default_gw/client_default_gw.adoc rename to test/case/infix_dhcp/client_default_gw/test.adoc index 630f28e2..1174f16c 100644 --- a/test/case/infix_dhcp/client_default_gw/client_default_gw.adoc +++ b/test/case/infix_dhcp/client_default_gw/test.adoc @@ -1,27 +1,22 @@ -=== DHCP router +=== DHCP Router + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_dhcp/client_default_gw] + ==== Description + Verify that the DHCP client receives default gateway (DHCP option 3, router) and that route exists in operational datastore. The DHCP server runs at 192.168.0.1 but should hand out option 3 to clients with address 192.168.0.254. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_dhcp/client_default_gw/topology.svg[DHCP router topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::client_default_gw/topology.svg[DHCP router topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[DHCP router topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[DHCP Router topology, align=center, scaledwidth=75%] + +==== Sequence + . Initialize . Set up DHCP server as 192.168.0.1, option 3: 192.168.0.254 . Verify DHCP client has default route via 192.168.0.254 -<<< - diff --git a/test/case/infix_dhcp/client_routes/Readme.adoc b/test/case/infix_dhcp/client_routes/Readme.adoc index 519faece..ae32c841 120000 --- a/test/case/infix_dhcp/client_routes/Readme.adoc +++ b/test/case/infix_dhcp/client_routes/Readme.adoc @@ -1 +1 @@ -client_routes.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_dhcp/client_routes/dhcp_routes.adoc b/test/case/infix_dhcp/client_routes/dhcp_routes.adoc deleted file mode 100644 index 1ccf2b59..00000000 --- a/test/case/infix_dhcp/client_routes/dhcp_routes.adoc +++ /dev/null @@ -1,38 +0,0 @@ -=== DHCP option 121 vs option 3 -==== Description -Verify that DHCP option 121 (classless static routes) is used over the -older option 3 (default gateway) in the DHCP client, when both are sent -by the server, see RFC3442. Use the routing RIB in the operational -datastore to verify. - -Installing routes from a DHCP server should not affect already existing -(static) routes. To verify this, a static canary route (20.0.0.0/24 via -192.168.0.2) is installed before starting the DHCP client. As a twist, -this canary route has a next-hop (192.168.0.2) which is not reachable -until a DHCP lease has been acquired. - -The DHCP server is set up to hand out both a default router (option 3) -via 192.168.0.1 and a default route (option 121) via 192.168.0.254. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_dhcp/dhcp_routes/topology.svg[DHCP option 121 vs option 3 topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::dhcp_routes/topology.svg[DHCP option 121 vs option 3 topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[DHCP option 121 vs option 3 topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Setting up canary route, 20.0.0.0/24 via 192.168.0.2 -. Enabling DHCP client, allow option 3 and 121 -. Verify 'client' has a route 10.0.0.0/24 via 192.168.0.254 (option 121) -. Verify 'client' has default route via 192.168.0.254 (not use option 3) -. Verify 'client' still has canary route to 20.0.0.0/24 via 192.168.0.2 - - -<<< - diff --git a/test/case/infix_dhcp/client_routes/client_routes.adoc b/test/case/infix_dhcp/client_routes/test.adoc similarity index 72% rename from test/case/infix_dhcp/client_routes/client_routes.adoc rename to test/case/infix_dhcp/client_routes/test.adoc index 031ffbe7..a4f288e1 100644 --- a/test/case/infix_dhcp/client_routes/client_routes.adoc +++ b/test/case/infix_dhcp/client_routes/test.adoc @@ -1,5 +1,9 @@ === DHCP option 121 vs option 3 + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_dhcp/client_routes] + ==== Description + Verify that DHCP option 121 (classless static routes) is used over the older option 3 (default gateway) in the DHCP client, when both are sent by the server, see RFC3442. Use the routing RIB in the operational @@ -15,18 +19,11 @@ The DHCP server is set up to hand out both a default router (option 3) via 192.168.0.1 and a default route (option 121) via 192.168.0.254. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_dhcp/client_routes/topology.svg[DHCP option 121 vs option 3 topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::client_routes/topology.svg[DHCP option 121 vs option 3 topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[DHCP option 121 vs option 3 topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[DHCP option 121 vs option 3 topology, align=center, scaledwidth=75%] + +==== Sequence + . Setting up canary route, 20.0.0.0/24 via 192.168.0.2 . Enabling DHCP client, allow option 3 and 121 . Verify client has route 10.0.0.0/24 via 192.168.0.254 (option 121) @@ -34,5 +31,3 @@ endif::topdoc[] . Verify client still has canary route to 20.0.0.0/24 via 192.168.0.2 -<<< - diff --git a/test/case/infix_dhcp/dhcp_client.yaml b/test/case/infix_dhcp/dhcp_client.yaml index 76870a5a..d2244bad 100644 --- a/test/case/infix_dhcp/dhcp_client.yaml +++ b/test/case/infix_dhcp/dhcp_client.yaml @@ -1,9 +1,12 @@ --- -- name: client_basic +- settings: + test-spec: Readme.adoc + +- name: DHCP Basic case: client_basic/test.py -- name: client_default_gw +- name: DHCP Router case: client_default_gw/test.py -- name: client_routes +- name: DHCP option 121 vs option 3 case: client_routes/test.py diff --git a/test/case/infix_dhcp/dhcp_server.yaml b/test/case/infix_dhcp/dhcp_server.yaml index 5f87bf87..9a7812d6 100644 --- a/test/case/infix_dhcp/dhcp_server.yaml +++ b/test/case/infix_dhcp/dhcp_server.yaml @@ -1,9 +1,12 @@ --- -- name: server_basic +- settings: + test-spec: Readme.adoc + +- name: DHCP Server case: server_basic/test.py -- name: server_host +- name: DHCP Server Static Host case: server_host/test.py -- name: server_subnets +- name: DHCP Server Multiple Subnets case: server_subnets/test.py diff --git a/test/case/infix_dhcp/server_basic/Readme.adoc b/test/case/infix_dhcp/server_basic/Readme.adoc index 56baf679..ae32c841 120000 --- a/test/case/infix_dhcp/server_basic/Readme.adoc +++ b/test/case/infix_dhcp/server_basic/Readme.adoc @@ -1 +1 @@ -server_basic.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_dhcp/server_basic/dhcp_server.adoc b/test/case/infix_dhcp/server_basic/dhcp_server.adoc deleted file mode 100644 index 135e9766..00000000 --- a/test/case/infix_dhcp/server_basic/dhcp_server.adoc +++ /dev/null @@ -1,26 +0,0 @@ -=== DHCP Server -==== Description -Verify basic DHCP server functionality. - -==== Topology -ifdef::topdoc[] -image::../../test/case/infix_dhcp/dhcp_server/topology.svg[DHCP Server topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::dhcp_server/topology.svg[DHCP Server topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[DHCP Server topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to client and server DUTs -. Configure DHCP client and server DUTs -. Verify DHCP client original hostname -. Verify DHCP client lease -. Verify DHCP client new hostname - - -<<< - diff --git a/test/case/infix_dhcp/server_basic/server_basic.adoc b/test/case/infix_dhcp/server_basic/test.adoc similarity index 60% rename from test/case/infix_dhcp/server_basic/server_basic.adoc rename to test/case/infix_dhcp/server_basic/test.adoc index 4bfe1620..e4a82c7e 100644 --- a/test/case/infix_dhcp/server_basic/server_basic.adoc +++ b/test/case/infix_dhcp/server_basic/test.adoc @@ -1,5 +1,9 @@ -=== DHCP Server Basic +=== DHCP Server + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_dhcp/server_basic] + ==== Description + Verify basic DHCP server functionality. The server is set up to only hand out leases from a pool of a single address. A single DHCP option, hostname, is to be handed out with the lease to the client. Ensure no @@ -7,18 +11,11 @@ other options are sent by checking, e.g., that the client has not set up a default route to the server. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_dhcp/server_basic/topology.svg[DHCP Server Basic topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::server_basic/topology.svg[DHCP Server Basic topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[DHCP Server Basic topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[DHCP Server topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to client and server DUTs . Configure DHCP server and client . Verify DHCP client's original hostname @@ -27,5 +24,3 @@ endif::topdoc[] . Verify DHCP client has no default route -<<< - diff --git a/test/case/infix_dhcp/server_host/Readme.adoc b/test/case/infix_dhcp/server_host/Readme.adoc index 922c6354..ae32c841 120000 --- a/test/case/infix_dhcp/server_host/Readme.adoc +++ b/test/case/infix_dhcp/server_host/Readme.adoc @@ -1 +1 @@ -server_host.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_dhcp/server_host/server_host.adoc b/test/case/infix_dhcp/server_host/test.adoc similarity index 59% rename from test/case/infix_dhcp/server_host/server_host.adoc rename to test/case/infix_dhcp/server_host/test.adoc index b6adf5ea..f2f699f7 100644 --- a/test/case/infix_dhcp/server_host/server_host.adoc +++ b/test/case/infix_dhcp/server_host/test.adoc @@ -1,22 +1,19 @@ === DHCP Server Static Host + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_dhcp/server_host] + ==== Description + Verify DHCP server can hand out static host leases based on client-id, both hexadecimal and a very long string, ensuring no pool address is handed out instead. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_dhcp/server_host/topology.svg[DHCP Server Static Host topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::server_host/topology.svg[DHCP Server Static Host topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[DHCP Server Static Host topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[DHCP Server Static Host topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to client and server DUTs . Configure DHCP client and server DUTs . Verify DHCP client1 static lease @@ -27,5 +24,3 @@ endif::topdoc[] . Verify DHCP client2 has default gateway -<<< - diff --git a/test/case/infix_dhcp/server_subnets/Readme.adoc b/test/case/infix_dhcp/server_subnets/Readme.adoc index fdf35ad8..ae32c841 120000 --- a/test/case/infix_dhcp/server_subnets/Readme.adoc +++ b/test/case/infix_dhcp/server_subnets/Readme.adoc @@ -1 +1 @@ -server_subnets.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_dhcp/server_subnets/server_subnets.adoc b/test/case/infix_dhcp/server_subnets/test.adoc similarity index 64% rename from test/case/infix_dhcp/server_subnets/server_subnets.adoc rename to test/case/infix_dhcp/server_subnets/test.adoc index 99c1a865..b545553d 100644 --- a/test/case/infix_dhcp/server_subnets/server_subnets.adoc +++ b/test/case/infix_dhcp/server_subnets/test.adoc @@ -1,22 +1,16 @@ === DHCP Server Multiple Subnets + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_dhcp/server_subnets] + ==== Description + Verify that the DHCP server is capble of acting on more than one subnet, handing out leases from a pool and static host lease, ensuring global, subnet, and host-specific options are honored and do not leak between subnets. .Internal network setup, client2 and client3 are on the same LAN -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_dhcp/server_subnets/dhcp-subnets.svg[Internal networks] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::server_subnets/dhcp-subnets.svg[Internal networks] -endif::testgroup[] -ifndef::testgroup[] -image::dhcp-subnets.svg[Internal networks] -endif::testgroup[] -endif::topdoc[] +image::dhcp-subnets.svg[align=center, scaledwidth=75%] To verify isolation of subnet settings, a few "decoys" are added to the configuration of each subnet. These are then checked for on each of the @@ -30,18 +24,11 @@ The test is concluded by the server trying to reach each client using ping of the hostname. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_dhcp/server_subnets/topology.svg[DHCP Server Multiple Subnets topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::server_subnets/topology.svg[DHCP Server Multiple Subnets topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[DHCP Server Multiple Subnets topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[DHCP Server Multiple Subnets topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to client and server DUTs . Configure DHCP server and clients . Verify DHCP client1 get correct lease @@ -55,5 +42,3 @@ endif::topdoc[] . Verify DHCP client3 has correct DNS and NTP server(s) -<<< - diff --git a/test/case/infix_dhcp/server_subnets/test.py b/test/case/infix_dhcp/server_subnets/test.py index 7b342cad..d7b380e4 100755 --- a/test/case/infix_dhcp/server_subnets/test.py +++ b/test/case/infix_dhcp/server_subnets/test.py @@ -7,7 +7,7 @@ subnet, and host-specific options are honored and do not leak between subnets. .Internal network setup, client2 and client3 are on the same LAN -image::dhcp-subnets.svg[Internal networks] +image::dhcp-subnets.svg[align=center, scaledwidth=75%] To verify isolation of subnet settings, a few "decoys" are added to the configuration of each subnet. These are then checked for on each of the diff --git a/test/case/infix_services/Readme.adoc b/test/case/infix_services/Readme.adoc index 67c61268..7842e212 100644 --- a/test/case/infix_services/Readme.adoc +++ b/test/case/infix_services/Readme.adoc @@ -1,18 +1,38 @@ :testgroup: == infix-services -<<< +Tests verifying Infix network services configuration and operation: + + - mDNS (Multicast DNS) service enable/disable functionality + - mDNS interface allow/deny access control + - LLDP (Link Layer Discovery Protocol) service control + - LLDP per-interface administrative status configuration + - LLDP IEEE group address forwarding behavior + - SSH server configuration and access control + - SSH public key authentication mechanisms include::mdns/mdns_enable_disable/Readme.adoc[] +<<< + include::mdns/mdns_allow_deny/Readme.adoc[] +<<< + include::lldp/lldp_enable_disable/Readme.adoc[] +<<< + include::lldp/lldp_admin_status/Readme.adoc[] +<<< + include::lldp/lldp_ieee_group_forward/Readme.adoc[] +<<< + include::ssh/ssh_server_config/Readme.adoc[] +<<< + include::ssh/ssh_key_authentication/Readme.adoc[] diff --git a/test/case/infix_services/all.yaml b/test/case/infix_services/all.yaml new file mode 100644 index 00000000..eef4de21 --- /dev/null +++ b/test/case/infix_services/all.yaml @@ -0,0 +1,9 @@ +--- +- name: LLDP + suite: lldp/all.yaml + +- name: mDNS + suite: mdns/all.yaml + +- name: SSH + suite: ssh/all.yaml diff --git a/test/case/infix_services/infix_services.yaml b/test/case/infix_services/infix_services.yaml deleted file mode 100644 index 43ab99f5..00000000 --- a/test/case/infix_services/infix_services.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- name: lldp - suite: lldp/lldp.yaml - -- name: mdns - suite: mdns/mdns.yaml - -- name: ssh - suite: ssh/ssh.yaml diff --git a/test/case/infix_services/lldp/lldp.yaml b/test/case/infix_services/lldp/all.yaml similarity index 57% rename from test/case/infix_services/lldp/lldp.yaml rename to test/case/infix_services/lldp/all.yaml index af3ce73b..f934da26 100644 --- a/test/case/infix_services/lldp/lldp.yaml +++ b/test/case/infix_services/lldp/all.yaml @@ -1,9 +1,9 @@ --- -- name: lldp_enable_disable +- name: LLDP enable/disable case: lldp_enable_disable/test.py -- name: lldp_admin_status +- name: LLDP admin status case: lldp_admin_status/test.py -- name: lldp_ieee_group_forward +- name: LLDP IEEE Group Forward case: lldp_ieee_group_forward/test.py diff --git a/test/case/infix_services/lldp/lldp_admin_status/Readme.adoc b/test/case/infix_services/lldp/lldp_admin_status/Readme.adoc index 68ed7348..ae32c841 120000 --- a/test/case/infix_services/lldp/lldp_admin_status/Readme.adoc +++ b/test/case/infix_services/lldp/lldp_admin_status/Readme.adoc @@ -1 +1 @@ -lldp_admin_status.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_services/lldp/lldp_admin_status/lldp_admin_status.adoc b/test/case/infix_services/lldp/lldp_admin_status/lldp_admin_status.adoc deleted file mode 100644 index 24d351fe..00000000 --- a/test/case/infix_services/lldp/lldp_admin_status/lldp_admin_status.adoc +++ /dev/null @@ -1,27 +0,0 @@ -=== LLDP admin status -==== Description -Verify that LLDP admin status is set properly by lldpd - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_services/lldp/lldp_admin_status/topology.svg[LLDP admin status topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::lldp/lldp_admin_status/topology.svg[LLDP admin status topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[LLDP admin status topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUT -. Enable target interface and enable LLDP -. Verify admin-status: 'rx-only' -. Verify admin-status: 'tx-only' -. Verify admin-status: 'disabled' -. Verify admin-status: 'tx-and-rx' - - -<<< - diff --git a/test/case/infix_services/lldp/lldp_admin_status/test.adoc b/test/case/infix_services/lldp/lldp_admin_status/test.adoc new file mode 100644 index 00000000..68c0a76f --- /dev/null +++ b/test/case/infix_services/lldp/lldp_admin_status/test.adoc @@ -0,0 +1,22 @@ +=== LLDP admin status + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_services/lldp/lldp_admin_status] + +==== Description + +Verify that LLDP admin status is set properly by lldpd + +==== Topology + +image::topology.svg[LLDP admin status topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUT +. Enable target interface and enable LLDP +. Verify admin-status: 'rx-only' +. Verify admin-status: 'tx-only' +. Verify admin-status: 'disabled' +. Verify admin-status: 'tx-and-rx' + + diff --git a/test/case/infix_services/lldp/lldp_enable_disable/Readme.adoc b/test/case/infix_services/lldp/lldp_enable_disable/Readme.adoc index 218d38b9..ae32c841 120000 --- a/test/case/infix_services/lldp/lldp_enable_disable/Readme.adoc +++ b/test/case/infix_services/lldp/lldp_enable_disable/Readme.adoc @@ -1 +1 @@ -lldp_enable_disable.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_services/lldp/lldp_enable_disable/lldp_enable_disable.adoc b/test/case/infix_services/lldp/lldp_enable_disable/lldp_enable_disable.adoc deleted file mode 100644 index 1884dedc..00000000 --- a/test/case/infix_services/lldp/lldp_enable_disable/lldp_enable_disable.adoc +++ /dev/null @@ -1,28 +0,0 @@ -=== LLDP enable disable -==== Description -Verify that LLDP can be enabled and disabled. -Operation and non-operation are confirmed using tcpdump. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_services/lldp/lldp_enable_disable/topology.svg[LLDP enable disable topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::lldp/lldp_enable_disable/topology.svg[LLDP enable disable topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[LLDP enable disable topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUT -. Enable target interface and disable LLDP -. Enable LLDP -. Verify LLDP packets arrival on host:data -. Disable LLDP -. Verify no LLDP packets on host:data - - -<<< - diff --git a/test/case/infix_services/lldp/lldp_enable_disable/test.adoc b/test/case/infix_services/lldp/lldp_enable_disable/test.adoc new file mode 100644 index 00000000..7d547b20 --- /dev/null +++ b/test/case/infix_services/lldp/lldp_enable_disable/test.adoc @@ -0,0 +1,23 @@ +=== LLDP enable/disable + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_services/lldp/lldp_enable_disable] + +==== Description + +Verify that LLDP can be enabled and disabled. +Operation and non-operation are confirmed using tcpdump. + +==== Topology + +image::topology.svg[LLDP enable/disable topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUT +. Enable target interface and disable LLDP +. Enable LLDP +. Verify LLDP packets arrival on host:data +. Disable LLDP +. Verify no LLDP packets on host:data + + diff --git a/test/case/infix_services/lldp/lldp_enable_disable/test.py b/test/case/infix_services/lldp/lldp_enable_disable/test.py index 2a6f9345..ae849e97 100755 --- a/test/case/infix_services/lldp/lldp_enable_disable/test.py +++ b/test/case/infix_services/lldp/lldp_enable_disable/test.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 -"""LLDP enable disable +"""LLDP enable/disable -Verify that LLDP can be enabled and disabled. +Verify that LLDP can be enabled and disabled. Operation and non-operation are confirmed using tcpdump. """ diff --git a/test/case/infix_services/lldp/lldp_ieee_group_forward/Readme.adoc b/test/case/infix_services/lldp/lldp_ieee_group_forward/Readme.adoc index f718858e..ae32c841 120000 --- a/test/case/infix_services/lldp/lldp_ieee_group_forward/Readme.adoc +++ b/test/case/infix_services/lldp/lldp_ieee_group_forward/Readme.adoc @@ -1 +1 @@ -lldp_ieee_group_forward.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_services/lldp/lldp_ieee_group_forward/lldp_ieee_group_forward.adoc b/test/case/infix_services/lldp/lldp_ieee_group_forward/lldp_ieee_group_forward.adoc deleted file mode 100644 index 7d9df613..00000000 --- a/test/case/infix_services/lldp/lldp_ieee_group_forward/lldp_ieee_group_forward.adoc +++ /dev/null @@ -1,27 +0,0 @@ -=== LLDP IEEE Group Forward -==== Description -Verify that LLDP packets can be flooded to all ports on a bridge. -Operation and non-operation are confirmed using tcpdump. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_services/lldp/lldp_ieee_group_forward/topology.svg[LLDP IEEE Group Forward topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::lldp/lldp_ieee_group_forward/topology.svg[LLDP IEEE Group Forward topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[LLDP IEEE Group Forward topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUT -. Configure interfaces and disable LLDP daemon -. Verify LLDP absence on host:data2 -. Enable LLDP flooding by setting group forward -. Verify LLDP arrival on host:data2 - - -<<< - diff --git a/test/case/infix_services/lldp/lldp_ieee_group_forward/test.adoc b/test/case/infix_services/lldp/lldp_ieee_group_forward/test.adoc new file mode 100644 index 00000000..33e3585b --- /dev/null +++ b/test/case/infix_services/lldp/lldp_ieee_group_forward/test.adoc @@ -0,0 +1,22 @@ +=== LLDP IEEE Group Forward + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_services/lldp/lldp_ieee_group_forward] + +==== Description + +Verify that LLDP packets can be flooded to all ports on a bridge. +Operation and non-operation are confirmed using tcpdump. + +==== Topology + +image::topology.svg[LLDP IEEE Group Forward topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUT +. Configure interfaces and disable LLDP daemon +. Verify LLDP absence on host:data2 +. Enable LLDP flooding by setting group forward +. Verify LLDP arrival on host:data2 + + diff --git a/test/case/infix_services/mdns/all.yaml b/test/case/infix_services/mdns/all.yaml new file mode 100644 index 00000000..79c69f2c --- /dev/null +++ b/test/case/infix_services/mdns/all.yaml @@ -0,0 +1,6 @@ +--- +- name: mDNS enable/disable + case: mdns_enable_disable/test.py + +- name: mDNS allow/deny interfaces + case: mdns_allow_deny/test.py diff --git a/test/case/infix_services/mdns/mdns.yaml b/test/case/infix_services/mdns/mdns.yaml deleted file mode 100644 index 09c78546..00000000 --- a/test/case/infix_services/mdns/mdns.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: mdns_enable_disable - case: mdns_enable_disable/test.py - -# Disabled for v25.08, unstable -# - name: mdns_allow_deny -# case: mdns_allow_deny/test.py diff --git a/test/case/infix_services/mdns/mdns_allow_deny/Readme.adoc b/test/case/infix_services/mdns/mdns_allow_deny/Readme.adoc index fd21b3d9..ae32c841 120000 --- a/test/case/infix_services/mdns/mdns_allow_deny/Readme.adoc +++ b/test/case/infix_services/mdns/mdns_allow_deny/Readme.adoc @@ -1 +1 @@ -mdns_allow_deny.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_services/mdns/mdns_allow_deny/mdns_allow_deny.adoc b/test/case/infix_services/mdns/mdns_allow_deny/test.adoc similarity index 58% rename from test/case/infix_services/mdns/mdns_allow_deny/mdns_allow_deny.adoc rename to test/case/infix_services/mdns/mdns_allow_deny/test.adoc index 6fcb2732..6c63b8b2 100644 --- a/test/case/infix_services/mdns/mdns_allow_deny/mdns_allow_deny.adoc +++ b/test/case/infix_services/mdns/mdns_allow_deny/test.adoc @@ -1,5 +1,9 @@ === mDNS allow/deny interfaces + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_services/mdns/mdns_allow_deny] + ==== Description + Verify the mDNS responder interface allow/deny configuration. Both settings can be used independently and in concert. We verify operation with three scenarios: @@ -9,18 +13,11 @@ with three scenarios: 3. Allow p1 and p3, deny p2 and p3, traffic only on p1 ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_services/mdns/mdns_allow_deny/topology.svg[mDNS allow/deny interfaces topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::mdns/mdns_allow_deny/topology.svg[mDNS allow/deny interfaces topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[mDNS allow/deny interfaces topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[mDNS allow/deny interfaces topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUT . Configure device . Allow mDNS on a single interface: p2 @@ -28,5 +25,3 @@ endif::topdoc[] . Allow mDNS on p1, p3 deny on p2, p3 -<<< - diff --git a/test/case/infix_services/mdns/mdns_allow_deny/test.py b/test/case/infix_services/mdns/mdns_allow_deny/test.py index f53adbb6..8fa5707a 100755 --- a/test/case/infix_services/mdns/mdns_allow_deny/test.py +++ b/test/case/infix_services/mdns/mdns_allow_deny/test.py @@ -10,22 +10,55 @@ with three scenarios: 3. Allow p1 and p3, deny p2 and p3, traffic only on p1 """ - -import time +import re import infamy -from infamy.util import parallel -def mdns_scan(tgt): - """Trigger Avahi to send traffic on allowed interfaces""" - time.sleep(2) - tgt.runsh("logger -t scan 'calling avahi-browse ...'") - tgt.runsh("avahi-browse -lat") +def mdns_scan(): + """Start packet captures, trigger mDNS scan, return capture results""" + pcap1 = ns1.pcap("host 10.0.1.1 and port 5353") + pcap2 = ns2.pcap("host 10.0.2.1 and port 5353") + pcap3 = ns3.pcap("host 10.0.3.1 and port 5353") + + with pcap1, pcap2, pcap3: + ssh.runsh("logger -t scan 'calling avahi-browse ...'") + ssh.runsh("avahi-browse -lat") + + def has_packets(output): + if not output: + return False + lines = output.strip().split('\n') + m = re.search(r'^(\d+) packets.*', lines[1]) + if m and int(m.group(1)) > 0: + return True + return False + + out1 = pcap1.tcpdump("--count") + out2 = pcap2.tcpdump("--count") + out3 = pcap3.tcpdump("--count") + + return (has_packets(out1), has_packets(out2), has_packets(out3)) -def check(ns, expr, must): - """Wrap netns.must_receive() with common defaults""" - return ns.must_receive(expr, timeout=3, must=must) +def check(expected, allow=None, deny=None): + """Execute complete mDNS test scenario""" + try: + dut.delete_xpath("/infix-services:mdns/interfaces") + except ValueError: + # Ignore if xpath doesn't exist (first run) + pass + + mdns_config = {"mdns": {"interfaces": {}}} + if allow: + mdns_config["mdns"]["interfaces"]["allow"] = allow + if deny: + mdns_config["mdns"]["interfaces"]["deny"] = deny + + dut.put_config_dict("infix-services", mdns_config) + + actual = mdns_scan() + if actual != tuple(expected): + raise AssertionError(f"Expected {expected}, got {actual}") with infamy.Test() as test: @@ -45,58 +78,41 @@ with infamy.Test() as test: { "ietf-interfaces": { "interfaces": { - "interface": [ - { - "name": p1, - "enabled": True, - "ipv4": { - "address": [ - { - "ip": "10.0.1.1", - "prefix-length": 24 - } - ] - } - - }, - { - "name": p2, - "enabled": True, - "ipv4": { - "address": [ - { - "ip": "10.0.2.1", - "prefix-length": 24 - } - ] - } - - }, - { - "name": p3, - "enabled": True, - "ipv4": { - "address": [ - { - "ip": "10.0.3.1", - "prefix-length": 24 - } - ] - } - - }, - ] - } + "interface": [{ + "name": p1, + "enabled": True, + "ipv4": { + "address": [{ + "ip": "10.0.1.1", + "prefix-length": 24 + }] + } + }, { + "name": p2, + "enabled": True, + "ipv4": { + "address": [{ + "ip": "10.0.2.1", + "prefix-length": 24 + }] + } + }, { + "name": p3, + "enabled": True, + "ipv4": { + "address": [{ + "ip": "10.0.3.1", + "prefix-length": 24 + }] + } + }] + } }, "ietf-system": { - "system": { - "hostname": "dut" - } + "system": {"hostname": "dut"} }, "infix-services": { - "mdns": { - "enabled": True - } + "mdns": {"enabled": True} } } ) @@ -108,53 +124,16 @@ with infamy.Test() as test: ns2.addip("10.0.2.2") ns3.addip("10.0.3.2") - EXPR1 = "host 10.0.1.1 and port 5353" - EXPR2 = "host 10.0.2.1 and port 5353" - EXPR3 = "host 10.0.3.1 and port 5353" - with test.step("Allow mDNS on a single interface: p2"): - dut.put_config_dict("infix-services", { - "mdns": { - "interfaces": { - "allow": [p2], - } - } - }) - - parallel(lambda: mdns_scan(ssh), - lambda: check(ns1, EXPR1, False), - lambda: check(ns2, EXPR2, True), - lambda: check(ns3, EXPR3, False)) + # p1:no, p2:yes, p3:no + check([False, True, False], allow=[p2]) with test.step("Deny mDNS on a single interface: p2"): - dut.delete_xpath("/infix-services:mdns/interfaces") - dut.put_config_dict("infix-services", { - "mdns": { - "interfaces": { - "deny": [p2], - } - } - }) - - parallel(lambda: mdns_scan(ssh), - lambda: check(ns1, EXPR1, True), - lambda: check(ns2, EXPR2, False), - lambda: check(ns3, EXPR3, True)) + # p1:yes, p2:no, p3:yes + check([True, False, True], deny=[p2]) with test.step("Allow mDNS on p1, p3 deny on p2, p3"): - dut.delete_xpath("/infix-services:mdns/interfaces") - dut.put_config_dict("infix-services", { - "mdns": { - "interfaces": { - "allow": [p1, p3], - "deny": [p2, p3], - } - } - }) - - parallel(lambda: mdns_scan(ssh), - lambda: check(ns1, EXPR1, True), - lambda: check(ns2, EXPR2, False), - lambda: check(ns3, EXPR3, False)) + # p1:yes, p2:no, p3:no (deny overrides allow) + check([True, False, False], allow=[p1, p3], deny=[p2, p3]) test.succeed() diff --git a/test/case/infix_services/mdns/mdns_enable_disable/Readme.adoc b/test/case/infix_services/mdns/mdns_enable_disable/Readme.adoc index ca4d53b2..ae32c841 120000 --- a/test/case/infix_services/mdns/mdns_enable_disable/Readme.adoc +++ b/test/case/infix_services/mdns/mdns_enable_disable/Readme.adoc @@ -1 +1 @@ -mdns_enable_disable.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_services/mdns/mdns_enable_disable/mdns_enable_disable.adoc b/test/case/infix_services/mdns/mdns_enable_disable/mdns_enable_disable.adoc deleted file mode 100644 index 9a7b7ae0..00000000 --- a/test/case/infix_services/mdns/mdns_enable_disable/mdns_enable_disable.adoc +++ /dev/null @@ -1,28 +0,0 @@ -=== mDNS enable disable -==== Description -Verify that mDNS can be enabled and disabled. -Operation and non-operation are confirmed using tcpdump. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_services/mdns/mdns_enable_disable/topology.svg[mDNS enable disable topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::mdns/mdns_enable_disable/topology.svg[mDNS enable disable topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[mDNS enable disable topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUT -. Set IPv4 address 10.0.0.10/24 on target:data and disable mDNS -. Enable mDNS -. Verify on host:data there are packets from 10.0.0.10:5354 (mDNS) -. Disable mDNS -. Verify on host:data there are no packets from 10.0.0.10:5354 (mDNS) - - -<<< - diff --git a/test/case/infix_services/mdns/mdns_enable_disable/test.adoc b/test/case/infix_services/mdns/mdns_enable_disable/test.adoc new file mode 100644 index 00000000..b0eee10c --- /dev/null +++ b/test/case/infix_services/mdns/mdns_enable_disable/test.adoc @@ -0,0 +1,23 @@ +=== mDNS enable/disable + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_services/mdns/mdns_enable_disable] + +==== Description + +Verify that mDNS can be enabled and disabled. +Operation and non-operation are confirmed using tcpdump. + +==== Topology + +image::topology.svg[mDNS enable/disable topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUT +. Set IPv4 address 10.0.0.10/24 on target:data and disable mDNS +. Enable mDNS +. Verify on host:data there are packets from 10.0.0.10:5354 (mDNS) +. Disable mDNS +. Verify on host:data there are no packets from 10.0.0.10:5354 (mDNS) + + diff --git a/test/case/infix_services/mdns/mdns_enable_disable/test.py b/test/case/infix_services/mdns/mdns_enable_disable/test.py index a3756537..a7684089 100755 --- a/test/case/infix_services/mdns/mdns_enable_disable/test.py +++ b/test/case/infix_services/mdns/mdns_enable_disable/test.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 -"""mDNS enable disable +"""mDNS enable/disable -Verify that mDNS can be enabled and disabled. +Verify that mDNS can be enabled and disabled. Operation and non-operation are confirmed using tcpdump. """ diff --git a/test/case/infix_services/ssh/ssh.yaml b/test/case/infix_services/ssh/all.yaml similarity index 55% rename from test/case/infix_services/ssh/ssh.yaml rename to test/case/infix_services/ssh/all.yaml index 3b159b06..485d20a4 100644 --- a/test/case/infix_services/ssh/ssh.yaml +++ b/test/case/infix_services/ssh/all.yaml @@ -1,6 +1,6 @@ --- -- name: ssh_server_config +- name: SSH server configuration case: ssh_server_config/test.py -- name: ssh_key_authentication +- name: Generate ssh key pair case: ssh_key_authentication/test.py diff --git a/test/case/infix_services/ssh/ssh_key_authentication/Readme.adoc b/test/case/infix_services/ssh/ssh_key_authentication/Readme.adoc index 1819df3a..ae32c841 120000 --- a/test/case/infix_services/ssh/ssh_key_authentication/Readme.adoc +++ b/test/case/infix_services/ssh/ssh_key_authentication/Readme.adoc @@ -1 +1 @@ -ssh_key_authentication.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_services/ssh/ssh_key_authentication/ssh_key_authentication.adoc b/test/case/infix_services/ssh/ssh_key_authentication/ssh_key_authentication.adoc deleted file mode 100644 index 188121fb..00000000 --- a/test/case/infix_services/ssh/ssh_key_authentication/ssh_key_authentication.adoc +++ /dev/null @@ -1,26 +0,0 @@ -=== Generate ssh key pair -==== Description -Verify that 'guest' user can fetch data using only the 'public' key - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_services/ssh/ssh_key_authentication/topology.svg[Generate ssh key pair topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ssh/ssh_key_authentication/topology.svg[Generate ssh key pair topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Generate ssh key pair topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Connect to the target device -. Create a guest user on the target device -. Wait until SSH server is ready to accept connections -. Write private key to a temporary file -. Verify it is possible to fetch syslog data using public key - - -<<< - diff --git a/test/case/infix_services/ssh/ssh_key_authentication/test.adoc b/test/case/infix_services/ssh/ssh_key_authentication/test.adoc new file mode 100644 index 00000000..09e59b22 --- /dev/null +++ b/test/case/infix_services/ssh/ssh_key_authentication/test.adoc @@ -0,0 +1,21 @@ +=== Generate ssh key pair + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_services/ssh/ssh_key_authentication] + +==== Description + +Verify that 'guest' user can fetch data using only the 'public' key + +==== Topology + +image::topology.svg[Generate ssh key pair topology, align=center, scaledwidth=75%] + +==== Sequence + +. Connect to the target device +. Create a guest user on the target device +. Wait until SSH server is ready to accept connections +. Write private key to a temporary file +. Verify it is possible to fetch syslog data using public key + + diff --git a/test/case/infix_services/ssh/ssh_key_authentication/test.py b/test/case/infix_services/ssh/ssh_key_authentication/test.py index 3be65326..0c5a9bbc 100755 --- a/test/case/infix_services/ssh/ssh_key_authentication/test.py +++ b/test/case/infix_services/ssh/ssh_key_authentication/test.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 """ -Generate ssh key pair +Generate SSH key pair Verify that 'guest' user can fetch data using only the 'public' key """ diff --git a/test/case/infix_services/ssh/ssh_server_config/Readme.adoc b/test/case/infix_services/ssh/ssh_server_config/Readme.adoc index d7c2e770..ae32c841 120000 --- a/test/case/infix_services/ssh/ssh_server_config/Readme.adoc +++ b/test/case/infix_services/ssh/ssh_server_config/Readme.adoc @@ -1 +1 @@ -ssh_server_config.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/infix_services/ssh/ssh_server_config/ssh_server_config.adoc b/test/case/infix_services/ssh/ssh_server_config/test.adoc similarity index 53% rename from test/case/infix_services/ssh/ssh_server_config/ssh_server_config.adoc rename to test/case/infix_services/ssh/ssh_server_config/test.adoc index e5890611..0e41b1f1 100644 --- a/test/case/infix_services/ssh/ssh_server_config/ssh_server_config.adoc +++ b/test/case/infix_services/ssh/ssh_server_config/test.adoc @@ -1,23 +1,20 @@ === SSH server configuration + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/infix_services/ssh/ssh_server_config] + ==== Description + Test SSH server functionality with pre-defined key pair: 1. Enable/Disable SSH service. 2. Configure listen address and port. 3. Validate connectivity using static key pair. ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/infix_services/ssh/ssh_server_config/topology.svg[SSH server configuration topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ssh/ssh_server_config/topology.svg[SSH server configuration topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[SSH server configuration topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[SSH server configuration topology, align=center, scaledwidth=75%] + +==== Sequence + . Setup topology and attach to the target . Configure SSH server . Wait until SSH server is ready to accept connections @@ -26,5 +23,3 @@ endif::topdoc[] . Disable SSH server -<<< - diff --git a/test/case/misc/Readme.adoc b/test/case/misc/Readme.adoc index a8d96ffb..db79f21d 100644 --- a/test/case/misc/Readme.adoc +++ b/test/case/misc/Readme.adoc @@ -1,6 +1,4 @@ :testgroup: -== Misc tests - -<<< +== Miscellaneous Tests include::operational_all/Readme.adoc[] diff --git a/test/case/misc/misc.yaml b/test/case/misc/all.yaml similarity index 54% rename from test/case/misc/misc.yaml rename to test/case/misc/all.yaml index 637a9924..1877e5ca 100644 --- a/test/case/misc/misc.yaml +++ b/test/case/misc/all.yaml @@ -1,6 +1,6 @@ --- -- name: operational_all +- name: Get operational case: operational_all/test.py #- name: start_from_startup -# case: start_from_startup.py \ No newline at end of file +# case: start_from_startup.py diff --git a/test/case/misc/operational_all/Readme.adoc b/test/case/misc/operational_all/Readme.adoc index 2c4ebf82..ae32c841 120000 --- a/test/case/misc/operational_all/Readme.adoc +++ b/test/case/misc/operational_all/Readme.adoc @@ -1 +1 @@ -operational_all.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/misc/operational_all/operational_all.adoc b/test/case/misc/operational_all/operational_all.adoc deleted file mode 100644 index e6c8e164..00000000 --- a/test/case/misc/operational_all/operational_all.adoc +++ /dev/null @@ -1,24 +0,0 @@ -=== Get operational -==== Description -Basic test just to get operational from test-config without errors. - -==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/misc/operational_all/topology.svg[Get operational topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::operational_all/topology.svg[Get operational topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[Get operational topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence -. Set up topology and attach to target DUT -. Copy test-config to running configuration -. Get all Operational data from 'target', verify there are no errors - - -<<< - diff --git a/test/case/misc/operational_all/test.adoc b/test/case/misc/operational_all/test.adoc new file mode 100644 index 00000000..c4e26396 --- /dev/null +++ b/test/case/misc/operational_all/test.adoc @@ -0,0 +1,19 @@ +=== Get operational + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/misc/operational_all] + +==== Description + +Basic test just to get operational from test-config without errors. + +==== Topology + +image::topology.svg[Get operational topology, align=center, scaledwidth=75%] + +==== Sequence + +. Set up topology and attach to target DUT +. Copy test-config to running configuration +. Get all Operational data from 'target', verify there are no errors + + diff --git a/test/case/use_case/Readme.adoc b/test/case/use_case/Readme.adoc index 71cda818..1367e0c3 100644 --- a/test/case/use_case/Readme.adoc +++ b/test/case/use_case/Readme.adoc @@ -1,8 +1,8 @@ :testgroup: +== Use Case Tests -== Use case tests -Contains test of multiple parts of Infix together. +Integration tests verifying multiple Infix components working together: -<<< + - OSPF routing with containerized applications and network segmentation include::ospf_container/Readme.adoc[] diff --git a/test/case/use_case/use_case.yml b/test/case/use_case/all.yaml similarity index 60% rename from test/case/use_case/use_case.yml rename to test/case/use_case/all.yaml index 74d99d2a..1cb5efdc 100644 --- a/test/case/use_case/use_case.yml +++ b/test/case/use_case/all.yaml @@ -1,3 +1,3 @@ --- -- name: ospf_container +- name: OSPF Container case: ospf_container/test.py diff --git a/test/case/use_case/ospf_container/Readme.adoc b/test/case/use_case/ospf_container/Readme.adoc index 4a180a39..ae32c841 120000 --- a/test/case/use_case/ospf_container/Readme.adoc +++ b/test/case/use_case/ospf_container/Readme.adoc @@ -1 +1 @@ -ospf_container.adoc \ No newline at end of file +test.adoc \ No newline at end of file diff --git a/test/case/use_case/ospf_container/ospf_container.adoc b/test/case/use_case/ospf_container/test.adoc similarity index 76% rename from test/case/use_case/ospf_container/ospf_container.adoc rename to test/case/use_case/ospf_container/test.adoc index 09c9a60b..34df1695 100644 --- a/test/case/use_case/ospf_container/ospf_container.adoc +++ b/test/case/use_case/ospf_container/test.adoc @@ -1,5 +1,9 @@ === OSPF Container + +ifdef::topdoc[:imagesdir: {topdoc}../../test/case/use_case/ospf_container] + ==== Description + This use-case test verifies connectivity in an OSPF network to services running as hosted containers inside each router. @@ -9,17 +13,7 @@ PC, which can act as a link breaker. .Use-case overview. [#img-overview] -ifdef::topdoc[] -image::{topdoc}../../test/case/use_case/ospf_container/overview.svg[] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ospf_container/overview.svg[] -endif::testgroup[] -ifndef::testgroup[] image::overview.svg[] -endif::testgroup[] -endif::topdoc[] The DUTs are connected in a routed topology inside their own OSPF area. A single area border router (ABR) is used to access the controller @@ -50,17 +44,7 @@ second bridge, `br1`, only use IPv6 link-local addresses. .Internal network setup, here router R1 on subnet 10.1.1.1/24. [#img-setup] -ifdef::topdoc[] -image::{topdoc}../../test/case/use_case/ospf_container/internal-network.svg[Internal networks] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ospf_container/internal-network.svg[Internal networks] -endif::testgroup[] -ifndef::testgroup[] image::internal-network.svg[Internal networks] -endif::testgroup[] -endif::topdoc[] - *Container A* runs a very basic web server, it runs on port 80 inside the container, and `br0`, but is accessible outside on port 8080. @@ -74,18 +58,11 @@ endif::topdoc[] will have a unique hostname derived from the chassis MAC address ==== Topology -ifdef::topdoc[] -image::{topdoc}../../test/case/use_case/ospf_container/topology.svg[OSPF Container topology] -endif::topdoc[] -ifndef::topdoc[] -ifdef::testgroup[] -image::ospf_container/topology.svg[OSPF Container topology] -endif::testgroup[] -ifndef::testgroup[] -image::topology.svg[OSPF Container topology] -endif::testgroup[] -endif::topdoc[] -==== Test sequence + +image::topology.svg[OSPF Container topology, align=center, scaledwidth=75%] + +==== Sequence + . Set up topology and attach to target DUTs . Configure DUTs . Wait for all routers to peer @@ -94,5 +71,3 @@ endif::topdoc[] . Verify ABR:data can access container A on R3 (10.1.3.101) -<<< - diff --git a/test/infamy/furl.py b/test/infamy/furl.py index 28b28691..bfb40bd4 100644 --- a/test/infamy/furl.py +++ b/test/infamy/furl.py @@ -1,26 +1,72 @@ -"""Fugly URL fetcher""" +"""Simple HTTP URL fetcher and content checker + +This module provides the a lightweight wrapper around urllib for testing +HTTP endpoints. It's designed specifically for test scenarios where you +need to: + +- Fetch HTTP content and verify it contains expected strings +- Perform checks from within network namespaces +- Validate multiple content patterns in a single request +- Handle network errors gracefully in test environments + +Example usage: + # Single needle check + url = Furl("http://example.com/api") + if url.check("success"): + print("API returned success") + + # Multiple needle check (all must match) + if url.check(["user: alice", "status: active", "role: admin"]): + print("All user details found") + + # Check from network namespace + with IsolatedMacVlan("eth0") as ns: + if url.nscheck(ns, "expected content"): + print("Content verified from namespace") +""" import urllib.error +import urllib.parse import urllib.request + class Furl: """Furl wraps urllib in a way similar to curl""" def __init__(self, url): """Create new URL checker""" self.url = urllib.parse.quote(url, safe='/:') - def check(self, needle, timeout=10): - """Connect to web server URL, fetch body and check for needle""" + def check(self, needles, timeout=10): + """Connect to web server URL, fetch body and check for needle(s) + + Args: + needles: String or list of strings to search for in response + timeout: Request timeout in seconds + + Returns: + bool: True if all needles found in response, False otherwise + """ + # Backwards compat, make needles a list for uniform processing + if isinstance(needles, str): + needles = [needles] + try: with urllib.request.urlopen(self.url, timeout=timeout) as response: text = response.read().decode('utf-8') - #print(text) - return needle in text - except urllib.error.URLError as _: + return all(needle in text for needle in needles) + except urllib.error.URLError: return False except ConnectionResetError: return False - def nscheck(self, netns, needle): - """"Call check() from netns""" - return netns.call(lambda: self.check(needle)) + def nscheck(self, netns, needles): + """"Call check() from netns + + Args: + netns: Network namespace to call from + needles: String or list of strings to search for in response + + Returns: + bool: True if all needles found in response, False otherwise + """ + return netns.call(lambda: self.check(needles)) diff --git a/test/infamy/restconf.py b/test/infamy/restconf.py index 44d9de04..31078836 100644 --- a/test/infamy/restconf.py +++ b/test/infamy/restconf.py @@ -150,7 +150,6 @@ class Device(Transport): url = f"{self.yang_url}/{schema_name}" data = self._get_raw(url=url, parse=False) - sys.stdout.write(f"Downloading YANG model {schema_name} ...\r\033[K") data = data.decode('utf-8') with open(f"{yangdir}/{schema_name}", 'w') as json_file: json_file.write(data) diff --git a/test/spec/Readme.adoc.in b/test/spec/Readme.adoc.in index 960dfcf6..90a9cf4b 100644 --- a/test/spec/Readme.adoc.in +++ b/test/spec/Readme.adoc.in @@ -1,14 +1,25 @@ -:topdoc: - -= Test specification -{REPLACE} :title-page: +:topdoc: +ifdef::logo[] +:title-logo-image: {logo} +endif::[] :toc: :toclevels: 2 :sectnums: :sectnumlevels: 2 +:pdfmark: +:pdf-page-size: A4 +:pdf-page-layout: portrait +:pdf-page-margin: [1in, 0.5in] +:keywords: regression, test, testing +:subject: Regression testing +:autofit-option: + += Test specification +{REPLACE} <<< + include::../case/misc/Readme.adoc[] <<< diff --git a/test/spec/fonts/Lato/Lato-Black.ttf b/test/spec/fonts/Lato/Lato-Black.ttf new file mode 100644 index 00000000..4340502d Binary files /dev/null and b/test/spec/fonts/Lato/Lato-Black.ttf differ diff --git a/test/spec/fonts/Lato/Lato-BlackItalic.ttf b/test/spec/fonts/Lato/Lato-BlackItalic.ttf new file mode 100644 index 00000000..4df1555e Binary files /dev/null and b/test/spec/fonts/Lato/Lato-BlackItalic.ttf differ diff --git a/test/spec/fonts/Lato/Lato-Bold.ttf b/test/spec/fonts/Lato/Lato-Bold.ttf new file mode 100644 index 00000000..016068b4 Binary files /dev/null and b/test/spec/fonts/Lato/Lato-Bold.ttf differ diff --git a/test/spec/fonts/Lato/Lato-BoldItalic.ttf b/test/spec/fonts/Lato/Lato-BoldItalic.ttf new file mode 100644 index 00000000..a05d5032 Binary files /dev/null and b/test/spec/fonts/Lato/Lato-BoldItalic.ttf differ diff --git a/test/spec/fonts/Lato/Lato-Italic.ttf b/test/spec/fonts/Lato/Lato-Italic.ttf new file mode 100644 index 00000000..0d0f69ea Binary files /dev/null and b/test/spec/fonts/Lato/Lato-Italic.ttf differ diff --git a/test/spec/fonts/Lato/Lato-Light.ttf b/test/spec/fonts/Lato/Lato-Light.ttf new file mode 100644 index 00000000..dfa72ce8 Binary files /dev/null and b/test/spec/fonts/Lato/Lato-Light.ttf differ diff --git a/test/spec/fonts/Lato/Lato-LightItalic.ttf b/test/spec/fonts/Lato/Lato-LightItalic.ttf new file mode 100644 index 00000000..12f2b6c7 Binary files /dev/null and b/test/spec/fonts/Lato/Lato-LightItalic.ttf differ diff --git a/test/spec/fonts/Lato/Lato-Regular.ttf b/test/spec/fonts/Lato/Lato-Regular.ttf new file mode 100644 index 00000000..bb2e8875 Binary files /dev/null and b/test/spec/fonts/Lato/Lato-Regular.ttf differ diff --git a/test/spec/fonts/Lato/Lato-Thin.ttf b/test/spec/fonts/Lato/Lato-Thin.ttf new file mode 100644 index 00000000..ba58da1a Binary files /dev/null and b/test/spec/fonts/Lato/Lato-Thin.ttf differ diff --git a/test/spec/fonts/Lato/Lato-ThinItalic.ttf b/test/spec/fonts/Lato/Lato-ThinItalic.ttf new file mode 100644 index 00000000..4d82766d Binary files /dev/null and b/test/spec/fonts/Lato/Lato-ThinItalic.ttf differ diff --git a/test/spec/fonts/Lato/OFL.txt b/test/spec/fonts/Lato/OFL.txt new file mode 100644 index 00000000..1d7bf3b7 --- /dev/null +++ b/test/spec/fonts/Lato/OFL.txt @@ -0,0 +1,93 @@ +Copyright (c) 2010-2014 by tyPoland Lukasz Dziedzic (team@latofonts.com) with Reserved Font Name "Lato" + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/test/spec/fonts/LICENSE.md b/test/spec/fonts/SourceCodePro/LICENSE.md similarity index 100% rename from test/spec/fonts/LICENSE.md rename to test/spec/fonts/SourceCodePro/LICENSE.md diff --git a/test/spec/fonts/SourceCodePro-Bold.ttf b/test/spec/fonts/SourceCodePro/SourceCodePro-Bold.ttf similarity index 100% rename from test/spec/fonts/SourceCodePro-Bold.ttf rename to test/spec/fonts/SourceCodePro/SourceCodePro-Bold.ttf diff --git a/test/spec/fonts/SourceCodePro-BoldItalic.ttf b/test/spec/fonts/SourceCodePro/SourceCodePro-BoldItalic.ttf similarity index 100% rename from test/spec/fonts/SourceCodePro-BoldItalic.ttf rename to test/spec/fonts/SourceCodePro/SourceCodePro-BoldItalic.ttf diff --git a/test/spec/fonts/SourceCodePro-Italic.ttf b/test/spec/fonts/SourceCodePro/SourceCodePro-Italic.ttf similarity index 100% rename from test/spec/fonts/SourceCodePro-Italic.ttf rename to test/spec/fonts/SourceCodePro/SourceCodePro-Italic.ttf diff --git a/test/spec/fonts/SourceCodePro-Regular.ttf b/test/spec/fonts/SourceCodePro/SourceCodePro-Regular.ttf similarity index 100% rename from test/spec/fonts/SourceCodePro-Regular.ttf rename to test/spec/fonts/SourceCodePro/SourceCodePro-Regular.ttf diff --git a/test/spec/fonts/SourceSansPro/OFL.txt b/test/spec/fonts/SourceSansPro/OFL.txt new file mode 100644 index 00000000..2f7468b2 --- /dev/null +++ b/test/spec/fonts/SourceSansPro/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2010-2020 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/test/spec/fonts/SourceSansPro/README.txt b/test/spec/fonts/SourceSansPro/README.txt new file mode 100644 index 00000000..ac571ee7 --- /dev/null +++ b/test/spec/fonts/SourceSansPro/README.txt @@ -0,0 +1,79 @@ +Source Sans 3 Variable Font +=========================== + +This download contains Source Sans 3 as both variable fonts and static fonts. + +Source Sans 3 is a variable font with this axis: + wght + +This means all the styles are contained in these files: + SourceSans3-VariableFont_wght.ttf + SourceSans3-Italic-VariableFont_wght.ttf + +If your app fully supports variable fonts, you can now pick intermediate styles +that aren’t available as static fonts. Not all apps support variable fonts, and +in those cases you can use the static font files for Source Sans 3: + static/SourceSans3-ExtraLight.ttf + static/SourceSans3-Light.ttf + static/SourceSans3-Regular.ttf + static/SourceSans3-Medium.ttf + static/SourceSans3-SemiBold.ttf + static/SourceSans3-Bold.ttf + static/SourceSans3-ExtraBold.ttf + static/SourceSans3-Black.ttf + static/SourceSans3-ExtraLightItalic.ttf + static/SourceSans3-LightItalic.ttf + static/SourceSans3-Italic.ttf + static/SourceSans3-MediumItalic.ttf + static/SourceSans3-SemiBoldItalic.ttf + static/SourceSans3-BoldItalic.ttf + static/SourceSans3-ExtraBoldItalic.ttf + static/SourceSans3-BlackItalic.ttf + +Get started +----------- + +1. Install the font files you want to use + +2. Use your app's font picker to view the font family and all the +available styles + +Learn more about variable fonts +------------------------------- + + https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts + https://variablefonts.typenetwork.com + https://medium.com/variable-fonts + +In desktop apps + + https://theblog.adobe.com/can-variable-fonts-illustrator-cc + https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts + +Online + + https://developers.google.com/fonts/docs/getting_started + https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide + https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts + +Installing fonts + + MacOS: https://support.apple.com/en-us/HT201749 + Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux + Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows + +Android Apps + + https://developers.google.com/fonts/docs/android + https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts + +License +------- +Please read the full license text (OFL.txt) to understand the permissions, +restrictions and requirements for usage, redistribution, and modification. + +You can use them in your products & projects – print or digital, +commercial or otherwise. + +This isn't legal advice, please consider consulting a lawyer and see the full +license for all details. diff --git a/test/spec/fonts/SourceSansPro/SourceSans3-Italic-VariableFont_wght.ttf b/test/spec/fonts/SourceSansPro/SourceSans3-Italic-VariableFont_wght.ttf new file mode 100644 index 00000000..75865b91 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/SourceSans3-Italic-VariableFont_wght.ttf differ diff --git a/test/spec/fonts/SourceSansPro/SourceSans3-VariableFont_wght.ttf b/test/spec/fonts/SourceSansPro/SourceSans3-VariableFont_wght.ttf new file mode 100644 index 00000000..5b7248b8 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/SourceSans3-VariableFont_wght.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-Black.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-Black.ttf new file mode 100644 index 00000000..128d3e71 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-Black.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-BlackItalic.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-BlackItalic.ttf new file mode 100644 index 00000000..ab8dfbdb Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-BlackItalic.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-Bold.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-Bold.ttf new file mode 100644 index 00000000..616dd838 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-Bold.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-BoldItalic.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-BoldItalic.ttf new file mode 100644 index 00000000..ffd4bfb5 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-BoldItalic.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-ExtraBold.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-ExtraBold.ttf new file mode 100644 index 00000000..606a7986 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-ExtraBold.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-ExtraBoldItalic.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-ExtraBoldItalic.ttf new file mode 100644 index 00000000..d2bbf504 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-ExtraBoldItalic.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-ExtraLight.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-ExtraLight.ttf new file mode 100644 index 00000000..36730e3e Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-ExtraLight.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-ExtraLightItalic.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-ExtraLightItalic.ttf new file mode 100644 index 00000000..5cb2e989 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-ExtraLightItalic.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-Italic.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-Italic.ttf new file mode 100644 index 00000000..ce83ec75 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-Italic.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-Light.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-Light.ttf new file mode 100644 index 00000000..5d78199d Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-Light.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-LightItalic.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-LightItalic.ttf new file mode 100644 index 00000000..ffb44451 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-LightItalic.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-Medium.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-Medium.ttf new file mode 100644 index 00000000..4ddaeff3 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-Medium.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-MediumItalic.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-MediumItalic.ttf new file mode 100644 index 00000000..dc4f6187 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-MediumItalic.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-Regular.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-Regular.ttf new file mode 100644 index 00000000..61521b15 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-Regular.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-SemiBold.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-SemiBold.ttf new file mode 100644 index 00000000..9e253ca4 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-SemiBold.ttf differ diff --git a/test/spec/fonts/SourceSansPro/static/SourceSans3-SemiBoldItalic.ttf b/test/spec/fonts/SourceSansPro/static/SourceSans3-SemiBoldItalic.ttf new file mode 100644 index 00000000..214c17f0 Binary files /dev/null and b/test/spec/fonts/SourceSansPro/static/SourceSans3-SemiBoldItalic.ttf differ diff --git a/test/spec/generate_spec.py b/test/spec/generate_spec.py index ee50e818..72085a6e 100755 --- a/test/spec/generate_spec.py +++ b/test/spec/generate_spec.py @@ -5,38 +5,16 @@ import argparse import io import sys import re -import yaml - from pathlib import Path - +import yaml import graphviz -def replace_image_tag(text, test_dir): - """ - Convert images added in the description and replace with the required ifdefs to work - generating the test specifcation as well. - """ +def log(msg): + """Log message if in debug mode""" + if args.debug: + print(msg) - pattern = r"image::(?P\S+)\[(?P