diff options
author | Ruediger Meier | 2015-03-19 17:11:43 +0100 |
---|---|---|
committer | Ruediger Meier | 2015-03-19 17:11:43 +0100 |
commit | 51d455ce16a4e42bb17bea893e5cae2edc1872b4 (patch) | |
tree | 5f07014aec6722e94271b3fbc9210f7dc88352b6 /tests/ts/mount | |
parent | findmnt: add --mountpoint command line option (diff) | |
download | kernel-qcow2-util-linux-51d455ce16a4e42bb17bea893e5cae2edc1872b4.tar.gz kernel-qcow2-util-linux-51d455ce16a4e42bb17bea893e5cae2edc1872b4.tar.xz kernel-qcow2-util-linux-51d455ce16a4e42bb17bea893e5cae2edc1872b4.zip |
tests: mount/move also tests findmnt vs. mountpoint
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/ts/mount')
-rwxr-xr-x | tests/ts/mount/move | 15 |
1 files changed, 15 insertions, 0 deletions
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 |