summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2015-09-18 15:08:28 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2015-09-18 17:45:46 +0200
commit7d1dd5f52d26ebe15dd6de211001ece975be2c7c (patch)
tree99646a2789d977eb5a9425132afb750fb9d66042
parent330d584617778b2ac3a852d482c6b8d49818d9eb (diff)
downloadlvm2-7d1dd5f52d26ebe15dd6de211001ece975be2c7c.tar.gz
tests: use remount-ro for extfs
Avoid showing kernel warn of umounting broken fs.
-rw-r--r--test/shell/snapshot-autoumount-dmeventd.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/shell/snapshot-autoumount-dmeventd.sh b/test/shell/snapshot-autoumount-dmeventd.sh
index 9fc1c724c..e82a757b2 100644
--- a/test/shell/snapshot-autoumount-dmeventd.sh
+++ b/test/shell/snapshot-autoumount-dmeventd.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (C) 2010-2012 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2010-2015 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@@ -31,18 +31,23 @@ lvcreate -s -L4 -n snap $vg/base
lvchange --monitor y $vg/snap
mkdir "$mntdir"
-mount "$DM_DEV_DIR/mapper/$vg-snap" "$mntdir"
+# Use remount-ro to avoid logging kernel WARNING
+mount -o errors=remount-ro "$DM_DEV_DIR/mapper/$vg-snap" "$mntdir"
+
+test $(dmsetup info -c --noheadings -o open $vg-snap) -eq 1
cat /proc/mounts | grep "$mntdir"
-not dd if=/dev/zero of="$mntdir/file$1" bs=1M count=5 conv=fdatasync
+
+# overfill 4M snapshot (with metadata)
+not dd if=/dev/zero of="$mntdir/file$1" bs=1M count=4 conv=fdatasync
# Should be nearly instant check of dmeventd for invalid snapshot.
# Wait here for umount and open_count drops to 0 as it may
# take a while to finalize umount operation (it might be already
# removed from /proc/mounts, but still opened).
for i in {1..100}; do
- test $(dmsetup info -c --noheadings -o open $vg-snap) -eq 0 && break
sleep .1
+ test $(dmsetup info -c --noheadings -o open $vg-snap) -eq 0 && break
done
cat /proc/mounts | not grep "$mntdir"