From 594d074f7ab77fa2e9030ab68ae1c63f3ca1aaae Mon Sep 17 00:00:00 2001 From: Ahmed Karic Date: Wed, 23 Oct 2024 18:04:52 +0200 Subject: [PATCH] test: update dhcp test topologies Fixes #746 --- test/case/infix_dhcp/dhcp_basic/Readme.adoc | 2 +- test/case/infix_dhcp/dhcp_basic/test.py | 7 +-- test/case/infix_dhcp/dhcp_basic/topology.dot | 8 ++-- test/case/infix_dhcp/dhcp_basic/topology.svg | 45 ++++++++++--------- test/case/infix_dhcp/dhcp_router/test.py | 4 +- test/case/infix_dhcp/dhcp_router/topology.dot | 8 ++-- test/case/infix_dhcp/dhcp_router/topology.svg | 41 +++++++++-------- test/case/infix_dhcp/dhcp_routes/Readme.adoc | 4 +- test/case/infix_dhcp/dhcp_routes/test.py | 3 +- test/case/infix_dhcp/dhcp_routes/topology.dot | 6 +-- test/case/infix_dhcp/dhcp_routes/topology.svg | 41 +++++++++-------- test/spec/Readme.adoc | 44 ++++++++++++++++++ 12 files changed, 126 insertions(+), 87 deletions(-) create mode 100644 test/spec/Readme.adoc diff --git a/test/case/infix_dhcp/dhcp_basic/Readme.adoc b/test/case/infix_dhcp/dhcp_basic/Readme.adoc index 5c9023032..f24b66455 100644 --- a/test/case/infix_dhcp/dhcp_basic/Readme.adoc +++ b/test/case/infix_dhcp/dhcp_basic/Readme.adoc @@ -2,7 +2,7 @@ ==== 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. +interface. ==== Topology ifdef::topdoc[] diff --git a/test/case/infix_dhcp/dhcp_basic/test.py b/test/case/infix_dhcp/dhcp_basic/test.py index 95884ad2e..0c2a37c8e 100755 --- a/test/case/infix_dhcp/dhcp_basic/test.py +++ b/test/case/infix_dhcp/dhcp_basic/test.py @@ -1,15 +1,12 @@ #!/usr/bin/env python3 -# 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. """ DHCP Basic 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. +interface. """ -import time + import infamy, infamy.dhcp import infamy.iface as iface from infamy.util import until diff --git a/test/case/infix_dhcp/dhcp_basic/topology.dot b/test/case/infix_dhcp/dhcp_basic/topology.dot index 605206a3e..4df222142 100644 --- a/test/case/infix_dhcp/dhcp_basic/topology.dot +++ b/test/case/infix_dhcp/dhcp_basic/topology.dot @@ -1,13 +1,13 @@ graph "1x2" { layout="neato"; overlap="false"; - esep="+80"; + esep="+100"; node [shape=record, fontname="DejaVu Sans Mono, Book"]; edge [color="cornflowerblue", penwidth="2", fontname="DejaVu Serif, Book"]; host [ - label="host \n(10.0.0.1) | { tgt | data }", + label="host | { mgmt | data }", pos="0,20!", kind="controller", ]; @@ -18,6 +18,6 @@ graph "1x2" { kind="infix", ]; - host:tgt -- client:mgmt [kind=mgmt, color=black, taillabel="10.0.0.42/24"] - host:data -- client:data + host:mgmt -- client:mgmt [kind=mgmt, color=lightgrey] + host:data -- client:data [color=black, taillabel="10.0.0.1/24", headlabel="10.0.0.42/24"] } diff --git a/test/case/infix_dhcp/dhcp_basic/topology.svg b/test/case/infix_dhcp/dhcp_basic/topology.svg index 7b8a978bf..168182b81 100644 --- a/test/case/infix_dhcp/dhcp_basic/topology.svg +++ b/test/case/infix_dhcp/dhcp_basic/topology.svg @@ -1,44 +1,45 @@ - + - - + + 1x2 - + host - -host -(10.0.0.1) - -tgt - -data + +host + +mgmt + +data client - -mgmt - -data - -client + +mgmt + +data + +client -host:tgt--client:mgmt - -10.0.0.42/24 +host:mgmt--client:mgmt + host:data--client:data - + +10.0.0.42/24 +10.0.0.1/24 diff --git a/test/case/infix_dhcp/dhcp_router/test.py b/test/case/infix_dhcp/dhcp_router/test.py index 61523ee4c..e64763c44 100755 --- a/test/case/infix_dhcp/dhcp_router/test.py +++ b/test/case/infix_dhcp/dhcp_router/test.py @@ -1,14 +1,12 @@ #!/usr/bin/env python3 -# Verify DHCP option 3 (router) """ DHCP router Verify that the DHCP client receives default gateway (DHCP option 3, router) and that route exists in operational datastore. """ -import time + import infamy, infamy.dhcp -import infamy.iface as iface import infamy.route as route from infamy.util import until diff --git a/test/case/infix_dhcp/dhcp_router/topology.dot b/test/case/infix_dhcp/dhcp_router/topology.dot index 16ff458df..e7eb7366b 100644 --- a/test/case/infix_dhcp/dhcp_router/topology.dot +++ b/test/case/infix_dhcp/dhcp_router/topology.dot @@ -1,13 +1,13 @@ graph "1x2" { layout="neato"; overlap="false"; - esep="+80"; + esep="+100"; node [shape=record, fontname="DejaVu Sans Mono, Book"]; edge [color="cornflowerblue", penwidth="2", fontname="DejaVu Serif, Book"]; host [ - label="host \n(192.168.0.1) | { tgt | data }", + label="host | { mgmt | data }", pos="0,20!", kind="controller", ]; @@ -18,6 +18,6 @@ graph "1x2" { kind="infix", ]; - host:tgt -- client:mgmt [kind=mgmt, color=black, taillabel="192.168.0.254/24"] - host:data -- client:data + host:mgmt -- client:mgmt [kind=mgmt, color=lightgrey] + host:data -- client:data [color=black, taillabel="192.168.0.1/24"] } diff --git a/test/case/infix_dhcp/dhcp_router/topology.svg b/test/case/infix_dhcp/dhcp_router/topology.svg index 7ce78c1d8..29b06880f 100644 --- a/test/case/infix_dhcp/dhcp_router/topology.svg +++ b/test/case/infix_dhcp/dhcp_router/topology.svg @@ -3,42 +3,41 @@ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> - - + + 1x2 - + host - -host -(192.168.0.1) - -tgt - -data + +host + +mgmt + +data client - -mgmt - -data - -client + +mgmt + +data + +client -host:tgt--client:mgmt - -192.168.0.254/24 +host:mgmt--client:mgmt + host:data--client:data - + +192.168.0.1/24 diff --git a/test/case/infix_dhcp/dhcp_routes/Readme.adoc b/test/case/infix_dhcp/dhcp_routes/Readme.adoc index 41d35d39f..9b7224df8 100644 --- a/test/case/infix_dhcp/dhcp_routes/Readme.adoc +++ b/test/case/infix_dhcp/dhcp_routes/Readme.adoc @@ -4,8 +4,8 @@ Verify DHCP option 121 (static routes) is used over option 3 and that the routes exist in the operational datastore. Installing unrelated routes from a DHCP server should not affect already -existing routes. To verify this a canary route is set up in the client -before initiating DHCP. This canary route does not need to be reachable +existing routes. To verify this, a canary route is set up in the client +before initiating DHCP. This canary route does not need to be reachable before a DHCP lease has been acquired. ==== Topology diff --git a/test/case/infix_dhcp/dhcp_routes/test.py b/test/case/infix_dhcp/dhcp_routes/test.py index 35971045b..e4592ff64 100755 --- a/test/case/infix_dhcp/dhcp_routes/test.py +++ b/test/case/infix_dhcp/dhcp_routes/test.py @@ -6,10 +6,11 @@ routes exist in the operational datastore. Installing unrelated routes from a DHCP server should not affect already -existing routes. To verify this a canary route is set up in the client +existing routes. To verify this, a canary route is set up in the client before initiating DHCP. This canary route does not need to be reachable before a DHCP lease has been acquired. """ + import infamy import infamy.dhcp import infamy.route as route diff --git a/test/case/infix_dhcp/dhcp_routes/topology.dot b/test/case/infix_dhcp/dhcp_routes/topology.dot index 78c2737d2..e7eb7366b 100644 --- a/test/case/infix_dhcp/dhcp_routes/topology.dot +++ b/test/case/infix_dhcp/dhcp_routes/topology.dot @@ -7,7 +7,7 @@ graph "1x2" { edge [color="cornflowerblue", penwidth="2", fontname="DejaVu Serif, Book"]; host [ - label="host \n(10.0.0.0/24) | { tgt | data }", + label="host | { mgmt | data }", pos="0,20!", kind="controller", ]; @@ -18,6 +18,6 @@ graph "1x2" { kind="infix", ]; - host:tgt -- client:mgmt [kind=mgmt, color=black, taillabel="192.168.0.254/24"] - host:data -- client:data + host:mgmt -- client:mgmt [kind=mgmt, color=lightgrey] + host:data -- client:data [color=black, taillabel="192.168.0.1/24"] } diff --git a/test/case/infix_dhcp/dhcp_routes/topology.svg b/test/case/infix_dhcp/dhcp_routes/topology.svg index eb6dc218c..29b06880f 100644 --- a/test/case/infix_dhcp/dhcp_routes/topology.svg +++ b/test/case/infix_dhcp/dhcp_routes/topology.svg @@ -3,42 +3,41 @@ "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> - - + + 1x2 - + host - -host -(10.0.0.0/24) - -tgt - -data + +host + +mgmt + +data client - -mgmt - -data - -client + +mgmt + +data + +client -host:tgt--client:mgmt - -192.168.0.254/24 +host:mgmt--client:mgmt + host:data--client:data - + +192.168.0.1/24 diff --git a/test/spec/Readme.adoc b/test/spec/Readme.adoc new file mode 100644 index 000000000..05c69ad1b --- /dev/null +++ b/test/spec/Readme.adoc @@ -0,0 +1,44 @@ +:topdoc: + += Test specification +Infix v24.10.1-23-g8fc0ab9b-dirty +:title-page: +:toc: +:toclevels: 2 +:sectnums: +:sectnumlevels: 2 + +<<< +include::../case/misc/Readme.adoc[] + +<<< + +include::../case/ietf_system/Readme.adoc[] + +<<< + +include::../case/ietf_syslog/Readme.adoc[] + +<<< + +include::../case/ietf_interfaces/Readme.adoc[] + +<<< + +include::../case/ietf_routing/Readme.adoc[] + +<<< + +include::../case/infix_containers/Readme.adoc[] + +<<< + +include::../case/infix_dhcp/Readme.adoc[] + +<<< + +include::../case/ietf_hardware/Readme.adoc[] + +<<< + +include::../case/infix_services/Readme.adoc[]