[v7,3/3] test/crypto: skip asym test for insecure algorithms

Message ID 20230616140054.405194-3-vikash.chandrax.poddar@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v7,1/3] common/qat: fix qat_dev_cmd_param corruption |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Vikash Poddar June 16, 2023, 2 p.m. UTC
  Added support to skip the insecure asym algorithms

Signed-off-by: Vikash Poddar <vikash.chandrax.poddar@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
---
v7:
splitted from "support to enable insecure algorithms" patch
---
 app/test/test_cryptodev_asym.c | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)
  

Patch

diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index e884556a2d..15a1f3d638 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -454,11 +454,14 @@  test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 		ret = rte_cryptodev_asym_session_create(dev_id, &xform_tc,
 				ts_params->session_mpool, &sess);
 		if (ret < 0) {
-			snprintf(test_msg, ASYM_TEST_MSG_LEN,
-					"line %u "
-					"FAILED: %s", __LINE__,
-					"Session creation failed");
 			status = (ret == -ENOTSUP) ? TEST_SKIPPED : TEST_FAILED;
+			if (status == TEST_SKIPPED)
+				snprintf(test_msg, ASYM_TEST_MSG_LEN, "SKIPPED");
+			else
+				snprintf(test_msg, ASYM_TEST_MSG_LEN,
+						"line %u "
+						"FAILED: %s", __LINE__,
+						"Session creation failed");
 			goto error_exit;
 		}
 
@@ -490,6 +493,11 @@  test_cryptodev_asym_op(struct crypto_testsuite_params_asym *ts_params,
 	}
 
 	if (test_cryptodev_asym_ver(op, &xform_tc, data_tc, result_op) != TEST_SUCCESS) {
+		if (result_op->status == RTE_CRYPTO_OP_STATUS_INVALID_ARGS) {
+			snprintf(test_msg, ASYM_TEST_MSG_LEN, "SESSIONLESS SKIPPED");
+			status = TEST_SKIPPED;
+			goto error_exit;
+		}
 		snprintf(test_msg, ASYM_TEST_MSG_LEN,
 			"line %u FAILED: %s",
 			__LINE__, "Verification failed ");
@@ -620,13 +628,19 @@  test_one_by_one(void)
 	/* Go through all test cases */
 	test_index = 0;
 	for (i = 0; i < test_vector.size; i++) {
-		if (test_one_case(test_vector.address[i], 0) != TEST_SUCCESS)
+		status = test_one_case(test_vector.address[i], 0);
+		if (status == TEST_SUCCESS || status == TEST_SKIPPED)
+			status = TEST_SUCCESS;
+		else
 			status = TEST_FAILED;
 	}
+
 	if (sessionless) {
 		for (i = 0; i < test_vector.size; i++) {
-			if (test_one_case(test_vector.address[i], 1)
-					!= TEST_SUCCESS)
+			status = test_one_case(test_vector.address[i], 1);
+			if (status == TEST_SUCCESS || status == TEST_SKIPPED)
+				status = TEST_SUCCESS;
+			else
 				status = TEST_FAILED;
 		}
 	}