[v2,2/13] validation: api: check l3/l4 proto types after parsing

Message ID 1519938053-24031-3-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • merge patches from api-next
Related show

Commit Message

Github ODP bot March 1, 2018, 9 p.m.
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


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

Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>

Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
/** Email created from pull request 505 (muvarov:devel/master_merge_api-next)
 ** https://github.com/Linaro/odp/pull/505
 ** Patch: https://github.com/Linaro/odp/pull/505.patch
 ** Base sha: 284f52d72ec19df3774c7409780f1f9eea33b8e6
 ** Merge commit sha: 5da68bf06572d3d0651c37cbba03aa91995ec465
 **/
 test/validation/api/packet/packet.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Patch

diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c
index 03449f26e..104d6c7dc 100644
--- a/test/validation/api/packet/packet.c
+++ b/test/validation/api/packet/packet.c
@@ -2605,6 +2605,10 @@  static void parse_eth_ipv4_udp(void)
 		CU_ASSERT(odp_packet_has_udp(pkt[i]));
 		CU_ASSERT(!odp_packet_has_ipv6(pkt[i]));
 		CU_ASSERT(!odp_packet_has_tcp(pkt[i]));
+		CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]),
+				ODP_PROTO_L3_TYPE_IPV4);
+		CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]),
+				ODP_PROTO_L4_TYPE_UDP);
 	}
 
 	odp_packet_free_multi(pkt, num_pkt);
@@ -2638,6 +2642,10 @@  static void parse_ipv4_udp(void)
 		CU_ASSERT(odp_packet_has_udp(pkt[i]));
 		CU_ASSERT(!odp_packet_has_ipv6(pkt[i]));
 		CU_ASSERT(!odp_packet_has_tcp(pkt[i]));
+		CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]),
+				ODP_PROTO_L3_TYPE_IPV4);
+		CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]),
+				ODP_PROTO_L4_TYPE_UDP);
 	}
 
 	odp_packet_free_multi(pkt, num_pkt);
@@ -2668,6 +2676,10 @@  static void parse_eth_ipv4_tcp(void)
 		CU_ASSERT(odp_packet_has_tcp(pkt[i]));
 		CU_ASSERT(!odp_packet_has_ipv6(pkt[i]));
 		CU_ASSERT(!odp_packet_has_udp(pkt[i]));
+		CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]),
+				ODP_PROTO_L3_TYPE_IPV4);
+		CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]),
+				ODP_PROTO_L4_TYPE_TCP);
 	}
 
 	odp_packet_free_multi(pkt, num_pkt);
@@ -2790,6 +2802,10 @@  static void parse_eth_vlan_ipv6_udp(void)
 		CU_ASSERT(odp_packet_has_udp(pkt[i]));
 		CU_ASSERT(!odp_packet_has_ipv4(pkt[i]));
 		CU_ASSERT(!odp_packet_has_tcp(pkt[i]));
+		CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]),
+				ODP_PROTO_L3_TYPE_IPV6);
+		CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]),
+				ODP_PROTO_L4_TYPE_UDP);
 	}
 
 	odp_packet_free_multi(pkt, num_pkt);
@@ -3040,6 +3056,10 @@  static void parse_eth_ipv6_ipsec_ah(void)
 		CU_ASSERT(!odp_packet_has_ipv4(pkt[i]));
 		CU_ASSERT(!odp_packet_has_tcp(pkt[i]));
 		CU_ASSERT(!odp_packet_has_udp(pkt[i]));
+		CU_ASSERT_EQUAL(odp_packet_l3_type(pkt[i]),
+				ODP_PROTO_L3_TYPE_IPV6);
+		CU_ASSERT_EQUAL(odp_packet_l4_type(pkt[i]),
+				ODP_PROTO_L4_TYPE_AH);
 	}
 
 	odp_packet_free_multi(pkt, num_pkt);