diff mbox series

[v3,3/11] validation: pktio: parser: add SCTP test

Message ID 1534762808-15588-4-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v3,1/11] validation: pktio: check sctp flag in parser tests | expand

Commit Message

Github ODP bot Aug. 20, 2018, 11 a.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Add SCTP packet parsing test, checking that protocol is properly
recognized.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 674 (lumag:sctp-checksum)
 ** https://github.com/Linaro/odp/pull/674
 ** Patch: https://github.com/Linaro/odp/pull/674.patch
 ** Base sha: dc28824415ea510e3ef62e47f7640bf4a8420fde
 ** Merge commit sha: b482f9618a6edb2a2f2491ee5a7af757eab93b24
 **/
 test/validation/api/pktio/parser.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff mbox series

Patch

diff --git a/test/validation/api/pktio/parser.c b/test/validation/api/pktio/parser.c
index f22a62555..10c7962f0 100644
--- a/test/validation/api/pktio/parser.c
+++ b/test/validation/api/pktio/parser.c
@@ -381,6 +381,24 @@  static void parser_test_vlan_qinq_ipv4_udp(void)
 	odp_packet_free(pkt);
 }
 
+static void parser_test_ipv4_sctp(void)
+{
+	odp_packet_t pkt;
+
+	pkt = loopback_packet(pktio_a, pktio_b, test_packet_ipv4_sctp,
+			      sizeof(test_packet_ipv4_sctp));
+	CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID);
+	CU_ASSERT(odp_packet_has_eth(pkt));
+	CU_ASSERT(odp_packet_has_ipv4(pkt));
+	CU_ASSERT(odp_packet_has_sctp(pkt));
+
+	CU_ASSERT(!odp_packet_has_ipv6(pkt));
+	CU_ASSERT(!odp_packet_has_tcp(pkt));
+	CU_ASSERT(!odp_packet_has_udp(pkt));
+
+	odp_packet_free(pkt);
+}
+
 static void parser_test_ipv6_icmp(void)
 {
 	odp_packet_t pkt;
@@ -564,6 +582,7 @@  odp_testinfo_t parser_suite[] = {
 	ODP_TEST_INFO(parser_test_ipv4_udp),
 	ODP_TEST_INFO_CONDITIONAL(parser_test_vlan_ipv4_udp, loop_pktio),
 	ODP_TEST_INFO_CONDITIONAL(parser_test_vlan_qinq_ipv4_udp, loop_pktio),
+	ODP_TEST_INFO(parser_test_ipv4_sctp),
 	ODP_TEST_INFO(parser_test_ipv6_icmp),
 	ODP_TEST_INFO(parser_test_ipv6_tcp),
 	ODP_TEST_INFO(parser_test_ipv6_udp),