pytest_nvs_flash.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. # SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
  2. # SPDX-License-Identifier: Apache-2.0
  3. import pytest
  4. from pytest_embedded_idf.dut import IdfDut
  5. CONFIGS_NVS_ENCR_FLASH_ENC = [
  6. pytest.param('nvs_encr_flash_enc_esp32', marks=[pytest.mark.esp32]),
  7. pytest.param('nvs_encr_flash_enc_esp32c3', marks=[pytest.mark.esp32c3]),
  8. ]
  9. @pytest.mark.supported_targets
  10. @pytest.mark.generic
  11. @pytest.mark.parametrize('config', ['default'], indirect=True)
  12. def test_nvs_flash(dut: IdfDut) -> None:
  13. dut.expect_exact('Press ENTER to see the list of tests')
  14. dut.write('![nvs_encr_hmac]')
  15. dut.expect_unity_test_output(timeout=120)
  16. @pytest.mark.esp32c3
  17. @pytest.mark.nvs_encr_hmac
  18. @pytest.mark.parametrize('config', ['nvs_encr_hmac_esp32c3'], indirect=True)
  19. def test_nvs_flash_encr_hmac(dut: IdfDut) -> None:
  20. dut.run_all_single_board_cases()
  21. @pytest.mark.flash_encryption
  22. @pytest.mark.parametrize('config', CONFIGS_NVS_ENCR_FLASH_ENC, indirect=True)
  23. def test_nvs_flash_encr_flash_enc(dut: IdfDut) -> None:
  24. # Erase the nvs_key partition
  25. dut.serial.erase_partition('nvs_key')
  26. dut.run_all_single_board_cases()