summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/commands.sh1
-rwxr-xr-xtests/ts/mount/move15
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/commands.sh b/tests/commands.sh
index fd07b175d..420feb9ae 100644
--- a/tests/commands.sh
+++ b/tests/commands.sh
@@ -64,6 +64,7 @@ TS_CMD_MKCRAMFS=${TS_CMD_MKCRAMFS:-"$top_builddir/mkfs.cramfs"}
TS_CMD_MKMINIX=${TS_CMD_MKMINIX:-"$top_builddir/mkfs.minix"}
TS_CMD_MKSWAP=${TS_CMD_MKSWAP:-"$top_builddir/mkswap"}
TS_CMD_MOUNT=${TS_CMD_MOUNT:-"$top_builddir/mount"}
+TS_CMD_MOUNTPOINT=${TS_CMD_MOUNTPOINT:-"$top_builddir/mountpoint"}
TS_CMD_NAMEI=${TS_CMD_NAMEI-"$top_builddir/namei"}
TS_CMD_PARTX=${TS_CMD_PARTX-"$top_builddir/partx"}
TS_CMD_RENAME=${TS_CMD_RENAME-"$top_builddir/rename"}
diff --git a/tests/ts/mount/move b/tests/ts/mount/move
index 1e50d01d4..b42a93f4f 100755
--- a/tests/ts/mount/move
+++ b/tests/ts/mount/move
@@ -24,6 +24,7 @@ ts_init "$*"
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_MOUNTPOINT"
ts_skip_nonroot
@@ -59,6 +60,20 @@ $TS_CMD_MOUNT --move $DIR_A $DIR_B
$TS_CMD_FINDMNT --kernel --mountpoint "$DIR_B" &> /dev/null
[ "$?" == "0" ] || ts_die "Cannot find binded $DIR_B in /proc/self/mountinfo"
+# BTW a basic test for findmnt(8) and mountpoint(1)
+for f in `find $DIR_PRIVATE2 $DIR_PRIVATE`; do
+ xo="$($TS_CMD_MOUNTPOINT -q "$f" 2>&1)"
+ x=$?
+ yo="$($TS_CMD_FINDMNT --kernel --mountpoint "$f" 2>&1)"
+ y=$?
+
+ [ "$x" = "$y" ] || ts_log "error: findmount vs. mountpoint: $x, $y, $f"
+ [ -z "$xo" ] || ts_log "error: mountpoint is not quiet: $x, $y, $f"
+ if [ "$y" = "0" -a "$yo" = "" ] || [ "$y" = "1" -a "$yo" != "" ]; then
+ ts_log "error, findmount return value vs. output: $x, $y, $f"
+ fi
+done
+
# clean up
$TS_CMD_UMOUNT $DIR_B
rmdir $DIR_SRC $DIR_A $DIR_B