mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
test: case: ntp: Adapt tests for polled yangerd
This commit is contained in:
@@ -87,11 +87,11 @@ with infamy.Test() as test:
|
||||
})
|
||||
|
||||
with test.step("Verify NTP server has received packets"):
|
||||
until(lambda: ntp.server_has_received_packets(server), attempts=30)
|
||||
until(lambda: ntp.server_has_received_packets(server), attempts=120)
|
||||
print("Server has received NTP packets from client")
|
||||
|
||||
with test.step("Verify NTP client has synchronized"):
|
||||
selected = until(lambda: ntp.any_source_selected(client), attempts=30)
|
||||
selected = until(lambda: ntp.any_source_selected(client), attempts=120)
|
||||
print(f"Client synchronized to {selected.get('address')} (stratum {selected.get('stratum')})")
|
||||
|
||||
test.succeed()
|
||||
|
||||
@@ -97,12 +97,12 @@ with infamy.Test() as test:
|
||||
|
||||
with test.step("Verify peers see each other in associations"):
|
||||
for dut, _, name, _, peer_ip in duts:
|
||||
until(lambda t=dut, p=peer_ip: ntp.server_has_peer(t, p), attempts=20)
|
||||
until(lambda t=dut, p=peer_ip: ntp.server_has_peer(t, p), attempts=120)
|
||||
print(f"{name} sees {peer_ip} in associations")
|
||||
|
||||
with test.step("Verify peers can reach each other"):
|
||||
for dut, _, name, _, peer_ip in duts:
|
||||
until(lambda t=dut, p=peer_ip: ntp.server_peer_reachable(t, p), attempts=60)
|
||||
until(lambda t=dut, p=peer_ip: ntp.server_peer_reachable(t, p), attempts=120)
|
||||
print(f"{name} can reach {peer_ip}")
|
||||
|
||||
with test.step("Wait for one peer to select the other as sync source"):
|
||||
|
||||
@@ -115,10 +115,10 @@ with infamy.Test() as test:
|
||||
ns1.must_reach("192.168.1.1")
|
||||
|
||||
with test.step("Query time from upstream NTP server"):
|
||||
until(lambda: ntp.server_query(ns1, "192.168.1.1"), attempts=20)
|
||||
until(lambda: ntp.server_query(ns1, "192.168.1.1"), attempts=120)
|
||||
|
||||
with test.step("Verify upstream NTP server statistics"):
|
||||
until(lambda: ntp.server_has_received_packets(upstream), attempts=20)
|
||||
until(lambda: ntp.server_has_received_packets(upstream), attempts=120)
|
||||
|
||||
with infamy.IsolatedMacVlan(hport2) as ns2:
|
||||
ns2.addip("192.168.2.2")
|
||||
@@ -128,9 +128,9 @@ with infamy.Test() as test:
|
||||
|
||||
with test.step("Wait for downstream to sync from upstream"):
|
||||
# Give downstream time to sync from upstream
|
||||
until(lambda: ntp.server_query(ns2, "192.168.2.1"), attempts=30)
|
||||
until(lambda: ntp.server_query(ns2, "192.168.2.1"), attempts=120)
|
||||
|
||||
with test.step("Verify downstream NTP server statistics"):
|
||||
until(lambda: ntp.server_has_received_packets(downstream), attempts=20)
|
||||
until(lambda: ntp.server_has_received_packets(downstream), attempts=120)
|
||||
|
||||
test.succeed()
|
||||
|
||||
@@ -53,9 +53,9 @@ with infamy.Test() as test:
|
||||
ns1.must_reach("192.168.1.1")
|
||||
|
||||
with test.step("Query time from NTP server"):
|
||||
until(lambda: ntp.server_query(ns1, "192.168.1.1"), attempts=20)
|
||||
until(lambda: ntp.server_query(ns1, "192.168.1.1"), attempts=120)
|
||||
|
||||
with test.step("Verify NTP server statistics"):
|
||||
until(lambda: ntp.server_has_received_packets(target), attempts=20)
|
||||
until(lambda: ntp.server_has_received_packets(target), attempts=120)
|
||||
|
||||
test.succeed()
|
||||
|
||||
Reference in New Issue
Block a user