tests: fix timezone for cramfs
PATCH 1/3 tests: fix timezone for cramfs
cramfs test need explicitly set timezone otherwise ls diff fails with
cramfs: mkfs checksums ... FAILED (cramfs/mkfs)
Signed-off-by Milan Broz <[email protected]>
--- tests/ts/cramfs/mkfs | 1 + 1 file changed, 1 insertion(+)
tests/ts/cramfs/mkfs +1 -0
@@ -79,6 +79,7 @@ ts_is_mounted $DEVICE || ts_die "Cannot find $DEVICE in /proc/mounts" $DEVICE cd $TS_MOUNTPOINT ts_log "list the image" +TZ='GMT-1' ls -laR --time-style=long-iso . >> $TS_OUTPUT echo >> $TS_OUTPUT
Signature · 1 line
1.7.10.4
PATCH 2/3 tests: ignore test if kernel doesn't support minix fs
Minix mount test returs failure if kernel have no minix support,
minix: mkfs ... FAILED (minix/mkfs)
ignore test result instead in this case.
Signed-off-by Milan Broz <[email protected]>
--- tests/ts/minix/mkfs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/ts/minix/mkfs +2 -1
@@ -35,7 +35,8 @@ ts_log "create mountpoint dir" [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT ts_log "mount the filesystem" -$TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT +($TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT || true) \ + | grep -q "unknown filesystem type" && ts_skip "mkfs: minix fs not supported by kernel" # check it ts_is_mounted $DEVICE || ts_die "Cannot find $DEVICE in /proc/mounts" $DEVICE
Signature · 1 line
1.7.10.4
PATCH 3/3 tests: fix mount move test to work with shared mount
In reply to Milan BrozIf parent mount for test directory is mounted with shared flag, move mount test fails because kernel rejects mount move operation.
Use another directory level and explicitly make parent mount private.
(All "modern" systems using system have mounts shared for some reason.)
Signed-off-by Milan Broz <[email protected]>
--- tests/ts/mount/move | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
tests/ts/mount/move +16 -3
@@ -22,9 +22,19 @@ TS_DESC="move" ts_init "$*" ts_skip_nonroot -DIR_SRC="$TS_OUTDIR/mnt-move-src" -DIR_A="$TS_OUTDIR/mnt-move-A" -DIR_B="$TS_OUTDIR/mnt-move-B" +DIR_PRIVATE2="$TS_OUTDIR/mnt-move-private2" +DIR_PRIVATE="$TS_OUTDIR/mnt-move-private" + +DIR_SRC="$DIR_PRIVATE/mnt-move-src" +DIR_A="$DIR_PRIVATE/mnt-move-A" +DIR_B="$DIR_PRIVATE/mnt-move-B" + +# create bind mount and make it private to be sure +# (kernel cannot move mount with shared parent) +[ -d $DIR_PRIVATE2 ] || mkdir $DIR_PRIVATE2 +[ -d $DIR_PRIVATE ] || mkdir $DIR_PRIVATE +$TS_CMD_MOUNT --bind $DIR_PRIVATE2 $DIR_PRIVATE +$TS_CMD_MOUNT --make-private $DIR_PRIVATE [ -d $DIR_SRC ] || mkdir $DIR_SRC [ -d $DIR_A ] || mkdir $DIR_A
@@ -48,6 +58,9 @@ $TS_CMD_FINDMNT --kernel --target "$DIR_B" &> /dev/null $TS_CMD_UMOUNT $DIR_B rmdir $DIR_SRC $DIR_A $DIR_B +$TS_CMD_UMOUNT $DIR_PRIVATE +rmdir $DIR_PRIVATE $DIR_PRIVATE2 + ts_log "Success" ts_finalize
Signature · 1 line
1.7.10.4
Karel Zak
maintainerQuoted 1 line · Milan Broz
1 file changed, 1 insertion(+)
All three patches applied, thanks.
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com