tests: net: socket: tls_ext move to new ztest API
Move net/socket/tls_ext tests to use new ztest API TEST=west build -p -b native_posix tests/net/socket/tls_ext Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
This commit is contained in:
parent
5cb53ee1e9
commit
a8bda2ef8f
2 changed files with 8 additions and 13 deletions
|
@ -1,6 +1,7 @@
|
|||
# General config
|
||||
CONFIG_SMP=n
|
||||
CONFIG_ZTEST=y
|
||||
CONFIG_ZTEST_NEW_API=y
|
||||
|
||||
# Networking config
|
||||
CONFIG_TEST_RANDOM_GENERATOR=y
|
||||
|
|
|
@ -401,22 +401,22 @@ static void test_common(int peer_verify)
|
|||
zassert_equal(0, r, "k_thread_join() failed (%d)", r);
|
||||
}
|
||||
|
||||
static void test_tls_peer_verify_none(void)
|
||||
ZTEST(net_socket_tls_api_extension, test_tls_peer_verify_none)
|
||||
{
|
||||
test_common(TLS_PEER_VERIFY_NONE);
|
||||
}
|
||||
|
||||
static void test_tls_peer_verify_optional(void)
|
||||
ZTEST(net_socket_tls_api_extension, test_tls_peer_verify_optional)
|
||||
{
|
||||
test_common(TLS_PEER_VERIFY_OPTIONAL);
|
||||
}
|
||||
|
||||
static void test_tls_peer_verify_required(void)
|
||||
ZTEST(net_socket_tls_api_extension, test_tls_peer_verify_required)
|
||||
{
|
||||
test_common(TLS_PEER_VERIFY_REQUIRED);
|
||||
}
|
||||
|
||||
void test_main(void)
|
||||
static void *setup(void)
|
||||
{
|
||||
int r;
|
||||
|
||||
|
@ -466,13 +466,7 @@ void test_main(void)
|
|||
client_privkey, sizeof(client_privkey));
|
||||
zassert_equal(r, 0, "failed to add Client Private Key (%d)", r);
|
||||
}
|
||||
|
||||
ztest_test_suite(
|
||||
tls_socket_api_extension,
|
||||
ztest_unit_test(test_tls_peer_verify_none),
|
||||
ztest_unit_test(test_tls_peer_verify_optional),
|
||||
ztest_unit_test(test_tls_peer_verify_required)
|
||||
);
|
||||
|
||||
ztest_run_test_suite(tls_socket_api_extension);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ZTEST_SUITE(net_socket_tls_api_extension, NULL, setup, NULL, NULL, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue