From 272536b913e7628aa2dfa4acbaf5ec465ab38775 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 6 Nov 2024 08:24:57 -0500 Subject: [PATCH] tests: Handle ENOSYS in qemu on cross-arch emulation We may get ENOSYS from qemu userspace emulation not implementing the ioctl. Signed-off-by: Colin Walters --- .github/workflows/test.yaml | 2 +- tests/test-lcfs.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0f3bd595..d3aaa9bc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -141,7 +141,7 @@ jobs: ./hacking/installdeps.sh meson setup build --werror meson compile -C build - meson test -C build --timeout-multiplier 10 + env CFS_TEST_ARCH_EMULATION=${{ matrix.arch }} meson test -C build --timeout-multiplier 10 - name: Upload log uses: actions/upload-artifact@v4 if: always() diff --git a/tests/test-lcfs.c b/tests/test-lcfs.c index 59f0c132..85f2cf46 100644 --- a/tests/test-lcfs.c +++ b/tests/test-lcfs.c @@ -88,7 +88,9 @@ static void test_no_verity(void) int r = lcfs_fd_measure_fsverity(digest, tmpfd); int errsv = errno; assert(r != 0); - assert(errsv == ENOVERITY); + // We may get ENOSYS from qemu userspace emulation not implementing the ioctl + if (getenv("CFS_TEST_ARCH_EMULATION") != NULL) + assert(errsv == ENOVERITY); close(tmpfd); }