* master - tests: update test
@ 2013-06-04 13:58 Zdenek Kabelac
0 siblings, 0 replies; 5+ messages in thread
From: Zdenek Kabelac @ 2013-06-04 13:58 UTC (permalink / raw)
To: lvm-devel
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c0f995050f04f075eda9025db514be08b13c9a6e
Commit: c0f995050f04f075eda9025db514be08b13c9a6e
Parent: c8dda314666437852ffcd515e60433c66702a36e
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Tue Jun 4 10:37:08 2013 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Tue Jun 4 15:57:33 2013 +0200
tests: update test
Fix !test -> test !
---
test/shell/inconsistent-metadata.sh | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/test/shell/inconsistent-metadata.sh b/test/shell/inconsistent-metadata.sh
index 9f4ffd2..4894861 100644
--- a/test/shell/inconsistent-metadata.sh
+++ b/test/shell/inconsistent-metadata.sh
@@ -43,7 +43,7 @@ not grep "Inconsistent metadata found for VG $vg" cmd.out
check
# only vgscan would have noticed metadata inconsistencies when lvmetad is active
-if !test -e LOCAL_LVMETAD; then
+if test ! -e LOCAL_LVMETAD; then
# vgdisplay fixes
init
vgdisplay $vg 2>&1 | tee cmd.out
@@ -77,4 +77,5 @@ aux backup_dev "$dev2"
vgcreate $vg "$dev1"
vgextend $vg "$dev2"
aux restore_dev "$dev2"
+vgscan $cache
should check compare_fields vgs $vg vg_mda_count pvs "$dev2" vg_mda_count
^ permalink raw reply related [flat|nested] 5+ messages in thread
* master - tests: update test
@ 2014-02-04 13:51 Zdenek Kabelac
0 siblings, 0 replies; 5+ messages in thread
From: Zdenek Kabelac @ 2014-02-04 13:51 UTC (permalink / raw)
To: lvm-devel
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ef557b8091ff67f38424d3f8413f3a543275b01d
Commit: ef557b8091ff67f38424d3f8413f3a543275b01d
Parent: 324781953178ed9787257334a73d93e731add0c4
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Mon Feb 3 18:26:55 2014 +0100
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Tue Feb 4 14:49:38 2014 +0100
tests: update test
Remove some unneeded traces and outputs.
---
test/lib/aux.sh | 3 ++-
test/shell/lvconvert-repair-dmeventd.sh | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 2a882a2..3c02d40 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -52,6 +52,7 @@ prepare_clvmd() {
prepare_dmeventd() {
if pgrep dmeventd ; then
+ rm -f debug.log
echo "Cannot test dmeventd with real dmeventd ($(pgrep dmeventd)) running."
skip
fi
@@ -654,7 +655,7 @@ skip_if_raid456_replace_broken() {
udev_wait() {
pgrep udev >/dev/null || return 0
- which udevadm >/dev/null || return 0
+ which udevadm &>/dev/null || return 0
if test -n "$1" ; then
udevadm settle --exit-if-exists="$1" || true
else
diff --git a/test/shell/lvconvert-repair-dmeventd.sh b/test/shell/lvconvert-repair-dmeventd.sh
index 55eee37..1604ecb 100644
--- a/test/shell/lvconvert-repair-dmeventd.sh
+++ b/test/shell/lvconvert-repair-dmeventd.sh
@@ -14,8 +14,8 @@
which mkfs.ext2 || skip
aux skip_if_mirror_recovery_broken
-aux prepare_vg 5
aux prepare_dmeventd
+aux prepare_vg 5
lvcreate -aey --type mirror -m 3 --ignoremonitoring -L 1 -n 4way $vg
lvchange --monitor y $vg/4way
^ permalink raw reply related [flat|nested] 5+ messages in thread
* master - tests: update test
@ 2016-02-12 9:22 Zdenek Kabelac
0 siblings, 0 replies; 5+ messages in thread
From: Zdenek Kabelac @ 2016-02-12 9:22 UTC (permalink / raw)
To: lvm-devel
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a077a649837b6d60d892516e32be8854bfb57ee7
Commit: a077a649837b6d60d892516e32be8854bfb57ee7
Parent: befe0078ad15563967d8b8321638c75a4f25f438
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Fri Feb 12 10:21:07 2016 +0100
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Fri Feb 12 10:21:07 2016 +0100
tests: update test
Upgrade test to count with much faster dmeventd work thanks
to low_watter_mark support.
Fix some wrong tests.
---
test/shell/thin-autoumount-dmeventd.sh | 47 +++++++++++++++++++++-----------
1 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/test/shell/thin-autoumount-dmeventd.sh b/test/shell/thin-autoumount-dmeventd.sh
index 781a27e..6b7c7c1 100644
--- a/test/shell/thin-autoumount-dmeventd.sh
+++ b/test/shell/thin-autoumount-dmeventd.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright (C) 2012 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2012-2016 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
@@ -15,9 +15,9 @@ SKIP_WITH_LVMPOLLD=1
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
-is_dir_mounted_()
+is_lv_opened_()
{
- cat /proc/mounts | sed 's:\\040: :g' | grep "$1"
+ test $(get lv_field "$1" lv_device_open --binary) = "1"
}
. lib/inittest
@@ -31,6 +31,7 @@ aux have_thin 1 0 0 || skip
aux prepare_dmeventd
+# Use autoextend percent 0 - so extension fails and triggers umount...
aux lvmconf "activation/thin_pool_autoextend_percent = 0" \
"activation/thin_pool_autoextend_threshold = 70"
@@ -51,24 +52,38 @@ mkdir "$mntdir" "$mntusedir"
mount "$DM_DEV_DIR/mapper/$vg-$lv1" "$mntdir"
mount "$DM_DEV_DIR/mapper/$vg-$lv2" "$mntusedir"
-is_dir_mounted_ "$mntdir"
+# Check both LVs are opened (~mounted)
+is_lv_opened_ "$vg/$lv1"
+is_lv_opened_ "$vg/$lv2"
-# fill above 70%
-dd if=/dev/zero of="$mntdir/file$$" bs=1M count=6
touch "$mntusedir/file$$"
-tail -f "$mntusedir/file$$" &
-PID_TAIL=$!
sync
-lvs -a $vg
-sleep 12 # dmeventd only checks every 10 seconds :(
-lvs -a $vg
-# both dirs should be unmounted
-not is_dir_mounted "$mntdir"
-not is_dir_mounted "$mntusedir"
+# Running 'keeper' process sleep holds the block device still in use
+sleep 60 < "$mntusedir/file$$" &
+PID_SLEEP=$!
-# running tail keeps the block device still in use
-kill $PID_TAIL
+# Fill pool above 70%
+dd if=/dev/zero of="$mntdir/file$$" bs=1M count=6 conv=fdatasync
lvs -a $vg
+# Could loop here for a few secs so dmeventd can do some work
+# In the worst case check only happens every 10 seconds :(
+# With low water mark it should react way faster
+for i in $(seq 1 12) ; do
+ is_lv_opened_ "$vg/$lv1" || break
+ test $i -lt 12 || die "$mntdir should have been unmounted by dmeventd!"
+ sleep 1
+done
+
+is_lv_opened_ "$vg/$lv2" || \
+ die "$mntusedir is not mounted here (sleep already expired??) "
+
+# Kill device holding process
+kill $PID_SLEEP
+wait
+
+is_lv_opened_ "$vg/$lv2" && \
+ { mount; die "$mntusedir should have been unmounted by dmeventd!" }
+
vgremove -f $vg
^ permalink raw reply related [flat|nested] 5+ messages in thread
* master - tests: update test
@ 2016-12-23 12:16 Zdenek Kabelac
0 siblings, 0 replies; 5+ messages in thread
From: Zdenek Kabelac @ 2016-12-23 12:16 UTC (permalink / raw)
To: lvm-devel
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=96a1943fb8d208aa84c386cf48f2b62038b09e2e
Commit: 96a1943fb8d208aa84c386cf48f2b62038b09e2e
Parent: 14902d173917e814061a80f16ea54435abba1f91
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Fri Dec 23 12:52:45 2016 +0100
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Fri Dec 23 13:16:35 2016 +0100
tests: update test
lvm2 now correctly reports thin_id after action of merged thin,
but before physical metadata update as we know the merge has happened.
---
test/shell/thin-vglock.sh | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/test/shell/thin-vglock.sh b/test/shell/thin-vglock.sh
index e59636d..40f3adf 100644
--- a/test/shell/thin-vglock.sh
+++ b/test/shell/thin-vglock.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2014 Red Hat, Inc. All rights reserved.
+# Copyright (C) 2014-2016 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
@@ -37,15 +37,24 @@ check lv_field $vg/snap thin_id "3"
lvconvert --merge $vg/snap
umount mnt
+
+check lv_field $vg/$lv1 thin_id "1"
+check lv_field $vg/pool transaction_id "3"
+
vgchange -an $vg
# Check reboot case
vgchange -ay --sysinit $vg
-# Metadata are still not updated (--poll n)
-check lv_field $vg/$lv1 thin_id "1"
+
+# Check correct thin_id is shown after activation
+# even when metadata were not yet physically modified.
+# Merge take its place during activation,
+# but pool transaction_id still needs metadata update.
+check lv_field $vg/$lv1 thin_id "3"
check lv_field $vg/pool transaction_id "3"
# Check the metadata are updated after refresh
+#
vgchange --refresh $vg
check lv_field $vg/$lv1 thin_id "3"
check lv_field $vg/pool transaction_id "4"
^ permalink raw reply related [flat|nested] 5+ messages in thread
* master - tests: update test
@ 2020-09-22 21:46 Zdenek Kabelac
0 siblings, 0 replies; 5+ messages in thread
From: Zdenek Kabelac @ 2020-09-22 21:46 UTC (permalink / raw)
To: lvm-devel
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=adead83dc2763a12f2f0e711793b5fd8c446b3f9
Commit: adead83dc2763a12f2f0e711793b5fd8c446b3f9
Parent: cbed63eeb9d06958a42721dcd2093ff80582f47d
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Tue Sep 22 23:26:28 2020 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Tue Sep 22 23:28:43 2020 +0200
tests: update test
Shorten running time of the test.
Fix some issues in invoked resizing script to it returns
correct return code and dmeventd can be a little bit quicker
in this test.
---
test/shell/vdo-autoumount-dmeventd.sh | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/test/shell/vdo-autoumount-dmeventd.sh b/test/shell/vdo-autoumount-dmeventd.sh
index 0d0747a32..e0449ffe8 100644
--- a/test/shell/vdo-autoumount-dmeventd.sh
+++ b/test/shell/vdo-autoumount-dmeventd.sh
@@ -42,19 +42,21 @@ export MKE2FS_CONFIG="$TESTDIR/lib/mke2fs.conf"
aux have_vdo 6 2 0 || skip
# Simple implementation of umount when lvextend fails
+# Script enforces failin exit, so dmeventd tries several times
+# repeatedly to invoke this for given percentage
cat <<- EOF >testcmd.sh
#!/bin/sh
echo "VDO Pool: \$DMEVENTD_VDO_POOL"
"$TESTDIR/lib/lvextend" --use-policies \$1 || {
- umount "$mntdir" || true
- return 0
+ umount "$mntdir" && exit 0
+ touch $PWD/TRIED_UMOUNT
}
test "\$($TESTDIR/lib/lvs -o selected -S "data_percent>=$PERCENT" --noheadings \$1)" -eq 0 || {
- umount "$mntdir" || true
- return 0
+ echo "Percentage still above $PERCENT"
}
+exit 1
EOF
chmod +x testcmd.sh
# Show prepared script
@@ -63,7 +65,7 @@ cat testcmd.sh
# Use autoextend percent 0 - so extension fails and triggers umount...
aux lvmconf "activation/vdo_pool_autoextend_percent = 0" \
"activation/vdo_pool_autoextend_threshold = $PERCENT" \
- "dmeventd/vdo_command = \"/$PWD/testcmd.sh\"" \
+ "dmeventd/vdo_command = \"$PWD/testcmd.sh\"" \
"allocation/vdo_slab_size_mb = 128"
aux prepare_dmeventd
@@ -92,7 +94,7 @@ PID_SLEEP=$!
lvs -a $vg
# Fill pool above 95% (to cause 'forced lazy umount)
-dd if=/dev/urandom of="$mntdir/file$$" bs=256K count=200 conv=fdatasync
+dd if=/dev/urandom of="$mntdir/file$$" bs=256K count=200 oflag=direct
lvs -a $vg
@@ -100,9 +102,11 @@ lvs -a $vg
# In the worst case check only happens every 10 seconds :(
for i in $(seq 1 12) ; do
is_lv_opened_ "$vg/$lv1" || break
+ test ! -f "TRIED_UMOUNT" || continue # finish loop quickly
sleep 1
done
+rm -f "TRIED_UMOUNT"
test "$i" -eq 12 || die "$mntdir should NOT have been unmounted by dmeventd!"
lvs -a $vg
@@ -119,3 +123,5 @@ for i in $(seq 1 12) ; do
test "$i" -lt 12 || die "$mntdir should have been unmounted by dmeventd!"
sleep 1
done
+
+# vgremove is managed through cleanup_mounted_and_teardown()
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-09-22 21:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-22 21:46 master - tests: update test Zdenek Kabelac
-- strict thread matches above, loose matches on Subject: below --
2016-12-23 12:16 Zdenek Kabelac
2016-02-12 9:22 Zdenek Kabelac
2014-02-04 13:51 Zdenek Kabelac
2013-06-04 13:58 Zdenek Kabelac
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.