util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] tests: fix timezone for cramfs
@ 2012-10-05 16:37 Milan Broz
  2012-10-05 16:37 ` [PATCH 2/3] tests: ignore test if kernel doesn't support minix fs Milan Broz
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Milan Broz @ 2012-10-05 16:37 UTC (permalink / raw)
  To: util-linux; +Cc: Milan Broz

cramfs test need explicitly set timezone otherwise
ls diff fails with
   cramfs: mkfs checksums ... FAILED (cramfs/mkfs)

Signed-off-by: Milan Broz <mbroz@redhat.com>
---
 tests/ts/cramfs/mkfs |    1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/ts/cramfs/mkfs b/tests/ts/cramfs/mkfs
index db9b08c..99d682f 100755
--- a/tests/ts/cramfs/mkfs
+++ b/tests/ts/cramfs/mkfs
@@ -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
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] tests: ignore test if kernel doesn't support minix fs
  2012-10-05 16:37 [PATCH 1/3] tests: fix timezone for cramfs Milan Broz
@ 2012-10-05 16:37 ` Milan Broz
  2012-10-05 16:37 ` [PATCH 3/3] tests: fix mount move test to work with shared mount Milan Broz
  2012-10-09 11:50 ` [PATCH 1/3] tests: fix timezone for cramfs Karel Zak
  2 siblings, 0 replies; 4+ messages in thread
From: Milan Broz @ 2012-10-05 16:37 UTC (permalink / raw)
  To: util-linux; +Cc: Milan Broz

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 <mbroz@redhat.com>
---
 tests/ts/minix/mkfs |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/ts/minix/mkfs b/tests/ts/minix/mkfs
index 93de4e6..39185ad 100755
--- a/tests/ts/minix/mkfs
+++ b/tests/ts/minix/mkfs
@@ -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
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] tests: fix mount move test to work with shared mount
  2012-10-05 16:37 [PATCH 1/3] tests: fix timezone for cramfs Milan Broz
  2012-10-05 16:37 ` [PATCH 2/3] tests: ignore test if kernel doesn't support minix fs Milan Broz
@ 2012-10-05 16:37 ` Milan Broz
  2012-10-09 11:50 ` [PATCH 1/3] tests: fix timezone for cramfs Karel Zak
  2 siblings, 0 replies; 4+ messages in thread
From: Milan Broz @ 2012-10-05 16:37 UTC (permalink / raw)
  To: util-linux; +Cc: Milan Broz

If 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 <mbroz@redhat.com>
---
 tests/ts/mount/move |   19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/tests/ts/mount/move b/tests/ts/mount/move
index 3862f46..ea37685 100755
--- a/tests/ts/mount/move
+++ b/tests/ts/mount/move
@@ -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
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] tests: fix timezone for cramfs
  2012-10-05 16:37 [PATCH 1/3] tests: fix timezone for cramfs Milan Broz
  2012-10-05 16:37 ` [PATCH 2/3] tests: ignore test if kernel doesn't support minix fs Milan Broz
  2012-10-05 16:37 ` [PATCH 3/3] tests: fix mount move test to work with shared mount Milan Broz
@ 2012-10-09 11:50 ` Karel Zak
  2 siblings, 0 replies; 4+ messages in thread
From: Karel Zak @ 2012-10-09 11:50 UTC (permalink / raw)
  To: Milan Broz; +Cc: util-linux

On Fri, Oct 05, 2012 at 06:37:38PM +0200, Milan Broz wrote:
>  1 file changed, 1 insertion(+)

 All three patches applied, thanks.

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-09 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-05 16:37 [PATCH 1/3] tests: fix timezone for cramfs Milan Broz
2012-10-05 16:37 ` [PATCH 2/3] tests: ignore test if kernel doesn't support minix fs Milan Broz
2012-10-05 16:37 ` [PATCH 3/3] tests: fix mount move test to work with shared mount Milan Broz
2012-10-09 11:50 ` [PATCH 1/3] tests: fix timezone for cramfs Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).