[PATCH libaio 28/28] harness: Skip the test if io_pgetevents() is not implemented
authorGuillem Jover <guillem@hadrons.org>
Wed, 21 Aug 2019 03:29:52 +0000 (05:29 +0200)
committerGuillem Jover <guillem@debian.org>
Thu, 11 Nov 2021 03:56:01 +0000 (03:56 +0000)
Either the kernel or the syscall wrapper will return -ENOSYS when this
syscall is not implemented. So we should cope with this in the test
suite and SKIP the test case.

This is currently the case for alpha and ia64, even though they have
already been wired up very recently in the kernel mainline.

Signed-off-by: Guillem Jover <guillem@hadrons.org>
Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Gbp-Pq: Topic upstream
Gbp-Pq: Name 0028-harness-Skip-the-test-if-io_pgetevents-is-not-implem.patch

harness/cases/22.t

index c47140de6459e1db1ea5128d4afc938064064f2f..d6a898683f319a46ce952ce57e75a3c292a22daf 100644 (file)
@@ -98,6 +98,10 @@ int test_main(void)
                        ret = io_pgetevents(ctx, 1, 1, &ev, &to, &sigmask);
                } while (ret == 0);
 
+               /* SKIP if the syscall has not been implemented. */
+               if (ret == -ENOSYS)
+                       return 3;
+
                if (ret != -EINTR) {
                        printf("child: io_pgetevents did not set errno to "
                               "EINTR: %s\n", strerror(-ret));
@@ -135,6 +139,9 @@ int test_main(void)
                kill(p, SIGUSR1);
 
                ret = io_pgetevents(ctx, 1, 1, &ev, NULL, &sigmask);
+               /* SKIP if the syscall has not been implemented. */
+               if (ret == -ENOSYS)
+                       return 3;
                if (ret < 0) {
                        printf("parent: io_pgetevents failed: %s\n",
                               strerror(-ret));