DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
To: <dev@dpdk.org>
Cc: Fan Zhang <roy.fan.zhang@intel.com>,
	Brian Dooley <brian.dooley@intel.com>,
	Brandon Lo <blo@iol.unh.edu>, Anoob Joseph <anoobj@marvell.com>,
	Archana Muniganti <marchana@marvell.com>,
	Jerin Jacob <jerinj@marvell.com>,
	Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Subject: [PATCH] examples/fips_validation: cleanup bypass tests in response file
Date: Thu, 21 Apr 2022 13:25:52 +0530	[thread overview]
Message-ID: <20220421075552.528836-1-gmuthukrishn@marvell.com> (raw)

Remove garbage entries for bypassed tests in response file.

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 examples/fips_validation/main.c | 74 ++++++++++++++++-----------------
 1 file changed, 35 insertions(+), 39 deletions(-)

diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index 70a389c79b..03dad7eaf9 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -802,7 +802,7 @@ prepare_aes_xform(struct rte_crypto_sym_xform *xform)
 		RTE_LOG(ERR, USER1, "PMD %s key length %u IV length %u\n",
 				info.device_name, cipher_xform->key.length,
 				cipher_xform->iv.length);
-		return -EPERM;
+		return -ENOTSUP;
 	}
 
 	return 0;
@@ -850,7 +850,7 @@ prepare_tdes_xform(struct rte_crypto_sym_xform *xform)
 		RTE_LOG(ERR, USER1, "PMD %s key length %u IV length %u\n",
 				info.device_name, cipher_xform->key.length,
 				cipher_xform->iv.length);
-		return -EPERM;
+		return -ENOTSUP;
 	}
 
 	return 0;
@@ -887,7 +887,7 @@ prepare_hmac_xform(struct rte_crypto_sym_xform *xform)
 		RTE_LOG(ERR, USER1, "PMD %s key length %u IV length %u\n",
 				info.device_name, auth_xform->key.length,
 				auth_xform->digest_length);
-		return -EPERM;
+		return -ENOTSUP;
 	}
 
 	return 0;
@@ -933,7 +933,7 @@ prepare_gcm_xform(struct rte_crypto_sym_xform *xform)
 				aead_xform->digest_length,
 				aead_xform->aad_length,
 				aead_xform->iv.length);
-		return -EPERM;
+		return -ENOTSUP;
 	}
 
 	return 0;
@@ -978,7 +978,7 @@ prepare_gmac_xform(struct rte_crypto_sym_xform *xform)
 				info.device_name, auth_xform->key.length,
 				auth_xform->digest_length,
 				auth_xform->iv.length);
-		return -EPERM;
+		return -ENOTSUP;
 	}
 
 	return 0;
@@ -1016,7 +1016,7 @@ prepare_cmac_xform(struct rte_crypto_sym_xform *xform)
 		RTE_LOG(ERR, USER1, "PMD %s key length %u IV length %u\n",
 				info.device_name, auth_xform->key.length,
 				auth_xform->digest_length);
-		return -EPERM;
+		return -ENOTSUP;
 	}
 
 	return 0;
@@ -1062,7 +1062,7 @@ prepare_ccm_xform(struct rte_crypto_sym_xform *xform)
 				aead_xform->digest_length,
 				aead_xform->aad_length,
 				aead_xform->iv.length);
-		return -EPERM;
+		return -ENOTSUP;
 	}
 
 	return 0;
@@ -1097,7 +1097,7 @@ prepare_sha_xform(struct rte_crypto_sym_xform *xform)
 		RTE_LOG(ERR, USER1, "PMD %s key length %u digest length %u\n",
 				info.device_name, auth_xform->key.length,
 				auth_xform->digest_length);
-		return -EPERM;
+		return -ENOTSUP;
 	}
 
 	return 0;
@@ -1137,7 +1137,7 @@ prepare_xts_xform(struct rte_crypto_sym_xform *xform)
 		RTE_LOG(ERR, USER1, "PMD %s key length %u IV length %u\n",
 				info.device_name, cipher_xform->key.length,
 				cipher_xform->iv.length);
-		return -EPERM;
+		return -ENOTSUP;
 	}
 
 	return 0;
