Skip to content

Commit 6e41a4a

Browse files
committed
tests: Disable UART in PPK tests
Disable UART in PPK tests Fix some compliance issues in the ppk test Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
1 parent 4586b12 commit 6e41a4a

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

tests/on_target/tests/test_functional/test_fota.py

+12-7
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,15 @@ def test_full_mfw_fota(run_fota_fixture):
215215
'''
216216
Test full modem FOTA on nrf9151
217217
'''
218-
run_fota_fixture(
219-
bundle_id=FULL_MFW_BUNDLEID,
220-
fota_type="full",
221-
new_version=MFW_202_VERSION,
222-
fotatimeout=FULL_MFW_FOTA_TIMEOUT,
223-
reschedule=True
224-
)
218+
219+
try:
220+
run_fota_fixture(
221+
bundle_id=FULL_MFW_BUNDLEID,
222+
fota_type="full",
223+
new_version=MFW_202_VERSION,
224+
fotatimeout=FULL_MFW_FOTA_TIMEOUT,
225+
reschedule=True
226+
)
227+
finally:
228+
# Restore mfw202, no matter if test pass/fails
229+
flash_device(os.path.abspath(MFW_202_FILEPATH))

tests/on_target/tests/test_ppk/test_power.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def thingy91x_ppk2():
135135
ppk2_dev.toggle_DUT_power("ON") # enable DUT power
136136

137137
time.sleep(10)
138-
for i in range(10):
138+
for _ in range(10):
139139
try:
140140
all_uarts = get_uarts()
141141
logger.warning(f"momo all uarts {all_uarts}")
@@ -175,6 +175,10 @@ def test_power(thingy91x_ppk2, hex_file):
175175
except AssertionError:
176176
pytest.skip("Device unable to connect to cloud, skip ppk test")
177177

178+
# Disable UART on the device
179+
thingy91x_ppk2.t91x_uart.write("pm suspend uartuart@9000\r\n")
180+
thingy91x_ppk2.t91x_uart.write("pm suspend uartuart@8000\r\n")
181+
178182
thingy91x_ppk2.ppk2_dev.start_measuring()
179183

180184
start = time.time()
@@ -214,7 +218,7 @@ def test_power(thingy91x_ppk2, hex_file):
214218
last_log_time = current_time
215219

216220
# Check if PSM target has been reached
217-
if rolling_average < MAX_CURRENT_PSM_UA and rolling_average > 0:
221+
if 0 < rolling_average < MAX_CURRENT_PSM_UA:
218222
psm_reached = True
219223

220224
except Exception as e:

0 commit comments

Comments
 (0)