From: Masatake YAMATO Date: Sat, 25 Feb 2023 16:33:17 +0000 (+0900) Subject: tests: (lsfd) skip if the platform doesn't attach a buffer to a packet socket X-Git-Tag: v2.39-rc1~52^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=da74e6e5c826597f1b7dcee19c01af52b44bcf9b;p=thirdparty%2Futil-linux.git tests: (lsfd) skip if the platform doesn't attach a buffer to a packet socket Signed-off-by: Masatake YAMATO --- diff --git a/tests/helpers/test_mkfds.c b/tests/helpers/test_mkfds.c index 6903b9e725..694c51693e 100644 --- a/tests/helpers/test_mkfds.c +++ b/tests/helpers/test_mkfds.c @@ -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)); diff --git a/tests/ts/lsfd/mkfds-mapped-packet-socket b/tests/ts/lsfd/mkfds-mapped-packet-socket index 1f705aecb4..1ee61d5d97 100755 --- a/tests/ts/lsfd/mkfds-mapped-packet-socket +++ b/tests/ts/lsfd/mkfds-mapped-packet-socket @@ -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