mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-28 11:43:01 +02:00
One to verify it is the correct version on the duts and one that check that it is the correct bootorder.
25 lines
889 B
Python
Executable File
25 lines
889 B
Python
Executable File
#!/usr/bin/env python3
|
|
import infamy
|
|
import os
|
|
|
|
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 software version"):
|
|
expected=os.environ.get("VERSION")
|
|
for name, tgt in duts.items():
|
|
running = tgt.get_data("/ietf-system:system-state")
|
|
running = running['system-state']['platform']['os-version']
|
|
print(f"{name}: booted: {running} expected {expected}")
|
|
if running != expected:
|
|
test.fail()
|
|
test.succeed()
|