1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +03:00

tests: check for open_count

Instead of checking /proc/mounts check for open_count of snap device.
Parallel umount has race, so check for open_count.
This commit is contained in:
Zdenek Kabelac 2015-05-04 10:18:44 +02:00
parent 7a588bce7b
commit 2d10a6f6ae

View File

@ -30,14 +30,17 @@ lvchange --monitor y $vg/snap
mkdir "$mntdir"
mount "$DM_DEV_DIR/mapper/$vg-snap" "$mntdir"
mount
cat /proc/mounts | grep "$mntdir"
not dd if=/dev/zero of="$mntdir/file$1" bs=1M count=5 oflag=direct
#dmeventd only checks every 10 seconds :(
for i in {1..10}; do
cat /proc/mounts | grep "$mntdir" || break
sleep 1
# 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
done
cat /proc/mounts | not grep "$mntdir"