From: Thomas Weißschuh Date: Thu, 27 Apr 2023 21:40:28 +0000 (+0200) Subject: enosys: move from tests/helpers/test_enosys.c X-Git-Tag: v2.40-rc1~466^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cba52cc194c6e80581cbd2ff9ba0916700970b13;p=thirdparty%2Futil-linux.git enosys: move from tests/helpers/test_enosys.c --- diff --git a/configure.ac b/configure.ac index 73b0a8c97e..7453b9a543 100644 --- a/configure.ac +++ b/configure.ac @@ -1851,6 +1851,10 @@ UL_BUILD_INIT([waitpid], [check]) UL_REQUIRES_LINUX([waitpid]) AM_CONDITIONAL([BUILD_WAITPID], [test "x$build_waitpid" = xyes]) +UL_BUILD_INIT([enosys], [check]) +UL_REQUIRES_LINUX([enosys]) +AM_CONDITIONAL([BUILD_ENOSYS], [test "x$build_enosys" = xyes]) + UL_BUILD_INIT([getopt], [yes]) AM_CONDITIONAL([BUILD_GETOPT], [test "x$build_getopt" = xyes]) diff --git a/meson.build b/meson.build index c56f83b1fa..e77db246b8 100644 --- a/meson.build +++ b/meson.build @@ -2856,6 +2856,17 @@ if not is_disabler(exe) bashcompletions += ['waitpid'] endif +exe = executable( + 'enosys', + 'misc-utils/enosys.c', + include_directories : includes, + link_with : [lib_common], + install_dir : usrbin_exec_dir, + install : true) +if not is_disabler(exe) + exes += exe +endif + ############################################################ opt = not get_option('build-schedutils').disabled() @@ -3245,12 +3256,6 @@ exe = executable( include_directories : includes) exes += exe -exe = executable( - 'test_enosys', - 'tests/helpers/test_enosys.c', - include_directories : includes) -exes += exe - ############################################################ # XXX: HAVE_OPENAT diff --git a/misc-utils/Makemodule.am b/misc-utils/Makemodule.am index 71548c9f9e..50fe449fe8 100644 --- a/misc-utils/Makemodule.am +++ b/misc-utils/Makemodule.am @@ -297,3 +297,10 @@ waitpid_SOURCES = misc-utils/waitpid.c waitpid_LDADD = $(LDADD) libcommon.la waitpid_CFLAGS = $(AM_CFLAGS) endif + +if BUILD_ENOSYS +usrbin_exec_PROGRAMS += enosys +enosys_SOURCES = misc-utils/enosys.c +enosys_LDADD = $(LDADD) libcommon.la +enosys_CFLAGS = $(AM_CFLAGS) +endif diff --git a/tests/helpers/test_enosys.c b/misc-utils/enosys.c similarity index 100% rename from tests/helpers/test_enosys.c rename to misc-utils/enosys.c diff --git a/tests/commands.sh b/tests/commands.sh index 8dfb135a8e..f979fe6621 100644 --- a/tests/commands.sh +++ b/tests/commands.sh @@ -5,7 +5,6 @@ TS_TESTUSER=${TS_TESTUSER:-"nobody"} TS_HELPER_BYTESWAP="${ts_helpersdir}test_byteswap" TS_HELPER_CPUSET="${ts_helpersdir}test_cpuset" TS_HELPER_DMESG="${ts_helpersdir}test_dmesg" -TS_HELPER_ENOSYS="${ts_helpersdir}test_enosys" TS_HELPER_ISLOCAL="${ts_helpersdir}test_islocal" TS_HELPER_ISMOUNTED="${ts_helpersdir}test_ismounted" TS_HELPER_LIBFDISK_GPT="${ts_helpersdir}test_fdisk_gpt" @@ -60,6 +59,7 @@ TS_CMD_COLCRT=${TS_CMD_COLCRT:-"${ts_commandsdir}colcrt"} TS_CMD_COLRM=${TS_CMD_COLRM:-"${ts_commandsdir}colrm"} TS_CMD_COL=${TS_CMD_COL:-"${ts_commandsdir}col"} TS_CMD_COLUMN=${TS_CMD_COLUMN:-"${ts_commandsdir}column"} +TS_CMD_ENOSYS=${TS_CMD_ENOSYS-"${ts_commandsdir}enosys"} TS_CMD_EJECT=${TS_CMD_EJECT-"${ts_commandsdir}eject"} TS_CMD_FALLOCATE=${TS_CMD_FALLOCATE-"${ts_commandsdir}fallocate"} TS_CMD_FDISK=${TS_CMD_FDISK-"${ts_commandsdir}fdisk"} diff --git a/tests/helpers/Makemodule.am b/tests/helpers/Makemodule.am index 2b1df3c6ba..83df24b1f0 100644 --- a/tests/helpers/Makemodule.am +++ b/tests/helpers/Makemodule.am @@ -34,7 +34,4 @@ test_uuid_namespace_SOURCES = tests/helpers/test_uuid_namespace.c \ if LINUX check_PROGRAMS += test_mkfds test_mkfds_SOURCES = tests/helpers/test_mkfds.c - -check_PROGRAMS += test_enosys -test_enosys_SOURCES = tests/helpers/test_enosys.c endif diff --git a/tests/ts/mount/fallback b/tests/ts/mount/fallback index fe932ee78a..6033eb5757 100755 --- a/tests/ts/mount/fallback +++ b/tests/ts/mount/fallback @@ -6,15 +6,15 @@ TS_DESC="fstab-fallback" . "$TS_TOPDIR"/functions.sh ts_init "$*" -ts_check_test_command "$TS_HELPER_ENOSYS" +ts_check_test_command "$TS_CMD_ENOSYS" ts_check_test_command "$TS_CMD_MOUNT" ts_check_test_command "$TS_CMD_UMOUNT" ts_check_test_command "$TS_CMD_FINDMNT" ts_check_test_command "$TS_CMD_LOSETUP" ts_skip_nonroot -"$TS_HELPER_ENOSYS" true 2> /dev/null -[ "$?" -eq "$TS_EXIT_NOTSUPP" ] && ts_skip "test_enosys does not work" +"$TS_CMD_ENOSYS" true 2> /dev/null +[ "$?" -eq "$TS_EXIT_NOTSUPP" ] && ts_skip "enosys does not work" test_mount_fallback() { ts_init_subtest "$1" @@ -24,7 +24,7 @@ test_mount_fallback() { mkdir -p "$MY_SOURCE" mkdir -p "$TS_MOUNTPOINT" - "$TS_HELPER_ENOSYS" $2 -- "$TS_CMD_MOUNT" --bind "$MY_SOURCE" "$TS_MOUNTPOINT" \ + "$TS_CMD_ENOSYS" $2 -- "$TS_CMD_MOUNT" --bind "$MY_SOURCE" "$TS_MOUNTPOINT" \ >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" [ "$?" = "0" ] || ts_log "error: mount $TS_MOUNTPOINT" @@ -51,7 +51,7 @@ mkdir -p "$MOUNTPOINT" ts_init_subtest "later-fsopen" -$TS_HELPER_ENOSYS -s fsopen -- "$TS_CMD_MOUNT" -t foo,bar,ext2 "$DEVICE" "$MOUNTPOINT" \ +$TS_CMD_ENOSYS -s fsopen -- "$TS_CMD_MOUNT" -t foo,bar,ext2 "$DEVICE" "$MOUNTPOINT" \ >> $TS_OUTPUT 2>> $TS_ERRLOG ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" mkdir -p ${MOUNTPOINT}/subdir @@ -60,7 +60,7 @@ ts_finalize_subtest ts_init_subtest "subdir" -$TS_HELPER_ENOSYS -s fsopen -s open_tree -- \ +$TS_CMD_ENOSYS -s fsopen -s open_tree -- \ "$TS_CMD_MOUNT" -o X-mount.subdir=subdir "$DEVICE" "$MOUNTPOINT" \ >> $TS_OUTPUT 2>> $TS_ERRLOG ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts"