From 8c5806472e4723e6c2e27a65bdaca454c62b7c76 Mon Sep 17 00:00:00 2001 From: Flavio Ceolin Date: Wed, 15 May 2024 14:09:39 -0700 Subject: [PATCH] tests: random: Move and rename rng test Random number generator is a subsystem and although it is mostly used in crypto, this is not its only utility. Move the current random number generator test to it is own space (tests/subsys/random) and rename it to rng. We need more and better tests for rng, this is an initial commit to organize it and get ready for further tests. Signed-off-by: Flavio Ceolin --- .../rand32 => subsys/random/rng}/CMakeLists.txt | 0 .../random/rng}/entropy_psa_crypto.overlay | 0 tests/{crypto/rand32 => subsys/random/rng}/prj.conf | 0 .../rand32 => subsys/random/rng}/prj_ctr_drbg.conf | 0 .../random/rng}/prj_hw_random_psa_crypto.conf | 0 .../random/rng}/prj_hw_random_xoshiro.conf | 0 .../random/rng}/prj_sw_random_systimer.conf | 0 tests/{crypto/rand32 => subsys/random/rng}/src/main.c | 4 ++-- .../{crypto/rand32 => subsys/random/rng}/testcase.yaml | 10 +++++----- 9 files changed, 7 insertions(+), 7 deletions(-) rename tests/{crypto/rand32 => subsys/random/rng}/CMakeLists.txt (100%) rename tests/{crypto/rand32 => subsys/random/rng}/entropy_psa_crypto.overlay (100%) rename tests/{crypto/rand32 => subsys/random/rng}/prj.conf (100%) rename tests/{crypto/rand32 => subsys/random/rng}/prj_ctr_drbg.conf (100%) rename tests/{crypto/rand32 => subsys/random/rng}/prj_hw_random_psa_crypto.conf (100%) rename tests/{crypto/rand32 => subsys/random/rng}/prj_hw_random_xoshiro.conf (100%) rename tests/{crypto/rand32 => subsys/random/rng}/prj_sw_random_systimer.conf (100%) rename tests/{crypto/rand32 => subsys/random/rng}/src/main.c (96%) rename tests/{crypto/rand32 => subsys/random/rng}/testcase.yaml (83%) diff --git a/tests/crypto/rand32/CMakeLists.txt b/tests/subsys/random/rng/CMakeLists.txt similarity index 100% rename from tests/crypto/rand32/CMakeLists.txt rename to tests/subsys/random/rng/CMakeLists.txt diff --git a/tests/crypto/rand32/entropy_psa_crypto.overlay b/tests/subsys/random/rng/entropy_psa_crypto.overlay similarity index 100% rename from tests/crypto/rand32/entropy_psa_crypto.overlay rename to tests/subsys/random/rng/entropy_psa_crypto.overlay diff --git a/tests/crypto/rand32/prj.conf b/tests/subsys/random/rng/prj.conf similarity index 100% rename from tests/crypto/rand32/prj.conf rename to tests/subsys/random/rng/prj.conf diff --git a/tests/crypto/rand32/prj_ctr_drbg.conf b/tests/subsys/random/rng/prj_ctr_drbg.conf similarity index 100% rename from tests/crypto/rand32/prj_ctr_drbg.conf rename to tests/subsys/random/rng/prj_ctr_drbg.conf diff --git a/tests/crypto/rand32/prj_hw_random_psa_crypto.conf b/tests/subsys/random/rng/prj_hw_random_psa_crypto.conf similarity index 100% rename from tests/crypto/rand32/prj_hw_random_psa_crypto.conf rename to tests/subsys/random/rng/prj_hw_random_psa_crypto.conf diff --git a/tests/crypto/rand32/prj_hw_random_xoshiro.conf b/tests/subsys/random/rng/prj_hw_random_xoshiro.conf similarity index 100% rename from tests/crypto/rand32/prj_hw_random_xoshiro.conf rename to tests/subsys/random/rng/prj_hw_random_xoshiro.conf diff --git a/tests/crypto/rand32/prj_sw_random_systimer.conf b/tests/subsys/random/rng/prj_sw_random_systimer.conf similarity index 100% rename from tests/crypto/rand32/prj_sw_random_systimer.conf rename to tests/subsys/random/rng/prj_sw_random_systimer.conf diff --git a/tests/crypto/rand32/src/main.c b/tests/subsys/random/rng/src/main.c similarity index 96% rename from tests/crypto/rand32/src/main.c rename to tests/subsys/random/rng/src/main.c index 5436c627cd5..e1b6fc8357e 100644 --- a/tests/crypto/rand32/src/main.c +++ b/tests/subsys/random/rng/src/main.c @@ -26,7 +26,7 @@ * */ -ZTEST(rand32_common, test_rand32) +ZTEST(rng_common, test_rand32) { uint32_t gen, last_gen, tmp; int rnd_cnt; @@ -115,4 +115,4 @@ ZTEST(rand32_common, test_rand32) #endif /* CONFIG_CSPRNG_ENABLED */ } -ZTEST_SUITE(rand32_common, NULL, NULL, NULL, NULL, NULL); +ZTEST_SUITE(rng_common, NULL, NULL, NULL, NULL, NULL); diff --git a/tests/crypto/rand32/testcase.yaml b/tests/subsys/random/rng/testcase.yaml similarity index 83% rename from tests/crypto/rand32/testcase.yaml rename to tests/subsys/random/rng/testcase.yaml index 5561511b2c6..7534548a3dc 100644 --- a/tests/crypto/rand32/testcase.yaml +++ b/tests/subsys/random/rng/testcase.yaml @@ -4,27 +4,27 @@ common: - random - security tests: - crypto.rand32: + crypto.rng: min_ram: 16 integration_platforms: - qemu_x86 - crypto.rand32.random_sw_systimer: + crypto.rng.random_sw_systimer: extra_args: CONF_FILE=prj_sw_random_systimer.conf integration_platforms: - qemu_x86 - crypto.rand32.random_hw_xoshiro: + crypto.rng.random_hw_xoshiro: extra_args: CONF_FILE=prj_hw_random_xoshiro.conf filter: CONFIG_ENTROPY_HAS_DRIVER min_ram: 16 integration_platforms: - native_sim - crypto.rand32.random_ctr_drbg: + crypto.rng.random_ctr_drbg: extra_args: CONF_FILE=prj_ctr_drbg.conf filter: CONFIG_ENTROPY_HAS_DRIVER min_ram: 16 integration_platforms: - native_sim - drivers.rand32.random_psa_crypto: + drivers.rng.random_psa_crypto: filter: CONFIG_BUILD_WITH_TFM arch_exclude: posix extra_args: