From 91e0e36ffe678ce5df4bb1b6b87f4188d0256fee Mon Sep 17 00:00:00 2001 From: "radek.tandler" Date: Fri, 20 Dec 2024 19:28:11 +0100 Subject: [PATCH] fix(storage/nvs): Fixed failing test cases in example folder --- examples/storage/nvs_rw_value/pytest_nvs_rw_value.py | 2 ++ examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py b/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py index a04d33a383..6d918b130a 100644 --- a/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py +++ b/examples/storage/nvs_rw_value/pytest_nvs_rw_value.py @@ -11,6 +11,8 @@ from pytest_embedded import Dut @pytest.mark.esp32c3 @pytest.mark.generic def test_examples_nvs_rw_value(dut: Dut) -> None: + dut.serial.erase_flash() + dut.serial.flash() for i, counter_state in zip_longest(range(4), ('The value is not initialized yet!',), fillvalue='Done'): dut.expect('Opening Non-Volatile Storage \\(NVS\\) handle... Done', timeout=20) dut.expect('Reading restart counter from NVS ... {}'.format(counter_state), timeout=20) diff --git a/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py b/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py index b085002ae3..1666d62c4d 100644 --- a/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py +++ b/examples/storage/nvs_rw_value_cxx/pytest_nvs_rw_value_cxx.py @@ -11,6 +11,8 @@ from pytest_embedded import Dut @pytest.mark.esp32c3 @pytest.mark.generic def test_examples_nvs_rw_value_cxx(dut: Dut) -> None: + dut.serial.erase_flash() + dut.serial.flash() for i, counter_state in zip_longest(range(4), ('The value is not initialized yet!',), fillvalue='Done'): dut.expect('Opening Non-Volatile Storage \\(NVS\\) handle... Done', timeout=20) dut.expect('Reading restart counter from NVS ... {}'.format(counter_state), timeout=20)