From 253cb16fb62fcb6f3bd85b61e702ba0cfc3e4af8 Mon Sep 17 00:00:00 2001 From: Giacomo Dematteis Date: Tue, 18 Feb 2025 09:54:42 +0100 Subject: [PATCH] tests: on_target: fix app fota test Get latest bundle request is broken. Use hard-coded bundleID as solution. Signed-off-by: Giacomo Dematteis --- .../tests/test_functional/test_fota.py | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/tests/on_target/tests/test_functional/test_fota.py b/tests/on_target/tests/test_functional/test_fota.py index 739d306c..533819f5 100644 --- a/tests/on_target/tests/test_functional/test_fota.py +++ b/tests/on_target/tests/test_functional/test_fota.py @@ -16,6 +16,7 @@ MFW_202_FILEPATH = "artifacts/mfw_nrf91x1_2.0.2.zip" DELTA_MFW_BUNDLEID = "MODEM*3471f88e*mfw_nrf91x1_2.0.2-FOTA-TEST" FULL_MFW_BUNDLEID = "MDM_FULL*124c2b20*mfw_nrf91x1_full_2.0.2" +APP_BUNDLEID = "APP*a82b7076*v2.0.1" APP_FOTA_TIMEOUT = 60 * 10 FULL_MFW_FOTA_TIMEOUT = 60 * 30 @@ -74,27 +75,14 @@ def _run_fota(bundleId, fota_type, fotatimeout=APP_FOTA_TIMEOUT, test_fota_resum return _run_fota -def test_app_fota(t91x_fota, hex_file, run_fota_fixture): +def test_app_fota(run_fota_fixture): ''' Test application FOTA on nrf9151 ''' - # Get latest APP fota bundle - results = t91x_fota.fota.get_fota_bundles() - if not results: - pytest.fail("Failed to get APP FOTA bundles") - available_bundles = results["bundles"] - logger.debug(f"Number of available bundles: {len(available_bundles)}") - app_bundles = [bundle for bundle in available_bundles if "APP" in bundle["bundleId"]] - if not app_bundles: - pytest.fail("No APP FOTA bundles found") - latest_app_bundle = app_bundles[0] + run_fota_fixture(bundleId=APP_BUNDLEID, fota_type="app", test_fota_resumption=True) - logger.debug(f"Latest APP bundle: {latest_app_bundle}") - run_fota_fixture(bundleId=latest_app_bundle["bundleId"], fota_type="app", test_fota_resumption=True) - - -def test_delta_mfw_fota(t91x_board, hex_file, run_fota_fixture): +def test_delta_mfw_fota(run_fota_fixture): ''' Test delta modem FOTA on nrf9151 ''' @@ -109,7 +97,7 @@ def test_delta_mfw_fota(t91x_board, hex_file, run_fota_fixture): flash_device(os.path.abspath(MFW_202_FILEPATH)) @pytest.mark.slow -def test_full_mfw_fota(t91x_board, hex_file, run_fota_fixture): +def test_full_mfw_fota(run_fota_fixture): ''' Test full modem FOTA on nrf9151 '''