From 784b3914674a124b16689116ffca1f3d35cc3c5e Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Mon, 2 Dec 2024 09:21:09 +0100 Subject: [PATCH] test: reproducible: Log software versions Make sure that we keep a record of the versions and boot source used by all devices under test when running the full suite - in case we ever suspect that there is a mismatch between the intended test image and the actual one. Since this test now needs to communicate with the devices, make sure that we run the wait test first. --- test/case/all.yaml | 2 +- test/case/meta/reproducible.py | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/test/case/all.yaml b/test/case/all.yaml index d6ca30f0..114d836c 100644 --- a/test/case/all.yaml +++ b/test/case/all.yaml @@ -1,6 +1,6 @@ --- -- case: meta/reproducible.py - case: meta/wait.py +- case: meta/reproducible.py - name: Misc tests suite: misc/misc.yaml diff --git a/test/case/meta/reproducible.py b/test/case/meta/reproducible.py index 6e2ad565..e6f68515 100755 --- a/test/case/meta/reproducible.py +++ b/test/case/meta/reproducible.py @@ -13,4 +13,27 @@ with infamy.Test() as test: else: print(f"Specify PYTHONHASHSEED={seed} to reproduce this test environment") + with test.step("Discover topology and attach to available DUTs"): + env = infamy.Env(False) + ctrl = env.ptop.get_ctrl() + + duts = {} + 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("Log running software versions"): + for name, tgt in duts.items(): + sys = tgt.get_data("/ietf-system:system-state") + sw = sys["system-state"]["software"] + plt = sys["system-state"]["platform"] + + print(f"{name}:") + for k,v in plt.items(): + print(f" {k:<16s} {v}") + + for k in ("compatible", "booted"): + print(f" {k:<16s} {sw[k]}") + test.succeed()