From 59fbb26dca9d52708fcfea278c491a78c2555c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Fri, 22 May 2026 11:19:08 +0200 Subject: [PATCH] test: upgrade: Add adaptions needed for yangerd Specially the change: ` - oper = target.get_dict("/system-state/software") + oper = target.get_dict("/ietf-system:system-state/software") ` i feel is strange, since only the backend for sysrepo has changed, but the new syntax is actually correct, unsure why it has worked before. --- test/case/system/upgrade/test.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/test/case/system/upgrade/test.py b/test/case/system/upgrade/test.py index 80931dcc..a1c452bb 100755 --- a/test/case/system/upgrade/test.py +++ b/test/case/system/upgrade/test.py @@ -26,7 +26,7 @@ PKGPATH = os.path.join( "package" ) def get_boot_order(target): - oper = target.get_dict("/system-state/software") + oper = target.get_dict("/ietf-system:system-state/software") return " ".join(oper["system-state"]["software"]["boot-order"]) def set_boot_order(target, order): @@ -106,9 +106,25 @@ with infamy.Test() as test: } }) + with test.step("Wait for upgrade to start"): + for _ in range(600): + oper = target.get_dict("/ietf-system:system-state/software") + installer = oper["system-state"]["software"]["installer"] + if installer["operation"] != "idle": + print(installer) + if "last-error" in installer: + print("Install failed:", installer["last-error"]) + test.fail() + + break + time.sleep(1) + else: + print("Timeout, last state:", oper) + test.fail() + with test.step("Wait for upgrade to finish"): for _ in range(600): - oper = target.get_dict("/system-state/software") + oper = target.get_dict("/ietf-system:system-state/software") installer = oper["system-state"]["software"]["installer"] if installer["operation"] == "idle": print(installer) @@ -135,7 +151,7 @@ with infamy.Test() as test: with test.step("Verify that the partition is the booted"): should_boot=get_boot_order(target).split()[0] - oper = target.get_dict("/system-state/software") + oper = target.get_dict("/ietf-system:system-state/software") booted = oper["system-state"]["software"]["booted"] print(f"Should boot: {should_boot}, booted: {booted}") assert(booted == should_boot)