[dpdk-dev] [PATCH] test/crypto: skip unsupported cases

Ruifeng Wang Ruifeng.Wang at arm.com
Thu May 21 09:52:39 CEST 2020


> -----Original Message-----
> From: akhil.goyal at nxp.com <akhil.goyal at nxp.com>
> Sent: Wednesday, May 20, 2020 11:26 PM
> To: dev at dpdk.org
> Cc: Ruifeng Wang <Ruifeng.Wang at arm.com>; declan.doherty at intel.com;
> asomalap at amd.com; anoobj at marvell.com; roy.fan.zhang at intel.com;
> fiona.trahe at intel.com; rnagadheeraj at marvell.com; adwivedi at marvell.com;
> jianjay.zhou at huawei.com; pablo.de.lara.guarch at intel.com;
> adamx.dybkowski at intel.com; Akhil.goyal at nxp.com
> Subject: [PATCH] test/crypto: skip unsupported cases
>
> From: Akhil Goyal <akhil.goyal at nxp.com>
>
> 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 at nxp.com>
> ---
>  app/test/test_cryptodev_blockcipher.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/app/test/test_cryptodev_blockcipher.c
> b/app/test/test_cryptodev_blockcipher.c
> index 642b549717..d033350659 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,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
>  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.


More information about the dev mailing list