Merge branch 'ci/fix_efuse_example_test' into 'master'

examples(efuse): Enable all tests on CI

See merge request espressif/esp-idf!22118
This commit is contained in:
Mahavir Jain 2023-01-25 11:17:17 +08:00
commit ef242ed68b
6 changed files with 18 additions and 4 deletions

View File

@ -363,7 +363,11 @@ bool esp_secure_boot_cfg_verify_release_mode(void)
}
#endif
++num_keys;
#if SOC_EFUSE_CONSISTS_OF_ONE_KEY_BLOCK
secure = !esp_efuse_read_field_bit(ESP_EFUSE_RD_DIS_KEY0_HI);
#else
secure = !esp_efuse_get_key_dis_read(block);
#endif // !SOC_EFUSE_CONSISTS_OF_ONE_KEY_BLOCK
result &= secure;
if (!secure) {
ESP_LOGE(TAG, "Secure boot key in BLOCK%d must NOT be read-protected (can not be used)", block);

View File

@ -355,6 +355,7 @@ def test_examples_efuse_with_virt_secure_boot_v1_pre_loaded(dut: Dut) -> None:
dut.expect('example: Done')
@pytest.mark.generic
@pytest.mark.esp32
@pytest.mark.parametrize('config', [('virt_secure_boot_v2.esp32'),], indirect=True)
@pytest.mark.parametrize('skip_autoflash', ['y'], indirect=True)
@ -470,15 +471,16 @@ def test_examples_efuse_with_virt_secure_boot_v2(dut: Dut) -> None:
dut.expect('example: Done')
@pytest.mark.generic
@pytest.mark.esp32
@pytest.mark.parametrize('config', [('virt_secure_boot_v2.esp32'),], indirect=True)
@pytest.mark.parametrize('skip_autoflash', ['y'], indirect=True)
def test_examples_efuse_with_virt_secure_boot_v2_pre_loaded(dut: Dut) -> None:
print(' - Erase flash')
dut.erase_flash()
dut.serial.erase_flash()
print(' - Flash bootloader and app')
dut.bootloader_flash()
dut.serial.bootloader_flash()
print(' - Start app (flash partition_table and app)')
dut.serial.flash()
dut.expect('Loading virtual efuse blocks from real efuses')
@ -778,6 +780,7 @@ def test_examples_efuse_with_virt_sb_v1_and_fe(dut: Dut) -> None:
dut.expect('example: Done')
@pytest.mark.generic
@pytest.mark.esp32
@pytest.mark.parametrize('config', ['virt_sb_v2_and_fe.esp32',], indirect=True)
@pytest.mark.parametrize('skip_autoflash', ['y'], indirect=True)
@ -818,7 +821,7 @@ def test_examples_efuse_with_virt_sb_v2_and_fe(dut: Dut) -> None:
dut.expect('secure_boot_v2: blowing secure boot efuse...')
dut.expect('Disable JTAG...')
dut.expect('Disable ROM BASIC interpreter fallback...')
dut.expect('UART ROM Download mode kept enabled - SECURITY COMPROMISED')
dut.expect('Disable ROM Download mode...')
dut.expect('secure_boot_v2: Secure boot permanently enabled')
dut.expect('Checking flash encryption...')
@ -900,7 +903,7 @@ def test_examples_efuse_with_virt_sb_v2_and_fe_esp32xx(dut: Dut) -> None:
dut.expect_exact('secure_boot_v2: Revoking empty key digest slot (1)...')
dut.expect_exact('secure_boot_v2: Revoking empty key digest slot (2)...')
dut.expect('secure_boot_v2: blowing secure boot efuse...')
dut.expect('UART ROM Download mode kept enabled - SECURITY COMPROMISED')
dut.expect('Enabling Security download mode...')
dut.expect('Disable hardware & software JTAG...')
if dut.app.target != 'esp32c2':
@ -948,6 +951,7 @@ def test_examples_efuse_with_virt_sb_v2_and_fe_esp32xx(dut: Dut) -> None:
dut.expect('example: Done')
@pytest.mark.generic
@pytest.mark.esp32c3
@pytest.mark.parametrize('config', ['virt_sb_v2_and_fe.esp32c3'], indirect=True)
@pytest.mark.parametrize('skip_autoflash', ['y'], indirect=True)
@ -955,6 +959,7 @@ def test_examples_efuse_with_virt_sb_v2_and_fe_esp32c3(dut: Dut) -> None:
test_examples_efuse_with_virt_sb_v2_and_fe_esp32xx(dut)
@pytest.mark.generic
@pytest.mark.esp32c2
@pytest.mark.parametrize('config', ['virt_sb_v2_and_fe.esp32c2'], indirect=True)
@pytest.mark.parametrize('skip_autoflash', ['y'], indirect=True)
@ -962,6 +967,7 @@ def test_examples_efuse_with_virt_sb_v2_and_fe_esp32c2(dut: Dut) -> None:
test_examples_efuse_with_virt_sb_v2_and_fe_esp32xx(dut)
@pytest.mark.generic
@pytest.mark.esp32s2
@pytest.mark.parametrize('config', ['virt_sb_v2_and_fe.esp32s2'], indirect=True)
@pytest.mark.parametrize('skip_autoflash', ['y'], indirect=True)

View File

@ -13,6 +13,7 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="test/partitions_efuse_emul.csv"
CONFIG_SECURE_BOOT=y
CONFIG_SECURE_BOOT_V2_ENABLED=y
CONFIG_SECURE_BOOT_SIGNING_KEY="test/secure_boot_signing_key.pem"
CONFIG_SECURE_DISABLE_ROM_DL_MODE=y
CONFIG_SECURE_FLASH_ENC_ENABLED=y

View File

@ -9,6 +9,7 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="test/partitions_efuse_emul.csv"
CONFIG_SECURE_BOOT=y
CONFIG_SECURE_BOOT_V2_ENABLED=y
CONFIG_SECURE_BOOT_SIGNING_KEY="test/secure_boot_signing_key_ecdsa_nistp256.pem"
CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE=y
CONFIG_SECURE_FLASH_ENC_ENABLED=y

View File

@ -13,6 +13,7 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="test/partitions_efuse_emul.csv"
CONFIG_SECURE_BOOT=y
CONFIG_SECURE_BOOT_V2_ENABLED=y
CONFIG_SECURE_BOOT_SIGNING_KEY="test/secure_boot_signing_key.pem"
CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE=y
CONFIG_SECURE_FLASH_ENC_ENABLED=y

View File

@ -9,6 +9,7 @@ CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="test/partitions_efuse_emul.csv"
CONFIG_SECURE_BOOT=y
CONFIG_SECURE_BOOT_V2_ENABLED=y
CONFIG_SECURE_BOOT_SIGNING_KEY="test/secure_boot_signing_key.pem"
CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE=y
CONFIG_SECURE_FLASH_ENC_ENABLED=y