test: Update the new ZTEST APIs tests/net/promiscuous

TEST=twister -T tests/net/promiscuous

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
This commit is contained in:
Hu Zhenyu 2022-07-05 16:30:30 +08:00 committed by Carles Cufí
parent 21092ae367
commit a2b49ec10c
2 changed files with 11 additions and 11 deletions

View File

@ -22,3 +22,4 @@ CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=6
CONFIG_NET_IPV6_MAX_NEIGHBORS=1
CONFIG_NET_IPV6_ND=n
CONFIG_ZTEST=y
CONFIG_ZTEST_NEW_API=y

View File

@ -380,16 +380,15 @@ static void test_verify_data(void)
net_pkt_unref(pkt);
}
void test_main(void)
ZTEST(net_promisc_test_suite, test_net_promisc)
{
ztest_test_suite(net_promisc_test,
ztest_unit_test(test_iface_setup),
ztest_unit_test(test_set_promisc_mode_on),
ztest_unit_test(test_set_promisc_mode_on_again),
ztest_unit_test(test_recv_data),
ztest_unit_test(test_verify_data),
ztest_unit_test(test_set_promisc_mode_off),
ztest_unit_test(test_set_promisc_mode_off_again));
ztest_run_test_suite(net_promisc_test);
test_iface_setup();
test_set_promisc_mode_on();
test_set_promisc_mode_on_again();
test_recv_data();
test_verify_data();
test_set_promisc_mode_off();
test_set_promisc_mode_off_again();
}
ZTEST_SUITE(net_promisc_test_suite, NULL, NULL, NULL, NULL, NULL);