mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-31 13:03:02 +02:00
test: Update infix-dhcp for test specification
This commit is contained in:
@@ -18,6 +18,7 @@ endif::testgroup[]
|
||||
endif::topdoc[]
|
||||
==== Test sequence
|
||||
. Initialize
|
||||
. Verify client get DHCP lease for 10.0.0.42 on client:data
|
||||
|
||||
|
||||
<<<
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
<<<
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
<<<
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user