ci(esp_security): Enable crypto drivers test app build only for supported targets

This commit is contained in:
harshal.patil
2024-10-03 11:23:24 +05:30
parent f2c26b8ec0
commit 9e3a846356
7 changed files with 25 additions and 28 deletions

View File

@@ -1,7 +1,5 @@
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps
components/esp_security/test_apps/crypto_drivers:
disable:
- if: IDF_TARGET in ["esp32c61"]
temporary: true
reason: Support for ESP32C61 is yet to be added.
enable:
- if: ((SOC_HMAC_SUPPORTED == 1) or (SOC_DIG_SIGN_SUPPORTED == 1)) or (SOC_KEY_MANAGER_SUPPORTED == 1)

View File

@@ -1,3 +1,3 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
| Supported Targets | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |

View File

@@ -1,7 +1,16 @@
set(srcs "test_app_main.c"
"test_ds.c"
"test_hmac.c"
"test_key_mgr.c")
set(srcs "test_app_main.c")
if(CONFIG_SOC_HMAC_SUPPORTED)
list(APPEND srcs "test_hmac.c")
endif()
if(CONFIG_SOC_DIG_SIGN_SUPPORTED)
list(APPEND srcs "test_ds.c")
endif()
if(CONFIG_SOC_KEY_MANAGER_SUPPORTED)
list(APPEND srcs "test_key_mgr.c")
endif()
idf_component_register(SRCS ${srcs}
REQUIRES unity efuse test_utils spi_flash esp_security

View File

@@ -8,8 +8,6 @@
#include "unity.h"
#include "soc/soc_caps.h"
#if SOC_DIG_SIGN_SUPPORTED
#include "rom/efuse.h"
#if CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/digital_signature.h"
@@ -438,4 +436,3 @@ TEST_CASE("Digital Signature Invalid Data (FPGA only)", "[hw_crypto] [ds]")
}
#endif // CONFIG_IDF_ENV_FPGA
#endif // SOC_DIG_SIGN_SUPPORTED

View File

@@ -8,8 +8,6 @@
#include "esp_efuse.h"
#include "esp_efuse_table.h"
#include "esp_log.h"
#if SOC_HMAC_SUPPORTED
#include "esp_hmac.h"
#if CONFIG_IDF_ENV_FPGA
@@ -1315,5 +1313,3 @@ TEST_CASE("HMAC key out of range", "[hw_crypto]")
TEST_ASSERT_EQUAL(ESP_ERR_INVALID_ARG, esp_hmac_calculate(HMAC_KEY0 - 1, message, 47, hmac));
TEST_ASSERT_EQUAL(ESP_ERR_INVALID_ARG, esp_hmac_calculate(HMAC_KEY5 + 1, message, 47, hmac));
}
#endif // SOC_HMAC_SUPPORTED

View File

@@ -7,7 +7,6 @@
#include "unity.h"
#include "soc/soc_caps.h"
#if SOC_KEY_MANAGER_SUPPORTED
#include "esp_partition.h"
#include "esp_flash.h"
#include "esp_log.h"
@@ -143,4 +142,3 @@ TEST_CASE("Key Manager random mode: ECDSA key deployment", "[hw_crypto] [key_mgr
esp_ret = esp_key_mgr_deploy_key_in_random_mode(&key_config, &key_info);
TEST_ASSERT_EQUAL(ESP_OK, esp_ret);
}
#endif

View File

@@ -1,17 +1,16 @@
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.esp32h2
@pytest.mark.esp32p4
@pytest.mark.esp32c5
@pytest.mark.generic
@pytest.mark.temp_skip_ci(targets=['esp32c61'], reason='Support for ESP32C61 is yet to be added.') # TODO: [ESP32C61] IDF-10987
@pytest.mark.parametrize(
'config',
[
pytest.param('default', marks=[pytest.mark.supported_targets]),
],
indirect=True,
)
def test_crypto_drivers(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=180)