fix(storage/nvs): Fixed failing test cases in example folder

This commit is contained in:
radek.tandler
2024-12-20 19:28:11 +01:00
parent f78620853b
commit b4af220c1e
3 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,5 @@
# SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD # SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
import pytest import pytest
from pytest_embedded_idf.dut import IdfDut from pytest_embedded_idf.dut import IdfDut

View File

@ -11,6 +11,8 @@ from pytest_embedded import Dut
@pytest.mark.esp32c3 @pytest.mark.esp32c3
@pytest.mark.generic @pytest.mark.generic
def test_examples_nvs_rw_value(dut: Dut) -> None: 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'): 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('Opening Non-Volatile Storage \\(NVS\\) handle... Done', timeout=20)
dut.expect('Reading restart counter from NVS ... {}'.format(counter_state), timeout=20) dut.expect('Reading restart counter from NVS ... {}'.format(counter_state), timeout=20)

View File

@ -11,6 +11,8 @@ from pytest_embedded import Dut
@pytest.mark.esp32c3 @pytest.mark.esp32c3
@pytest.mark.generic @pytest.mark.generic
def test_examples_nvs_rw_value_cxx(dut: Dut) -> None: 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'): 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('Opening Non-Volatile Storage \\(NVS\\) handle... Done', timeout=20)
dut.expect('Reading restart counter from NVS ... {}'.format(counter_state), timeout=20) dut.expect('Reading restart counter from NVS ... {}'.format(counter_state), timeout=20)