[v1] test/crypto: fix asymmetric capability test

Message ID 20240715133728.1519-1-gmuthukrishn@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v1] test/crypto: fix asymmetric capability test |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/github-robot: build success github build: passed
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing pending Testing pending
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Gowrishankar Muthukrishnan July 15, 2024, 1:37 p.m. UTC
Fix asymmetric capability test for below:
 * Skip test if asymmetric crypto feature is not supported by device.
 * Assert return value of RTE function to get asymmetric capability.

Coverity issue: 373365
Fixes: 2c6dab9cd93 ("test/crypto: add RSA and Mod tests")
Cc: stable@dpdk.org

Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
---
 app/test/test_cryptodev_asym.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Anoob Joseph July 16, 2024, 5:25 a.m. UTC | #1
> Subject: [PATCH v1] test/crypto: fix asymmetric capability test
> 
> Fix asymmetric capability test for below:
>  * Skip test if asymmetric crypto feature is not supported by device.
>  * Assert return value of RTE function to get asymmetric capability.
> 
> Coverity issue: 373365
> Fixes: 2c6dab9cd93 ("test/crypto: add RSA and Mod tests")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>

Acked-by: Anoob Joseph <anoobj@marvell.com>
  
Akhil Goyal July 18, 2024, 3:55 p.m. UTC | #2
> Subject: [PATCH v1] test/crypto: fix asymmetric capability test
> 
> Fix asymmetric capability test for below:
>  * Skip test if asymmetric crypto feature is not supported by device.
>  * Assert return value of RTE function to get asymmetric capability.
> 
> Coverity issue: 373365
> Fixes: 2c6dab9cd93 ("test/crypto: add RSA and Mod tests")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>
Applied to dpdk-next-crypto
Thanks.
  

Patch

diff --git a/app/test/test_cryptodev_asym.c b/app/test/test_cryptodev_asym.c
index 3802cf8022..1d88832146 100644
--- a/app/test/test_cryptodev_asym.c
+++ b/app/test/test_cryptodev_asym.c
@@ -626,7 +626,7 @@  test_capability(void)
 				RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO)) {
 		RTE_LOG(INFO, USER1,
 				"Device doesn't support asymmetric. Test Skipped\n");
-		return TEST_SUCCESS;
+		return TEST_SKIPPED;
 	}
 
 	/* print xform capability */
@@ -641,6 +641,7 @@  test_capability(void)
 			capa = rte_cryptodev_asym_capability_get(dev_id,
 				(const struct
 				rte_cryptodev_asym_capability_idx *) &idx);
+			TEST_ASSERT_NOT_NULL(capa, "Failed to get asymmetric capability");
 			print_asym_capa(capa);
 			}
 	}