test/crypto: add a check in decryption with digest test case

Message ID 1612414330-18971-1-git-send-email-g.singh@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series test/crypto: add a check in decryption with digest test case |

Checks

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

Commit Message

Gagandeep Singh Feb. 4, 2021, 4:52 a.m. UTC
  Some platforms may not support operations on encrypted digest,
So in this patch adding a check for such test cases.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 app/test/test_cryptodev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Comments

Akhil Goyal Feb. 4, 2021, 6:10 p.m. UTC | #1
> Some platforms may not support operations on encrypted digest,
> So in this patch adding a check for such test cases.
> 
> Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
> ---
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>

Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index ae22456..f91debc 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -6324,6 +6324,16 @@  static int
 test_snow3g_decryption_with_digest_test_case_1(void)
 {
 	struct snow3g_hash_test_data snow3g_hash_data;
+	struct rte_cryptodev_info dev_info;
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+	uint64_t feat_flags = dev_info.feature_flags;
+
+	if (!(feat_flags & RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED)) {
+		printf("Device doesn't support encrypted digest operations.\n");
+		return -ENOTSUP;
+	}
 
 	/*
 	 * Function prepare data for hash veryfication test case.