From patchwork Wed Feb 7 10:59:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 127145 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp355080ljc; Wed, 7 Feb 2018 03:02:34 -0800 (PST) X-Google-Smtp-Source: AH8x225d/+rSfvDgxxTgQUWzVwSkTBbHXfSThcNDDhRJwMH1GeC19kPXeLyAbg0ptRY5jkeDLRPQ X-Received: by 10.200.3.237 with SMTP id z45mr1032229qtg.119.1518001353940; Wed, 07 Feb 2018 03:02:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518001353; cv=none; d=google.com; s=arc-20160816; b=pZdaqqTwGQw8JJahcy4XVeJYw+EjLqOoFd7KGp4iw32E/Osj8Gi50GeRag/nOWA+yi 75bIZtKUkI6NZ8WCSfRmMc8CpI3sNVci/3c7x6oB9BbQeFbigVo3d495sNRwSaTkLxNm Cbet6Xb6XI5YUPPr7EVbMe8erOtvK171E4wv233K/U5JPG27EAjWwV7f0wsZZ+44rTts sLFGX0mIJvIjCnBTqEWPo/juI5tI/kb78fNGia0GA1Fch6IiGkwWRSuUYzVze0dlnTLK tQAxV+6WWp2xDhGP27sII8uD5MM1SxhCWxnyz8l0qDZWZW9LFbk85UWBiDIxoPbuDo29 YKdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=o7/esj6VriAPlnmHX8+s+7/9SSqFsRHW/vwaNUL4Dyc=; b=zs/U1C8/vBXzbzho8wnn6WsHPBJ98pt3fu/0TdKYEUZvGjWpfRca9i/zcyocrV4GrM kYA6wvrFCOL1zdkc0WvnkgCooerMTGVTSmBgd/0krGw6lv/Cdkxh+sTY1917D0yba5qE d3l/dfXngViFTOKWIDDMC57YfViPD5K3T0I+ejA++xJ1nimIPEdDxii+vBxo0KPjS/Eg rVv/M/mpJRJdbvjAytBbU1n4YeumQMhMBmSeDDlKisE3cFhLZVrN0MCdFlD5XMTONmXA vVmwaYPd3wYRVBo3I6ONo5zxSpJ675rLNU+EAwYHGPb4pb3gAJnNNIsU563CHAVP2BQ0 Km8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id i5si1256690qka.304.2018.02.07.03.02.33; Wed, 07 Feb 2018 03:02:33 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id 983A3618E4; Wed, 7 Feb 2018 11:02:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 83CCA61700; Wed, 7 Feb 2018 11:02:15 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id BC8DD616F5; Wed, 7 Feb 2018 11:02:12 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id 0F5A3616F5 for ; Wed, 7 Feb 2018 11:00:49 +0000 (UTC) Received: from mxback10g.mail.yandex.net (mxback10g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:171]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 5372E782EB6 for ; Wed, 7 Feb 2018 14:00:47 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback10g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id X20oFyemQP-0lpOoJPJ; Wed, 07 Feb 2018 14:00:47 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id LVw23zZMqp-0MVGtmP7; Wed, 07 Feb 2018 14:00:22 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Wed, 7 Feb 2018 13:59:56 +0300 Message-Id: <1518001208-29529-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> References: <1518001208-29529-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 457 Subject: [lng-odp] [PATCH API-NEXT v1 2/14] validation: api: check l3/l4 proto types after parsing X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Dmitry Eremin-Solenikov Signed-off-by: Dmitry Eremin-Solenikov --- /** Email created from pull request 457 (lumag:packet-types) ** https://github.com/Linaro/odp/pull/457 ** Patch: https://github.com/Linaro/odp/pull/457.patch ** Base sha: e1175d5a69c65bb465022c9f1381c40fdb5c4069 ** Merge commit sha: 802ddfc5ea6f47a8935993bf6f8c1675a4c94930 **/ test/validation/api/packet/packet.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index 7d19e0125..f829d0cb1 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -2552,6 +2552,10 @@ void packet_test_parse(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); @@ -2582,6 +2586,10 @@ void packet_test_parse(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); @@ -2612,6 +2620,10 @@ void packet_test_parse(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); @@ -2643,6 +2655,10 @@ void packet_test_parse(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); @@ -2674,6 +2690,10 @@ void packet_test_parse(void) CU_ASSERT(odp_packet_has_tcp(pkt[i])); CU_ASSERT(!odp_packet_has_ipv4(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_TCP); } odp_packet_free_multi(pkt, num_pkt);