Skip to contentSkip to conversation

test/crypto: skip unsupported cases

PATCH Superseded [email protected] 4 participants 7 messages May 20, 2020 – Jul 20, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test/crypto: skip unsupported cases

From: Akhil Goyal <[email protected]>

blockcipher cases are either returning TEST_SUCCESS or TEST_FAILED as status, but the test may not be supported by the PMD which is also a success case for the PMD. Hence checking for status == TEST_FAILED for setting the overall status as failed.

---
 app/test/test_cryptodev_blockcipher.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
app/test/test_cryptodev_blockcipher.c +7 -6
index 642b549717..d033350659 100644
@@ -107,7 +107,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 				"Test Skipped.\n");
 			snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
 				"SKIPPED");
-			return 0;
+			return TEST_SKIPPED;
 		}
 	}
 	if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SG) {
@@ -120,7 +120,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 					"Test Skipped.\n");
 				snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
 					"SKIPPED");
-				return 0;
+				return TEST_SKIPPED;
 			}
 		} else {
 			if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) {
@@ -129,7 +129,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 					"Test Skipped.\n");
 				snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
 					"SKIPPED");
-				return 0;
+				return TEST_SKIPPED;
 			}
 		}
 
@@ -146,7 +146,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 				"Test Skipped.\n");
 			snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
 				"SKIPPED");
-			return 0;
+			return TEST_SKIPPED;
 		}
 	}
 
@@ -163,7 +163,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 			"Device does not support this algorithm."
 			"Test Skipped.\n");
 		snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "SKIPPED");
-		return 0;
+		return TEST_SKIPPED;
 	}
 
 	/* preparing data */
@@ -435,6 +435,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 				init_xform, sess_priv_mpool);
 		if (status == -ENOTSUP) {
 			snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "UNSUPPORTED");
+			status = TEST_SKIPPED;
 			goto error_exit;
 		}
 		if (!sess || status < 0) {
@@ -780,7 +781,7 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
 		printf("  %u) TestCase %s %s\n", test_index ++,
 			tc->test_descr, test_msg);
 
-		if (status != TEST_SUCCESS) {
+		if (status == TEST_FAILED) {
 			if (overall_status == TEST_SUCCESS)
 				overall_status = status;
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 93 lines

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Wednesday, May 20, 2020 11:26 PM
To: [email protected]
Cc: Ruifeng Wang <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH] test/crypto: skip unsupported cases

From: Akhil Goyal <[email protected]>

blockcipher cases are either returning TEST_SUCCESS or TEST_FAILED as status, but the test may not be supported by the PMD which is also a success case for the PMD. Hence checking for status == TEST_FAILED for setting the overall status as failed.

---
 app/test/test_cryptodev_blockcipher.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
app/test/test_cryptodev_blockcipher.c +1 -1
index 642b549717..d033350659 100644
@@ -107,7 +107,7 @@ test_blockcipher_one_case(const struct
 blockcipher_test_case *t,
 "Test Skipped.\n");
 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
 "SKIPPED");
-return 0;
+return TEST_SKIPPED;
 }
 }

if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SG) { @@ -
120,7 +120,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
"Test Skipped.\n");
snprintf(test_msg,
BLOCKCIPHER_TEST_MSG_LEN,
"SKIPPED");

app/test/test_cryptodev_blockcipher.c +1 -1
-return 0;
+return TEST_SKIPPED;
 }
 } else {
 if (!(feat_flags &

RTE_CRYPTODEV_FF_IN_PLACE_SGL)) { @@ -129,7 +129,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
"Test Skipped.\n");
snprintf(test_msg,
BLOCKCIPHER_TEST_MSG_LEN,
"SKIPPED");

app/test/test_cryptodev_blockcipher.c +3 -3
-return 0;
+return TEST_SKIPPED;
 }
 }
@@ -146,7 +146,7 @@ test_blockcipher_one_case(const struct
 blockcipher_test_case *t,
 "Test Skipped.\n");
 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
 "SKIPPED");
-return 0;
+return TEST_SKIPPED;
 }
 }
@@ -163,7 +163,7 @@ test_blockcipher_one_case(const struct
 blockcipher_test_case *t,
 "Device does not support this algorithm."
 "Test Skipped.\n");
 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
 "SKIPPED");
-return 0;
+return TEST_SKIPPED;
 }

/* preparing data */

app/test/test_cryptodev_blockcipher.c +1 -0
@@ -435,6 +435,7 @@ test_blockcipher_one_case(const struct
 blockcipher_test_case *t,
 init_xform, sess_priv_mpool);
 if (status == -ENOTSUP) {
 snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
 "UNSUPPORTED");
