mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-29 20:23:01 +02:00
test: Remove meta test case wait
It is now redundant, check has been moved to attach in Env.
This commit is contained in:
+1
-3
@@ -2,12 +2,10 @@
|
||||
- settings:
|
||||
test-spec: Readme.adoc
|
||||
|
||||
- case: meta/wait.py
|
||||
infamy:
|
||||
specification: False
|
||||
- case: meta/reproducible.py
|
||||
infamy:
|
||||
specification: False
|
||||
|
||||
- name: Misc tests
|
||||
suite: misc/misc.yaml
|
||||
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import time
|
||||
import infamy
|
||||
import infamy.neigh
|
||||
|
||||
|
||||
TIMEOUT = 300
|
||||
|
||||
|
||||
def ll6ping(node):
|
||||
cport, nport = env.ptop.get_mgmt_link(ctrl, node)
|
||||
neigh = infamy.neigh.ll6ping(cport, flags=["-w1", "-c1", "-L", "-n"])
|
||||
if neigh:
|
||||
print(f"Found {neigh} on {cport} (connected to {node}:{nport})")
|
||||
return neigh
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def is_reachable(node, env):
|
||||
neigh = ll6ping(node)
|
||||
if not neigh:
|
||||
return False
|
||||
|
||||
return infamy.util.is_reachable(neigh, env, env.ptop.get_password(node))
|
||||
|
||||
|
||||
with infamy.Test() as test:
|
||||
with test.step("Initialize"):
|
||||
# The test is designed to be run on a physical topology.
|
||||
env = infamy.Env(ltop=False)
|
||||
|
||||
ctrl = env.ptop.get_ctrl()
|
||||
infixen = env.ptop.get_infixen()
|
||||
|
||||
with test.step(f"Reach {infixen}"):
|
||||
print(f"Waiting for {infixen} to come up, timeout: {TIMEOUT / 60} min")
|
||||
timeout = time.time() + TIMEOUT
|
||||
|
||||
while infixen and time.time() < timeout:
|
||||
time.sleep(1)
|
||||
infixen = [node for node in infixen if not is_reachable(node, env)]
|
||||
|
||||
if infixen:
|
||||
print(f"Unable to reach {infixen}")
|
||||
test.fail()
|
||||
|
||||
test.succeed()
|
||||
Reference in New Issue
Block a user