From patchwork Tue Aug 21 09:59:58 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: 144699 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5062192ljj; Tue, 21 Aug 2018 03:02:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbHs75KOz6brzdLGKGYcQ3h6H0Fq48hN3p/eLSFSeJDGaNQP1ueUbSnCvPjEMtj5ZH5dbHK X-Received: by 2002:a37:3554:: with SMTP id c81-v6mr2134278qka.30.1534845775554; Tue, 21 Aug 2018 03:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534845775; cv=none; d=google.com; s=arc-20160816; b=HLI2CL1E68lgloEo1djge6GCDJgnEd9RPSkON5p5cMOfuBivYzVJTVEpUdpC2iTuU7 cSsog9AbYBqD7pLn4127mghxptOKNuCzW2egIjcv9OjcNnhWKpu69g6V1l4rUCz61z6q 59VcatrBINrvsEqE0WCBAF9ZsivIn5VhWZIWnQtzxc7iTRxTfQr3PaHLVjcLi5MG2cOP BGyKT0Pa0en/lNd7SGAakDO+/gJHAiGCbIKZ4jsblVdRrshkt8+/L/9TOxSxF+gOsY5L 2HJ11bRzcqt+19U61VdhJfzkdMPlb0LEpHFmRU0Yej/KS22KiMGTDaq/xRADc31DcVcE VkBA== 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=WjlMFyg50XvUvF2XMNrIaiA3L6n2ZjxW8r1rRriV5jU=; b=prgieiYEcCDWeM3bMBxDckGnYh58lfkcUxyb4SKO/RR0oXT7PgSeWJ8xKWg4JyuKSW IRCGp459S+mwiBxvPL2naKJmBiJUmPE6RCg0hdCsA5ZTO22dWV1GzGRlR/Wa+azABkah TuM5HiDu0xk1iYgpI3aHZN2pWamTgXNv1pNSbGSg5YvAZWRaCh3gBzCQ0VuDVxgIySEV 3StEq310sN8jimXTFg2AbiZW/w/sBUUBd2aHRvRdAY2o5cRfdBDyUzmt6hJcN4wNoWwi +dSj/x3odU6dli1mUjU1pfiesZv2q81tDp4+BpsyXzL4wXi3DnIfqPbTo9LN48sIouZk R9jw== 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 x32-v6si900446qvc.3.2018.08.21.03.02.55; Tue, 21 Aug 2018 03:02:55 -0700 (PDT) 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 327D46865C; Tue, 21 Aug 2018 10:02:55 +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=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW 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 135C868620; Tue, 21 Aug 2018 10:00:48 +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 73C626861F; Tue, 21 Aug 2018 10:00:24 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 2774160816 for ; Tue, 21 Aug 2018 10:00:18 +0000 (UTC) Received: from mxback1o.mail.yandex.net (mxback1o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1b]) by forward103j.mail.yandex.net (Yandex) with ESMTP id E78D134C374B for ; Tue, 21 Aug 2018 13:00:12 +0300 (MSK) Received: from smtp1o.mail.yandex.net (smtp1o.mail.yandex.net [2a02:6b8:0:1a2d::25]) by mxback1o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id LNIr4K1OH2-0CdWuf61; Tue, 21 Aug 2018 13:00:12 +0300 Received: by smtp1o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id eJZOyRH8Gd-0BouT9NN; Tue, 21 Aug 2018 13:00:12 +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: Tue, 21 Aug 2018 09:59:58 +0000 Message-Id: <1534845606-17334-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534845606-17334-1-git-send-email-odpbot@yandex.ru> References: <1534845606-17334-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 674 Subject: [lng-odp] [PATCH v5 4/12] validation: pktio: parser: add SCTP test 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 Add SCTP packet parsing test, checking that protocol is properly recognized. Signed-off-by: Dmitry Eremin-Solenikov --- /** 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: 912e026c108d7a496ac7467e953dea77dadaaa57 ** Merge commit sha: 9ab290c4f721a97e8c289b8a7992e6cc6614e7c3 **/ test/validation/api/pktio/parser.c | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/test/validation/api/pktio/parser.c b/test/validation/api/pktio/parser.c index f22a62555..db37c1c5b 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; @@ -455,6 +473,24 @@ static void parser_test_vlan_ipv6_udp(void) odp_packet_free(pkt); } +static void parser_test_ipv6_sctp(void) +{ + odp_packet_t pkt; + + pkt = loopback_packet(pktio_a, pktio_b, test_packet_ipv6_sctp, + sizeof(test_packet_ipv6_sctp)); + CU_ASSERT_FATAL(pkt != ODP_PACKET_INVALID); + CU_ASSERT(odp_packet_has_eth(pkt)); + CU_ASSERT(odp_packet_has_ipv6(pkt)); + CU_ASSERT(odp_packet_has_sctp(pkt)); + + CU_ASSERT(!odp_packet_has_ipv4(pkt)); + CU_ASSERT(!odp_packet_has_tcp(pkt)); + CU_ASSERT(!odp_packet_has_udp(pkt)); + + odp_packet_free(pkt); +} + int parser_suite_init(void) { int i; @@ -564,9 +600,11 @@ 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), ODP_TEST_INFO_CONDITIONAL(parser_test_vlan_ipv6_udp, loop_pktio), + ODP_TEST_INFO(parser_test_ipv6_sctp), ODP_TEST_INFO_NULL };