test/ipsec: check for cryptodevs before testing

Message ID 20220601110017.400040-1-kda@semihalf.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series test/ipsec: check for cryptodevs before testing |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Stanislaw Kardach June 1, 2022, 11 a.m. UTC
  Make sure that ipsec_perf_autotest checks if there are any crypto
devices available before it starts performance testing.
Same test is performed in the ipsec_autotest so it seems prudent to do
it here too to not introduce false failures.

Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
---
 app/test/test_ipsec_perf.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Akhil Goyal June 21, 2022, 1:10 p.m. UTC | #1
> Make sure that ipsec_perf_autotest checks if there are any crypto
> devices available before it starts performance testing.
> Same test is performed in the ipsec_autotest so it seems prudent to do
> it here too to not introduce false failures.
> 
> Signed-off-by: Stanislaw Kardach <kda@semihalf.com>
> ---
Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/app/test/test_ipsec_perf.c b/app/test/test_ipsec_perf.c
index 346a851648..0eca003282 100644
--- a/app/test/test_ipsec_perf.c
+++ b/app/test/test_ipsec_perf.c
@@ -597,6 +597,12 @@  test_libipsec_perf(void)
 	uint32_t i;
 	int ret;
 
+	ret = rte_cryptodev_count();
+	if (ret < 1) {
+		RTE_LOG(WARNING, USER1, "No crypto devices found?\n");
+		return TEST_SKIPPED;
+	}
+
 	if (testsuite_setup() < 0) {
 		testsuite_teardown();
 		return TEST_FAILED;