[v2] test/crypto: skip unsupported cases

Message ID 20200716190713.23296-1-akhil.goyal@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v2] test/crypto: skip unsupported cases |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Akhil Goyal July 16, 2020, 7:07 p.m. UTC
  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.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
---
 app/test/test_cryptodev_blockcipher.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
  

Comments

Akhil Goyal July 20, 2020, 9:27 a.m. UTC | #1
Hi All,

> 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.
> 
> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> ---

Any comments on this patch?

Regards,
Akhil
  
Bruce Richardson July 20, 2020, 9:42 a.m. UTC | #2
On Mon, Jul 20, 2020 at 09:27:57AM +0000, Akhil Goyal wrote:
> Hi All,
> 
> > 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.
> > 
> > Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> > ---
> 
> 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.

Reviewed-by: Bruce Richardson <bruce.richardson@intel.com>
  
Ankur Dwivedi July 20, 2020, 10:18 a.m. UTC | #3
>-----Original Message-----
>From: Akhil Goyal <akhil.goyal@nxp.com>
>Sent: Monday, July 20, 2020 2:58 PM
>To: asomalap@amd.com; Anoob Joseph <anoobj@marvell.com>;
>roy.fan.zhang@intel.com; fiona.trahe@intel.com; Nagadheeraj Rottela
><rnagadheeraj@marvell.com>; Ankur Dwivedi <adwivedi@marvell.com>;
>jianjay.zhou@huawei.com; pablo.de.lara.guarch@intel.com;
>adamx.dybkowski@intel.com; ruifeng.wang@arm.com
>Cc: declan.doherty@intel.com; dev@dpdk.org
>Subject: [EXT] RE: [PATCH v2] test/crypto: skip unsupported cases
>
>External Email
>
>----------------------------------------------------------------------
>Hi All,
>
>> 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.
>>
>> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
>> ---
>
>Any comments on this patch?
Acked-by: Ankur Dwivedi <adwivedi@marvell.com>
>
>Regards,
>Akhil
  
Akhil Goyal July 20, 2020, 10:20 a.m. UTC | #4
> >Hi All,
> >
> >> 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.
> >>
> >> Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
> >> ---
> >
> >Any comments on this patch?
> Acked-by: Ankur Dwivedi <adwivedi@marvell.com>
> >

Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/app/test/test_cryptodev_blockcipher.c b/app/test/test_cryptodev_blockcipher.c
index 642b54971..221262341 100644
--- a/app/test/test_cryptodev_blockcipher.c
+++ b/app/test/test_cryptodev_blockcipher.c
@@ -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;