+status = TEST_SKIPPED;
 goto error_exit;

}
if (!sess || status < 0) {

app/test/test_cryptodev_blockcipher.c test_blockcipher_all_tests(struct rte_mempool · line 786

Quoted 7 lines
app/test/test_cryptodev_blockcipher.c +1 -1
@@ -780,7 +781,7 @@ test_blockcipher_all_tests(struct rte_mempool
 *mbuf_pool,
 printf("  %u) TestCase %s %s\n", test_index ++,
 tc->test_descr, test_msg);
 
-if (status != TEST_SUCCESS) {
+if (status == TEST_FAILED) {
 if (overall_status == TEST_SUCCESS)

We can remove this line and overwrite overall_status unconditionally. WDYT?

Thanks
/Ruifeng

Quoted 4 lines
app/test/test_cryptodev_blockcipher.c +0 -1
 overall_status = status;
 
--

2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

#2 lore raw

PATCH v2 1/1 test/crypto: skip unsupported cases

In reply to [email protected]

blockcipher cases are either returning TEST_SUCCESS or TEST_FAILED as status, but the test may not be supported by the PMD which is also a success case for the PMD. Hence checking for status == TEST_FAILED for setting the overall status as failed.

---
 app/test/test_cryptodev_blockcipher.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
app/test/test_cryptodev_blockcipher.c +8 -8
index 642b54971..221262341 100644
@@ -107,7 +107,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 				"Test Skipped.\n");
 			snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
 				"SKIPPED");
-			return 0;
+			return TEST_SKIPPED;
 		}
 	}
 	if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SG) {
@@ -120,7 +120,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 					"Test Skipped.\n");
 				snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
 					"SKIPPED");
-				return 0;
+				return TEST_SKIPPED;
 			}
 		} else {
 			if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) {
@@ -129,7 +129,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 					"Test Skipped.\n");
 				snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
 					"SKIPPED");
-				return 0;
+				return TEST_SKIPPED;
 			}
 		}
 
@@ -146,7 +146,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 				"Test Skipped.\n");
 			snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN,
 				"SKIPPED");
-			return 0;
+			return TEST_SKIPPED;
 		}
 	}
 
@@ -163,7 +163,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 			"Device does not support this algorithm."
 			"Test Skipped.\n");
 		snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "SKIPPED");
-		return 0;
+		return TEST_SKIPPED;
 	}
 
 	/* preparing data */
@@ -435,6 +435,7 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t,
 				init_xform, sess_priv_mpool);
 		if (status == -ENOTSUP) {
 			snprintf(test_msg, BLOCKCIPHER_TEST_MSG_LEN, "UNSUPPORTED");
+			status = TEST_SKIPPED;
 			goto error_exit;
 		}
 		if (!sess || status < 0) {
@@ -780,9 +781,8 @@ test_blockcipher_all_tests(struct rte_mempool *mbuf_pool,
 		printf("  %u) TestCase %s %s\n", test_index ++,
 			tc->test_descr, test_msg);
 
-		if (status != TEST_SUCCESS) {
-			if (overall_status == TEST_SUCCESS)
-				overall_status = status;
+		if (status == TEST_FAILED) {
+			overall_status = status;
 
 			if (tc->feature_mask & BLOCKCIPHER_TEST_FEATURE_STOPPER)
 				break;
Signature · 1 line
2.17.1
#3 lore raw

Hi All,

Quoted 8 lines

blockcipher cases are either returning TEST_SUCCESS or TEST_FAILED as status, but the test may not be supported by the PMD which is also a success case for the PMD. Hence checking for status == TEST_FAILED for setting the overall status as failed.

---

Any comments on this patch?

Regards,
Akhil

Reviewed-by
#4 lore raw
Quoted 8 lines · Akhil Goyal

Hi All,

Quoted 6 lines

blockcipher cases are either returning TEST_SUCCESS or TEST_FAILED as status, but the test may not be supported by the PMD which is also a success case for the PMD. Hence checking for status == TEST_FAILED for setting the overall status as failed.

Quoted 5 lines
Quoted 2 lines

---

Any comments on this patch?

Not an expert on the crypto area, but on code-review the changes look good to me as it makes the return value match the output describing what is happening.

Acked-by
#5 lore raw
In reply to Akhil Goyal
Quoted 23 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Monday, July 20, 2020 2:58 PM
To: [email protected]; Anoob Joseph <[email protected]>; [email protected]; [email protected]; Nagadheeraj Rottela <[email protected]>; Ankur Dwivedi <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]
Subject: [EXT] RE: [PATCH v2] test/crypto: skip unsupported cases

External Email

----------------------------------------------------------------------
Hi All,

Quoted 5 lines

blockcipher cases are either returning TEST_SUCCESS or TEST_FAILED as status, but the test may not be supported by the PMD which is also a success case for the PMD. Hence checking for status == TEST_FAILED for setting the overall status as failed.

Quoted 4 lines
Quoted 2 lines

---

Any comments on this patch?

Quoted 3 lines

Regards,
Akhil

author Applied
#6 lore raw
Quoted 7 lines
Quoted 7 lines

Hi All,

Quoted 5 lines

blockcipher cases are either returning TEST_SUCCESS or TEST_FAILED as status, but the test may not be supported by the PMD which is also a success case for the PMD. Hence checking for status == TEST_FAILED for setting the overall status as failed.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

---

Any comments on this patch?

Quoted 1 line

Applied to dpdk-next-crypto

Thanks.