Skip to content

Commit

Permalink
Merge pull request #760 from kernelkit/update-dhcp-tests
Browse files Browse the repository at this point in the history
test: update dhcp test topologies
  • Loading branch information
axkar authored Oct 24, 2024
2 parents 1aa5169 + 594d074 commit 04c843e
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 87 deletions.
2 changes: 1 addition & 1 deletion test/case/infix_dhcp/dhcp_basic/Readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
7 changes: 2 additions & 5 deletions test/case/infix_dhcp/dhcp_basic/test.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions test/case/infix_dhcp/dhcp_basic/topology.dot
Original file line number Diff line number Diff line change
@@ -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> tgt | <data> data }",
label="host | { <mgmt> mgmt | <data> data }",
pos="0,20!",
kind="controller",
];
Expand All @@ -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"]
}
45 changes: 23 additions & 22 deletions test/case/infix_dhcp/dhcp_basic/topology.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions test/case/infix_dhcp/dhcp_router/test.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 4 additions & 4 deletions test/case/infix_dhcp/dhcp_router/topology.dot
Original file line number Diff line number Diff line change
@@ -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> tgt | <data> data }",
label="host | { <mgmt> mgmt | <data> data }",
pos="0,20!",
kind="controller",
];
Expand All @@ -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"]
}
41 changes: 20 additions & 21 deletions test/case/infix_dhcp/dhcp_router/topology.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions test/case/infix_dhcp/dhcp_routes/Readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion test/case/infix_dhcp/dhcp_routes/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/case/infix_dhcp/dhcp_routes/topology.dot
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ graph "1x2" {
edge [color="cornflowerblue", penwidth="2", fontname="DejaVu Serif, Book"];

host [
label="host \n(10.0.0.0/24) | { <tgt> tgt | <data> data }",
label="host | { <mgmt> mgmt | <data> data }",
pos="0,20!",
kind="controller",
];
Expand All @@ -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"]
}
41 changes: 20 additions & 21 deletions test/case/infix_dhcp/dhcp_routes/topology.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions test/spec/Readme.adoc
Original file line number Diff line number Diff line change
@@ -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[]

0 comments on commit 04c843e

Please sign in to comment.