[PATCH] test/event: skip test if no driver is present

David Marchand david.marchand at redhat.com
Wed Jan 24 13:33:38 CET 2024


Align eventdev with what other device abstraction libraries do: if no
driver is present, skip the tests.

Fixes: f8f9d233ea0e ("test/eventdev: add unit tests")
Cc: stable at dpdk.org

Signed-off-by: David Marchand <david.marchand at redhat.com>
---
 app/test/test_eventdev.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/app/test/test_eventdev.c b/app/test/test_eventdev.c
index 71de947ce4..e4e234dc98 100644
--- a/app/test/test_eventdev.c
+++ b/app/test/test_eventdev.c
@@ -33,9 +33,15 @@ testsuite_setup(void)
 	uint8_t count;
 	count = rte_event_dev_count();
 	if (!count) {
+		int ret;
+
 		printf("Failed to find a valid event device,"
-			" testing with event_skeleton device\n");
-		return rte_vdev_init("event_skeleton", NULL);
+			" trying with event_skeleton device\n");
+		ret = rte_vdev_init("event_skeleton", NULL);
+		if (ret != 0) {
+			printf("No event device, skipping\n");
+			return TEST_SKIPPED;
+		}
 	}
 	return TEST_SUCCESS;
 }
-- 
2.43.0



More information about the dev mailing list