]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: (lsfd) skip if the platform doesn't attach a buffer to a packet socket
authorMasatake YAMATO <yamato@redhat.com>
Sat, 25 Feb 2023 16:33:17 +0000 (01:33 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Sun, 26 Feb 2023 08:26:53 +0000 (17:26 +0900)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tests/helpers/test_mkfds.c
tests/ts/lsfd/mkfds-mapped-packet-socket

index 6903b9e7254bb8ccfe1e828c6265cc658a449728..694c51693eb0ec1ff55ac49b8878b8ffe4d373e0 100644 (file)
@@ -692,7 +692,8 @@ static void *make_mmapped_packet_socket(const struct factory *factory, struct fd
                int e = errno;
                close(sd);
                errno = e;
-               err(EXIT_FAILURE, "failed to specify a buffer spec to a packet socket");
+               err((errno == ENOPROTOOPT? EXIT_ENOPROTOOPT: EXIT_FAILURE),
+                   "failed to specify a buffer spec to a packet socket");
        }
 
        munmap_data = malloc(sizeof (*munmap_data));
index 1f705aecb451d9904102791481ecb5556d0f6f40..1ee61d5d972d9548d38db1a702c226fa85af907d 100755 (executable)
@@ -20,7 +20,6 @@ TS_DESC="mmap'ed AF_PACKET socket"
 . "$TS_TOPDIR"/functions.sh
 ts_init "$*"
 ts_skip_nonroot
-ts_skip_qemu_user
 
 . "$TS_SELF"/lsfd-functions.bash
 
@@ -47,4 +46,8 @@ INTERFACE=lo
     wait ${MKFDS_PID}
 } > $TS_OUTPUT 2>&1
 
+if [[ $? == "$ENOPROTOOPT" ]]; then
+    ts_skip "packet socket doesn't support attaching a buffer on this platform"
+fi
+
 ts_finalize