From 0eea4e7cb266b1ee5098a0b6c7316055ddeeaef5 Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Fri, 4 Aug 2023 11:59:41 +0200 Subject: [PATCH] tests: Handle unknown syscall call errno. Apparently ENOSYS is returned for unknown syscalls on real machines and EPERM may be returned inside virtual machines. Signed-off-by: Simon Josefsson --- tests/test_syscall_swrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_syscall_swrap.c b/tests/test_syscall_swrap.c index fb3d26b..367f69b 100644 --- a/tests/test_syscall_swrap.c +++ b/tests/test_syscall_swrap.c @@ -34,7 +34,7 @@ static void test_uwrap_syscall_swrap(void **state) rc = syscall(__FAKE_SOCKET_WRAPPER_SYSCALL_NO+1); signal(SIGSYS, SIG_DFL); assert_int_equal(rc, -1); - assert_int_equal(errno, ENOSYS); + assert_true (errno == ENOSYS || errno == EPERM); } int main(void) { -- 2.34.1