From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CF349A04A3; Mon, 3 Jan 2022 16:09:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 056D141141; Mon, 3 Jan 2022 16:09:08 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 46D7941174 for ; Mon, 3 Jan 2022 16:09:06 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 203CKtES014034; Mon, 3 Jan 2022 07:09:04 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=Y3XXfLyQOlxkDNwYxWk9L7VMMB2vaN4nnTo5QEmYcTw=; b=Lj+dX2cbxRx4jw1T5lAjXBLrcQOdZLHxaY5dNSH9dC6oNAsXu5Aqkq+M2FRIjFuQ0ZHe TB4ecuPGra9M5okZVh3SSBp3JAzzrt/CHFb6EDugzOp3GMXrse0Qn8NZyNYmPbMNtEKb OUBsJ3r8IjmiHrIhoOpD3neRL06/LoWGGV9P+HZG+jfF9Ny1IEpwSyY6XpSfOdDd7Oqz e5D90w9732kx00Hf8mAa0gB7zBBTL35rmuI7NNl8nvI6qnq5wfBupKHljvTganfoKbib Kf8MlQepgp91zEchJZ3ASqzdHYh1HoZIuufkxxZ3t6kPmuzQ88cMy4ZrerqCuKMBA5y4 0w== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3dbmvswfah-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 03 Jan 2022 07:09:04 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 3 Jan 2022 07:09:03 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 3 Jan 2022 07:09:03 -0800 Received: from localhost.localdomain (unknown [10.28.48.55]) by maili.marvell.com (Postfix) with ESMTP id 9E7293F7095; Mon, 3 Jan 2022 07:08:59 -0800 (PST) From: Akhil Goyal To: CC: , , , , , , , , , , , Akhil Goyal Subject: [PATCH 8/8] app/test: add IP reassembly negative cases Date: Mon, 3 Jan 2022 20:38:13 +0530 Message-ID: <20220103150813.1694888-9-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220103150813.1694888-1-gakhil@marvell.com> References: <20210823100259.1619886-1-gakhil@marvell.com> <20220103150813.1694888-1-gakhil@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: 3Lnl4Wf_gp5NxwTuxJ_o5Avj9o_EmdL6 X-Proofpoint-GUID: 3Lnl4Wf_gp5NxwTuxJ_o5Avj9o_EmdL6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-03_06,2022-01-01_01,2021-12-02_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org test_inline_ipsec testsuite is added with cases where the IP reassembly is incomplete and software will need to reassemble them later. The failure cases added are: - all fragments are not received. - same fragment is received more than once. - out of order fragments. Signed-off-by: Akhil Goyal --- app/test/test_inline_ipsec.c | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/app/test/test_inline_ipsec.c b/app/test/test_inline_ipsec.c index 3f3731760d..0d74e23359 100644 --- a/app/test/test_inline_ipsec.c +++ b/app/test/test_inline_ipsec.c @@ -936,6 +936,50 @@ test_reassembly_ipv6_5frag(void) { RTE_SECURITY_IPSEC_TUNNEL_IPV6); } +static int +test_reassembly_incomplete(void) { + /* Negative test case, not sending all fragments. */ + struct reassembly_vector ipv4_incomplete_case = { + .sa_data = &conf_aes_128_gcm, + .full_pkt = &pkt_ipv4_udp_p2, + .frags[0] = &pkt_ipv4_udp_p2_f1, + .frags[1] = &pkt_ipv4_udp_p2_f2, + .frags[2] = NULL, + .frags[3] = NULL, + }; + return test_reassembly(&ipv4_incomplete_case, + RTE_SECURITY_IPSEC_TUNNEL_IPV4); +} + +static int +test_reassembly_overlap(void) { + /* Negative test case, sending 1 fragment twice. */ + struct reassembly_vector ipv4_overlap_case = { + .sa_data = &conf_aes_128_gcm, + .full_pkt = &pkt_ipv4_udp_p2, + .frags[0] = &pkt_ipv4_udp_p2_f1, + .frags[1] = &pkt_ipv4_udp_p2_f2, + .frags[2] = &pkt_ipv4_udp_p2_f2, /* overlap */ + .frags[3] = &pkt_ipv4_udp_p2_f3, + }; + return test_reassembly(&ipv4_overlap_case, + RTE_SECURITY_IPSEC_TUNNEL_IPV4); +} + +static int +test_reassembly_out_of_order(void) { + /* Negative test case, sending 1 fragment twice. */ + struct reassembly_vector ipv4_ooo_case = { + .sa_data = &conf_aes_128_gcm, + .full_pkt = &pkt_ipv4_udp_p2, + .frags[0] = &pkt_ipv4_udp_p2_f4, + .frags[1] = &pkt_ipv4_udp_p2_f3, + .frags[2] = &pkt_ipv4_udp_p2_f1, + .frags[3] = &pkt_ipv4_udp_p2_f2, + }; + return test_reassembly(&ipv4_ooo_case, + RTE_SECURITY_IPSEC_TUNNEL_IPV4); +} static struct unit_test_suite inline_ipsec_testsuite = { .suite_name = "Inline IPsec Ethernet Device Unit Test Suite", @@ -969,6 +1013,15 @@ static struct unit_test_suite inline_ipsec_testsuite = { TEST_CASE_ST(ut_setup_inline_ipsec, ut_teardown_inline_ipsec, test_reassembly_ipv6_5frag), + TEST_CASE_ST(ut_setup_inline_ipsec, + ut_teardown_inline_ipsec, + test_reassembly_incomplete), + TEST_CASE_ST(ut_setup_inline_ipsec, + ut_teardown_inline_ipsec, + test_reassembly_overlap), + TEST_CASE_ST(ut_setup_inline_ipsec, + ut_teardown_inline_ipsec, + test_reassembly_out_of_order), TEST_CASES_END() /**< NULL terminate unit test array */ } -- 2.25.1