From a2ef123889ee4e57a32f6e262aa590c10441bacb Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 22 May 2023 12:37:44 +0200 Subject: [PATCH 1/3] examples/suit_update: add delay before getting address of device Without this delay, the logic skips a tentative ("TNT") address, and then times out later trying to talk to `fe80::2`. --- examples/suit_update/tests-with-config/01-run.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/suit_update/tests-with-config/01-run.py b/examples/suit_update/tests-with-config/01-run.py index 6c27b0f326aa..ed832d77c009 100755 --- a/examples/suit_update/tests-with-config/01-run.py +++ b/examples/suit_update/tests-with-config/01-run.py @@ -94,6 +94,8 @@ def wait_for_update(child): def get_ipv6_addr(child): child.expect_exact(">") + # give the stack some time to make the address non-tentataive + time.sleep(2) child.sendline("ifconfig") if USE_ETHOS == 0: # Get device global address From 6f00380cc3b2461bf4427012c3746df5272530f1 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 22 May 2023 12:40:07 +0200 Subject: [PATCH 2/3] examples/suit_update: fix "suit_coap" -> "suit_worker" in test --- examples/suit_update/tests-with-config/01-run.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/suit_update/tests-with-config/01-run.py b/examples/suit_update/tests-with-config/01-run.py index ed832d77c009..6c69fb301580 100755 --- a/examples/suit_update/tests-with-config/01-run.py +++ b/examples/suit_update/tests-with-config/01-run.py @@ -31,6 +31,9 @@ IFACE = os.getenv("IFACE", "tapbr0") TMPDIR = tempfile.TemporaryDirectory() +TRIGGER_RECEIVED_MSG = "suit_worker: started." +REBOOTING_MSG = "suit_worker: rebooting..." + def get_iface_addr(iface): out = subprocess.check_output(["ip", "a", "s", "dev", iface]).decode() @@ -178,7 +181,7 @@ def running_slot(child): def _test_invalid_version(child, client, app_ver): publish(TMPDIR.name, COAP_HOST, app_ver) notify(COAP_HOST, client, app_ver) - child.expect_exact("suit_coap: trigger received") + child.expect_exact(TRIGGER_RECEIVED_MSG) child.expect_exact("suit: verifying manifest signature") child.expect_exact("seq_nr <= running image") @@ -186,7 +189,7 @@ def _test_invalid_version(child, client, app_ver): def _test_invalid_signature(child, client, app_ver): publish(TMPDIR.name, COAP_HOST, app_ver + 1, "invalid_keys") notify(COAP_HOST, client, app_ver + 1) - child.expect_exact("suit_coap: trigger received") + child.expect_exact(TRIGGER_RECEIVED_MSG) child.expect_exact("suit: verifying manifest signature") child.expect_exact("Unable to validate signature") @@ -196,7 +199,7 @@ def _test_successful_update(child, client, app_ver): # Trigger update process, verify it validates manifest correctly publish(TMPDIR.name, COAP_HOST, version) notify(COAP_HOST, client, version) - child.expect_exact("suit_coap: trigger received") + child.expect_exact(TRIGGER_RECEIVED_MSG) child.expect_exact("suit: verifying manifest signature") child.expect( r"SUIT policy check OK.\r\n", @@ -211,7 +214,7 @@ def _test_successful_update(child, client, app_ver): # Wait for reboot on non-native BOARDs if BOARD != "native": - child.expect_exact("suit_coap: rebooting...") + child.expect_exact(REBOOTING_MSG) # Verify client is reachable and get address client = get_reachable_addr(child) assert seq_no(child) == version From a622c881058240f82f594cc23c580cac75b9e10e Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 22 May 2023 12:40:37 +0200 Subject: [PATCH 3/3] examples/suit_update: fix redundant check in test script --- examples/suit_update/tests-with-config/01-run.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/suit_update/tests-with-config/01-run.py b/examples/suit_update/tests-with-config/01-run.py index 6c69fb301580..a4c9f86cf28b 100755 --- a/examples/suit_update/tests-with-config/01-run.py +++ b/examples/suit_update/tests-with-config/01-run.py @@ -210,7 +210,6 @@ def _test_successful_update(child, client, app_ver): pass # Check successful install child.expect_exact("Install correct payload") - child.expect_exact("Install correct payload") # Wait for reboot on non-native BOARDs if BOARD != "native":