test/event: skip test if no driver is present

Message ID 20240124123338.551436-1-david.marchand@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series test/event: skip test if no driver is present |

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/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

David Marchand Jan. 24, 2024, 12:33 p.m. UTC
  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@dpdk.org

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

Comments

Jerin Jacob Feb. 1, 2024, 5:44 p.m. UTC | #1
On Wed, Jan 24, 2024 at 6:03 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> 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@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Applied to dpdk-next-eventdev/for-main. Thanks


> ---
>  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
>
  

Patch

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;
 }