@@ -1252,7 +1252,7 @@ fips_generic_test(void)
 
 	ret = fips_run_test();
 	if (ret < 0) {
-		if (ret == -EPERM || ret == -ENOTSUP) {
+		if (ret == -ENOTSUP) {
 			fprintf(info.fp_wr, "Bypass\n\n");
 			return 0;
 		}
@@ -1287,7 +1287,7 @@ fips_generic_test(void)
 		fprintf(info.fp_wr, "\n");
 	free(val.val);
 
-	return 0;
+	return 1;
 }
 
 static int
@@ -1456,7 +1456,7 @@ fips_mct_tdes_test(void)
 
 	free(val.val);
 
-	return 0;
+	return 1;
 }
 
 static int
@@ -1535,7 +1535,7 @@ fips_mct_aes_ecb_test(void)
 
 	free(val.val);
 
-	return 0;
+	return 1;
 }
 static int
 fips_mct_aes_test(void)
@@ -1643,7 +1643,7 @@ fips_mct_aes_test(void)
 
 	free(val.val);
 
-	return 0;
+	return 1;
 }
 
 static int
@@ -1729,7 +1729,7 @@ fips_mct_sha_test(void)
 
 	free(val.val);
 
-	return 0;
+	return 1;
 }
 
 
@@ -1844,18 +1844,15 @@ fips_test_one_file(void)
 		}
 
 		ret = fips_test_parse_one_case();
-		switch (ret) {
-		case 0:
-			ret = test_ops.test();
-			if (ret == 0)
-				break;
-			RTE_LOG(ERR, USER1, "Error %i: test block\n",
+		if (ret < 0) {
+			RTE_LOG(ERR, USER1, "Error %i: Parse block\n",
 					ret);
 			goto error_one_case;
-		case 1:
-			break;
-		default:
-			RTE_LOG(ERR, USER1, "Error %i: Parse block\n",
+		}
+
+		ret = test_ops.test();
+		if (ret < 0) {
+			RTE_LOG(ERR, USER1, "Error %i: test block\n",
 					ret);
 			goto error_one_case;
 		}
@@ -1905,22 +1902,21 @@ fips_test_one_test_case(void)
 	int ret;
 
 	ret = fips_test_parse_one_json_case();
+	if (ret < 0) {
+		RTE_LOG(ERR, USER1, "Error %i: Parse block\n",
+				ret);
+		goto exit;
+	}
 
-	switch (ret) {
-	case 0:
-		ret = test_ops.test();
-		if (ret == 0)
-			break;
+	ret = test_ops.test();
+	if (ret < 0) {
 		RTE_LOG(ERR, USER1, "Error %i: test block\n",
 				ret);
-		break;
-	case 1:
-		break;
-	default:
-		RTE_LOG(ERR, USER1, "Error %i: Parse block\n",
-				ret);
+		goto exit;
 	}
-	return 0;
+
+exit:
+	return ret;
 }
 
 static int
@@ -1958,8 +1954,8 @@ fips_test_one_test_group(void)
 	tests_size = json_array_size(tests);
 	for (test_idx = 0; test_idx < tests_size; test_idx++) {
 		json_info.json_test_case = json_array_get(tests, test_idx);
-		fips_test_one_test_case();
-		json_array_append_new(write_tests, json_info.json_write_case);
+		if (fips_test_one_test_case() > 0)
+			json_array_append_new(write_tests, json_info.json_write_case);
 	}
 
 	return 0;
-- 
2.25.1


             reply	other threads:[~2022-04-21  7:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21  7:55 Gowrishankar Muthukrishnan [this message]
2022-05-18 15:34 ` Gowrishankar Muthukrishnan
2022-05-19  6:07   ` Gowrishankar Muthukrishnan
2022-05-18 15:39 ` [PATCH v2] examples/fips_validation: reset IV generation in every test group Gowrishankar Muthukrishnan
2022-05-18 15:41 ` [PATCH] examples/fips_validation: add parsing for aes_cbc Gowrishankar Muthukrishnan
2022-05-19  6:09   ` [PATCH v2] " Gowrishankar Muthukrishnan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220421075552.528836-1-gmuthukrishn@marvell.com \
    --to=gmuthukrishn@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=blo@iol.unh.edu \
    --cc=brian.dooley@intel.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=marchana@marvell.com \
    --cc=roy.fan.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).