Files
infix/test/case/meta/bootorder.py
T
Mattias Walström dce9a9c53d test: Add new sanity check tests
One to verify it is the correct version on the duts and one
that check that it is the correct bootorder.
2025-09-05 16:34:11 +02:00

25 lines
884 B
Python
Executable File

#!/usr/bin/env python3
import infamy
with infamy.Test() as test:
with test.step("Discover topology and attach to available DUTs"):
env = infamy.Env(False)
ctrl = env.ptop.get_ctrl()
duts = {}
duts_state = {}
for ix in env.ptop.get_infixen():
cport, ixport = env.ptop.get_mgmt_link(ctrl, ix)
print(f"Attaching to {ix}:{ixport} via {ctrl}:{cport}")
duts[ix] = env.attach(ix, ixport)
with test.step("Verify bootorder"):
for name, tgt in duts.items():
expected = env.ptop.get_expected_boot(name)
running = tgt.get_data("/ietf-system:system-state")
running = running['system-state']['software']['booted']
print(f"{name}: booted: {running} expected: {expected}")
if running != expected:
test.fail()
test.succeed()