test: Update infix-dhcp for test specification

This commit is contained in:
Mattias Walström
2024-10-04 11:22:58 +02:00
parent a5e4e016e4
commit 6cceecccda
6 changed files with 12 additions and 8 deletions
@@ -18,6 +18,7 @@ endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Initialize
. Verify client get DHCP lease for 10.0.0.42 on client:data
<<<
+1 -1
View File
@@ -34,7 +34,7 @@ with infamy.Test() as test:
}
client.put_config_dict("infix-dhcp-client", config)
with test.step(f"Waiting for client to set DHCP lease {ADDRESS}"):
with test.step("Verify client get DHCP lease for 10.0.0.42 on client:data"):
until(lambda: iface.address_exist(client, port, ADDRESS))
test.succeed()
@@ -17,6 +17,7 @@ endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Initialize
. Verify client to set up default route via 192.168.0.254
<<<
+1 -1
View File
@@ -35,7 +35,7 @@ with infamy.Test() as test:
}
client.put_config_dict("infix-dhcp-client", config)
with test.step(f"Wait for client to set up default route via {ROUTER}"):
with test.step("Verify client to set up default route via 192.168.0.254"):
until(lambda: route.ipv4_route_exist(client, "0.0.0.0/0", ROUTER))
test.succeed()
+3 -3
View File
@@ -22,9 +22,9 @@ endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Setting up client
. Verify client use classless routes, option 121
. Verify client did *not* use option 3
. Verify client has canary route, 20.0.0.0/24
. Verify 'client' has a route to 10.0.0.0/24 via 192.168.0.254
. Verify 'client' has a default route via 192.168.0.254
. Verify 'client' has a route to 20.0.0.0/24 via 192.168.0.2
<<<
+5 -3
View File
@@ -66,14 +66,16 @@ with infamy.Test() as test:
with infamy.IsolatedMacVlan(host) as netns:
netns.addip("192.168.0.1")
with infamy.dhcp.Server(netns, prefix=PREFIX, router=ROUTER):
with test.step("Verify client use classless routes, option 121"):
with test.step("Verify 'client' has a route to 10.0.0.0/24 via 192.168.0.254"):
print("Verify client use classless routes, option 121")
until(lambda: route.ipv4_route_exist(client, PREFIX, ROUTER))
with test.step("Verify client did *not* use option 3"):
with test.step("Verify 'client' has a default route via 192.168.0.254"):
print("Verify client did *not* use option 3")
if route.ipv4_route_exist(client, "0.0.0.0/0", ROUTER):
test.fail()
with test.step("Verify client has canary route, 20.0.0.0/24"):
with test.step("Verify 'client' has a route to 20.0.0.0/24 via 192.168.0.2"):
until(lambda: route.ipv4_route_exist(client, CANARY,
CANHOP, pref=250))