]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
enosys: move from tests/helpers/test_enosys.c
authorThomas Weißschuh <thomas@t-8ch.de>
Thu, 27 Apr 2023 21:40:28 +0000 (23:40 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Tue, 16 May 2023 20:31:57 +0000 (22:31 +0200)
configure.ac
meson.build
misc-utils/Makemodule.am
misc-utils/enosys.c [moved from tests/helpers/test_enosys.c with 100% similarity]
tests/commands.sh
tests/helpers/Makemodule.am
tests/ts/mount/fallback

index 73b0a8c97ec99adb6699959736b13323899f10aa..7453b9a543da0545ffd7318a4cfb496959732e3e 100644 (file)
@@ -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])
 
index c56f83b1fa530816ba2c05e38cc5cd89ef37bdc0..e77db246b8d5463a9d7ceb3ac127d0b8709aee5d 100644 (file)
@@ -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
index 71548c9f9ef2d88a8959b8b0b3b7392adb3b1dd4..50fe449fe8891cec450d0dfc1c089b37f00e1200 100644 (file)
@@ -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
index 8dfb135a8e726e78d1269ca1fa9a2fa57e2a1777..f979fe66215ba79ee82c86992ce57652573e76d2 100644 (file)
@@ -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"}
index 2b1df3c6baba01fd641f0aac1a24df70a6fd29ba..83df24b1f0e1e14f0c3a99f8ab28945faedf451c 100644 (file)
@@ -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
index fe932ee78a62a4710b120f168951c1db7d536f28..6033eb5757b3d2c9c277887b236d3a68c63a1a09 100755 (executable)
@@ -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"