Skip to content

Commit

Permalink
tests: on_target: fix app fota test
Browse files Browse the repository at this point in the history
Get latest bundle request is broken.
Use hard-coded bundleID as solution.

Signed-off-by: Giacomo Dematteis <[email protected]>
  • Loading branch information
DematteisGiacomo committed Feb 18, 2025
1 parent 88c17b8 commit 253cb16
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions tests/on_target/tests/test_functional/test_fota.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
'''
Expand All @@ -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
'''
Expand Down

0 comments on commit 253cb16

Please sign in to comment.