27
27
28
28
APP_BUNDLEID = os .getenv ("APP_BUNDLEID" )
29
29
30
- TEST_APP_BIN = {
31
- "thingy91x" : "artifacts/stable_version_jan_2025-update-signed.bin" ,
32
- "nrf9151dk" : "artifacts/nrf9151dk_mar_2025_update_signed.bin"
33
- }
34
-
35
30
DEVICE_MSG_TIMEOUT = 60 * 5
36
31
APP_FOTA_TIMEOUT = 60 * 10
37
32
FULL_MFW_FOTA_TIMEOUT = 60 * 30
@@ -113,9 +108,15 @@ def run_fota_reschedule(dut_fota, fota_type):
113
108
else :
114
109
raise AssertionError (f"Fota update not available after { i } attempts" )
115
110
116
- @pytest .fixture
117
- def run_fota_fixture (dut_fota , hex_file , reschedule = False ):
118
- def _run_fota (bundle_id = "" , fota_type = "app" , fotatimeout = APP_FOTA_TIMEOUT , new_version = TEST_APP_VERSION , reschedule = False ):
111
+ def run_fota (
112
+ dut_fota ,
113
+ hex_file ,
114
+ bundle_id ,
115
+ reschedule = False ,
116
+ fota_type = "app" ,
117
+ fotatimeout = APP_FOTA_TIMEOUT ,
118
+ new_version = TEST_APP_VERSION ,
119
+ ):
119
120
flash_device (os .path .abspath (hex_file ))
120
121
dut_fota .uart .xfactoryreset ()
121
122
dut_fota .uart .flush ()
@@ -177,23 +178,24 @@ def _run_fota(bundle_id="", fota_type="app", fotatimeout=APP_FOTA_TIMEOUT, new_v
177
178
logger .error (f"Version is not { new_version } after { DEVICE_MSG_TIMEOUT } s" )
178
179
raise e
179
180
180
- return _run_fota
181
-
182
-
183
- def test_app_fota (run_fota_fixture ):
181
+ def test_app_fota (dut_fota , hex_file ):
184
182
'''
185
183
Test application FOTA from nightly version to stable version
186
184
'''
187
- run_fota_fixture (
185
+ run_fota (
186
+ dut_fota ,
187
+ hex_file ,
188
188
bundle_id = APP_BUNDLEID ,
189
189
)
190
190
191
- def test_delta_mfw_fota (run_fota_fixture ):
191
+ def test_delta_mfw_fota (dut_fota , hex_file ):
192
192
'''
193
193
Test delta modem FOTA on nrf9151
194
194
'''
195
195
try :
196
- run_fota_fixture (
196
+ run_fota (
197
+ dut_fota ,
198
+ hex_file ,
197
199
bundle_id = DELTA_MFW_BUNDLEID ,
198
200
fota_type = "delta" ,
199
201
new_version = NEW_MFW_DELTA_VERSION
@@ -203,13 +205,14 @@ def test_delta_mfw_fota(run_fota_fixture):
203
205
flash_device (os .path .abspath (MFW_202_FILEPATH ))
204
206
205
207
@pytest .mark .slow
206
- def test_full_mfw_fota (run_fota_fixture ):
208
+ def test_full_mfw_fota (dut_fota , hex_file ):
207
209
'''
208
210
Test full modem FOTA on nrf9151
209
211
'''
210
-
211
212
try :
212
- run_fota_fixture (
213
+ run_fota (
214
+ dut_fota ,
215
+ hex_file ,
213
216
bundle_id = FULL_MFW_BUNDLEID ,
214
217
fota_type = "full" ,
215
218
new_version = MFW_202_VERSION ,
0 commit comments