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 A6A2845A9F; Thu, 3 Oct 2024 12:37:47 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6BACC4025E; Thu, 3 Oct 2024 12:37:46 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id B391E400D7 for ; Thu, 3 Oct 2024 12:37:44 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4935UmRo006428 for ; Thu, 3 Oct 2024 03:37:44 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pfpt0220; bh=6SiVoyYKL6WG+LB4nqhLrpX VqJBuB1pQZAVgWUgWr0o=; b=Y/lhOK4ksE936+kS/ZniqSlPRq6a8Q2KU4UbUy+ gTuPX4I+rOFE1SQLgVYqj64flHrqKpDvLVaXavlRrJ6ysreWGo5DWwBxKy6l1Vha VhT07ssqbfuERyTrlLqa7BgED/bQ8GWBJqfTo5X3/IFGNyljr02n57OEodYSi5S7 qD2Aj2nPmCuJOZlHcVezi4TDq80U3J7WVVsEMUAYOrXjT9810CHrDc4LcdLCAdKP YGSDRBSUzPYdXPeO3naQb+9pILxXBMOEAOXAR5gf+Wd5oKoCXVHDpoF32F6x2/E6 A4Dwz1Ts7+QXgSQ9+NL85hG8TpN2u6Y4rXcEr4cnpLELRRA== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 421amr9kwh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 03 Oct 2024 03:37:43 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 3 Oct 2024 03:37:42 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Thu, 3 Oct 2024 03:37:42 -0700 Received: from localhost.localdomain (unknown [10.28.36.175]) by maili.marvell.com (Postfix) with ESMTP id E39345B6927; Thu, 3 Oct 2024 03:37:40 -0700 (PDT) From: Srujana Challa To: CC: , , Subject: [PATCH] test/security: skip IPsec post process for negative tests Date: Thu, 3 Oct 2024 16:07:39 +0530 Message-ID: <20241003103739.1128598-1-schalla@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: qRJrpOipwiodje0d68SdoJBFW6WP1HvM X-Proofpoint-GUID: qRJrpOipwiodje0d68SdoJBFW6WP1HvM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-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 Skips calling test_ipsec_post_process for negative inline IPsec tests as received packet might not be valid for a negative case. Signed-off-by: Srujana Challa --- app/test/test_cryptodev_security_ipsec.c | 1 + app/test/test_security_inline_proto.c | 25 +++++++++++++++++++----- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/app/test/test_cryptodev_security_ipsec.c b/app/test/test_cryptodev_security_ipsec.c index 1aba1ad993..5fb5907473 100644 --- a/app/test/test_cryptodev_security_ipsec.c +++ b/app/test/test_cryptodev_security_ipsec.c @@ -916,6 +916,7 @@ test_ipsec_post_process(const struct rte_mbuf *m, const struct ipsec_test_data * seg = seg->next; } len = RTE_MIN(len, data_len); + TEST_ASSERT(len <= IPSEC_TEXT_MAX_LEN, "Invalid packet length: %u", len); /* Copy mbuf payload to continuous buffer */ output = rte_pktmbuf_read(m, 0, len, output_text); if (output != output_text) diff --git a/app/test/test_security_inline_proto.c b/app/test/test_security_inline_proto.c index 10f7e58caa..480469f672 100644 --- a/app/test/test_security_inline_proto.c +++ b/app/test/test_security_inline_proto.c @@ -1449,12 +1449,27 @@ test_ipsec_inline_proto_process(struct ipsec_test_data *td, for (i = 0; i < nb_rx; i++) { rte_pktmbuf_adj(rx_pkts_burst[i], RTE_ETHER_HDR_LEN); - ret = test_ipsec_post_process(rx_pkts_burst[i], td, - res_d, silent, flags); - if (ret != TEST_SUCCESS) { - for ( ; i < nb_rx; i++) + /* For tests with status as error for test success, + * skip verification + */ + if (td->ipsec_xform.direction == + RTE_SECURITY_IPSEC_SA_DIR_INGRESS && (flags->icv_corrupt || + flags->sa_expiry_pkts_hard || flags->tunnel_hdr_verify || + td->ar_packet)) { + if (!(rx_pkts_burst[i]->ol_flags & + RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED)) { rte_pktmbuf_free(rx_pkts_burst[i]); - goto out; + rx_pkts_burst[i] = NULL; + return TEST_FAILED; + } + } else { + ret = test_ipsec_post_process(rx_pkts_burst[i], td, + res_d, silent, flags); + if (ret != TEST_SUCCESS) { + for ( ; i < nb_rx; i++) + rte_pktmbuf_free(rx_pkts_burst[i]); + goto out; + } } ret = test_ipsec_stats_verify(ctx, ses, flags, -- 2.25.1