main - tests: dbus update
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=25c665d5559e77c1eb0...
Commit: 25c665d5559e77c1eb0f67527fa95419a84b7553
Parent: 6db533c4393e1e8ca02e957c529afaf67fa7e20b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 26 13:13:26 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 26 13:13:26 2021 +0100
tests: dbus update
Always use PREFIX for vg header - all tests must use this prefix,
VGs without are not allowed.
Modify pv_symlink test - as the test was checking unsupportable
combination - since lvm2 commands withing testsuite are only
allowed to manipulate with /dev/mapper/LVMTESTXXXX path -
nothing else allowed and fails on being filtered.
---
test/dbus/lvmdbustest.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index efa1afb26..6dab312c0 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -59,7 +59,7 @@ if pv_device_list:
def vg_n(prefix=None):
- name = rs(8, '_vg')
+ name = g_prefix + '_vg'
if prefix:
name = prefix + name
return name
@@ -1838,7 +1838,6 @@ class TestDbusService(unittest.TestCase):
# typically utilizes loopback, this test is skipped in
# those environments.
pv_object_path = self.objs[PV_INT][0].object_path
-
if not self.objs[PV_INT][0].Pv.Name.startswith("/dev"):
raise unittest.SkipTest('test not running in /dev')
@@ -1867,8 +1866,9 @@ class TestDbusService(unittest.TestCase):
# Lets locate a symlink for it
devices = glob('/dev/disk/*/*')
+ rp_pv_device_path = os.path.realpath(pv_device_path)
for d in devices:
- if pv_device_path == os.path.realpath(d):
+ if rp_pv_device_path == os.path.realpath(d):
symlink = d
break
@@ -1878,14 +1878,16 @@ class TestDbusService(unittest.TestCase):
rc = self._lookup(symlink)
self.assertEqual(rc, '/')
- pv_object_path = self._pv_create(symlink)
+ ### pv_object_path = self._pv_create(symlink)
+ ### Test is limited by filter rules and must use /dev/mapper/LVMTEST path
+ pv_object_path = self._pv_create(pv_device_path)
+
self.assertNotEqual(pv_object_path, '/')
pv_proxy = ClientProxy(self.bus, pv_object_path, interfaces=(PV_INT, ))
self.assertEqual(pv_proxy.Pv.Name, pv_device_path)
# Lets check symlink lookup
- self.assertEqual(pv_object_path, self._lookup(symlink))
self.assertEqual(pv_object_path, self._lookup(pv_device_path))
def _create_vdo_pool_and_lv(self, vg_prefix="vdo_"):
3 years
main - tests: try to observe some unusual problem
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=6db533c4393e1e8ca02...
Commit: 6db533c4393e1e8ca02e957c529afaf67fa7e20b
Parent: 3ed79d8dfe8b75830d8fd6925d7cef5ef1ebd8f2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 26 11:36:22 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 26 11:36:22 2021 +0100
tests: try to observe some unusual problem
Lets see, why it's very occasionaly able to active LV.
---
test/shell/duplicate-vgnames.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/shell/duplicate-vgnames.sh b/test/shell/duplicate-vgnames.sh
index 0f98f9c37..0bbc08937 100644
--- a/test/shell/duplicate-vgnames.sh
+++ b/test/shell/duplicate-vgnames.sh
@@ -399,7 +399,7 @@ grep $UUID2 out | grep active
grep $UUID3 out | not grep active
vgchange -an
-not vgchange -ay $vg1
+not vgchange -ay -vvvv $vg1
lvs --foreign -o vguuid,active |tee out
grep $UUID1 out | not grep active
grep $UUID2 out | not grep active
3 years
main - tests: move setting of dmeventd pid
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3ed79d8dfe8b75830d8...
Commit: 3ed79d8dfe8b75830d8fd6925d7cef5ef1ebd8f2
Parent: 85fae836c09daf457f3f8f14e3eae2179cfd2ffa
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 26 11:16:32 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 26 11:16:32 2021 +0100
tests: move setting of dmeventd pid
Added comment the 'lvs' already initiates dmeventd
Note: we don't have any query mechanism to check if dmeventd
is already running except access of socket which basically
starts dmeventd if it's not running.
---
test/shell/dmeventd-restart.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/test/shell/dmeventd-restart.sh b/test/shell/dmeventd-restart.sh
index 151f1d51a..0def8c1fa 100644
--- a/test/shell/dmeventd-restart.sh
+++ b/test/shell/dmeventd-restart.sh
@@ -41,7 +41,7 @@ test -e LOCAL_CLVMD || grep 'already monitored' lvchange.out
# now try what happens if no dmeventd is running
kill -9 "$(< LOCAL_DMEVENTD)"
-rm LOCAL_DMEVENTD
+rm LOCAL_DMEVENTD debug.log*
dmeventd -R -f &
echo $! >LOCAL_DMEVENTD
@@ -52,11 +52,12 @@ sleep 9
not pgrep dmeventd
rm LOCAL_DMEVENTD
+# First lvs restarts 'dmeventd' (initiate a socket connection to a daemon)
check lv_field $vg/3way seg_monitor "not monitored"
+pgrep -o dmeventd >LOCAL_DMEVENTD
check lv_field $vg/4way seg_monitor "not monitored"
lvchange --monitor y --verbose $vg/3way 2>&1 | tee lvchange.out
-pgrep -o dmeventd >LOCAL_DMEVENTD
test -e LOCAL_CLVMD || not grep 'already monitored' lvchange.out
lvchange --monitor y --verbose $vg/$lv2 2>&1 | tee lvchange.out
3 years
main - tests: add basic validation of running services
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=85fae836c09daf457f3...
Commit: 85fae836c09daf457f3f8f14e3eae2179cfd2ffa
Parent: 9bcc76b63c14566e5ced09ac18129e1c9a98e8e4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 26 11:13:56 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 26 11:13:56 2021 +0100
tests: add basic validation of running services
For determinist test results lvm2/dm service shall not be present
and running in the system as it may randomize test results.
In case they are found present, this test ends with warning (not failure).
---
test/shell/000-basic.sh | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/test/shell/000-basic.sh b/test/shell/000-basic.sh
index 1e511d1f0..a7b80c72b 100644
--- a/test/shell/000-basic.sh
+++ b/test/shell/000-basic.sh
@@ -34,3 +34,15 @@ get_devs
# ensure we do not crash on a bug in config file
aux lvmconf 'log/prefix = 1""'
not lvs "${DEVICES[@]}"
+
+# validate testing machine with its services is in expected state and will not interfere with tests
+if systemctl -a >out 2>/dev/null ; then
+ for i in dm-event lvm2-lvmpolld lvm2-monitor ; do
+ echo $i
+ grep $i out | not grep -v masked || {
+ cat out
+ should not echo "Present unmasked $i service/socket may randomize testing results!"
+ echo "+++++ Stop & Mask with systemctl +++++"
+ }
+ done
+fi
3 years
main - tests: add should for racy test
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9bcc76b63c14566e5ce...
Commit: 9bcc76b63c14566e5ced09ac18129e1c9a98e8e4
Parent: 5feb99dda68dd492929fff0d7b15d3ef0ab86347
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 26 00:43:44 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 26 00:43:44 2021 +0100
tests: add should for racy test
Depending on kernel, the race may or may not happen.
---
test/shell/lvextend-raid.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/shell/lvextend-raid.sh b/test/shell/lvextend-raid.sh
index 08b34d00c..87ad802c3 100644
--- a/test/shell/lvextend-raid.sh
+++ b/test/shell/lvextend-raid.sh
@@ -74,7 +74,8 @@ check lv_field $vg/$lv1 sync_percent "100.00"
lvextend -y -L+${lvext}M $vg/$lv1
if [ $PROGRESS -eq 1 ]
then
- not check lv_field $vg/$lv1 sync_percent "100.00"
+ # Even with delayed devices wre are catching races here.
+ should not check lv_field $vg/$lv1 sync_percent "100.00"
else
check lv_field $vg/$lv1 sync_percent "100.00"
fi
3 years, 1 month
main - tests: add workaround for older mdadm
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5feb99dda68dd492929...
Commit: 5feb99dda68dd492929fff0d7b15d3ef0ab86347
Parent: 0558b223b87b922faa709e7a7e0e6aaa4b7f0c42
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 26 00:35:28 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 26 00:35:28 2021 +0100
tests: add workaround for older mdadm
Some older instancies of 'mdadm' opened legs in RW and
closed and opened again and expected exlusive access.
But here udev rule can be fired - so on these versions
slow down whole mdadm runtime by using strace, to
give system a bit more time to finish udev rule.
---
test/shell/lvm-on-md.sh | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvm-on-md.sh b/test/shell/lvm-on-md.sh
index 9187d44f5..7c14e6748 100644
--- a/test/shell/lvm-on-md.sh
+++ b/test/shell/lvm-on-md.sh
@@ -27,6 +27,18 @@ _clear_online_files() {
. lib/inittest
+which mdadm || skip
+
+STRACE=
+[ "$DM_DEV_DIR" = "/dev" ] && mdadm -V 2>&1 | grep " v3.2" && {
+ # use this 'trick' to slow down mdadm which otherwise
+ # is racing with udev rule since mdadm internally
+ # opens and closes raid leg devices in RW mode and then
+ # tries to get exlusive access to the leg device during
+ # insertion to kernel and fails during assembly
+ # There could be more affted version of mdadm.
+ STRACE="strace -f -o /dev/null"
+}
# This stops lvm from taking advantage of hints which
# will have already excluded md components.
@@ -109,7 +121,7 @@ test ! -f "$RUNDIR/lvm/vgs_online/$vg"
# should not show an active lv
not dmsetup info $vg-$lv1
-mdadm --assemble "$mddev" "$dev1" "$dev2"
+$STRACE mdadm --assemble "$mddev" "$dev1" "$dev2"
aux udev_wait
not pvs "$dev1"
@@ -264,7 +276,7 @@ test ! -f "$RUNDIR/lvm/vgs_online/$vg"
not dmsetup info $vg-$lv1
# start the md dev
-mdadm --assemble "$mddev" "$dev1" "$dev2"
+$STRACE mdadm --assemble "$mddev" "$dev1" "$dev2"
aux udev_wait
not pvs "$dev1"
3 years, 1 month
main - tests: aux fix check_lvmpolld_init_rq_count
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0558b223b87b922faa7...
Commit: 0558b223b87b922faa709e7a7e0e6aaa4b7f0c42
Parent: 73710b87fb567e3d6d72b475afe9f95ccc0afad6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Mar 26 00:33:21 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Mar 26 00:33:21 2021 +0100
tests: aux fix check_lvmpolld_init_rq_count
Make check_lvmpolld_init_rq_count() more compatible with older gawk,
where some functionality was not working properly.
Also change 'not not' condition.
---
test/lib/aux.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 6c43790b7..6cf86bc38 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1743,11 +1743,11 @@ dmsetup_wrapped() {
awk_parse_init_count_in_lvmpolld_dump() {
printf '%s' \
\
- $'BEGINFILE { x=0; answ=0; FS="="; key="[[:space:]]*"vkey }' \
+ $'BEGINFILE { x=0; answ=0 }' \
$'{' \
$'if (/.*{$/) { x++ }' \
$'else if (/.*}$/) { x-- }' \
- $'else if ( x == 2 && $1 ~ key) { value=substr($2, 2); value=substr(value, 1, length(value) - 1); }' \
+ $'else if ( x == 2 && $1 ~ "[[:space:]]*"vkey) { value=substr($2, 2); value=substr(value, 1, length(value) - 1); }' \
$'if ( x == 2 && value == vvalue && $1 ~ /[[:space:]]*init_requests_count/) { answ=$2 }' \
$'if (answ > 0) { exit 0 }' \
$'}' \
@@ -1756,7 +1756,7 @@ awk_parse_init_count_in_lvmpolld_dump() {
check_lvmpolld_init_rq_count() {
local ret
- ret=$(awk -v vvalue="$2" -v vkey="${3:-lvname}" "$(awk_parse_init_count_in_lvmpolld_dump)" lvmpolld_dump.txt)
+ ret=$(awk -v vvalue="$2" -v vkey="${3:-lvname}" -F= "$(awk_parse_init_count_in_lvmpolld_dump)" lvmpolld_dump.txt)
test "$ret" -eq "$1" || {
die "check_lvmpolld_init_rq_count failed. Expected $1, got $ret"
}
@@ -1779,7 +1779,7 @@ wait_pvmove_lv_ready() {
}
test -z "$lvid" || {
lvmpolld_dump > lvmpolld_dump.txt
- ! check_lvmpolld_init_rq_count 1 "$lvid" lvid || break;
+ check_lvmpolld_init_rq_count 1 "$lvid" lvid && break;
}
sleep .1
retries=$((retries-1))
3 years, 1 month
main - WHATS_NEW: updates
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=73710b87fb567e3d6d7...
Commit: 73710b87fb567e3d6d72b475afe9f95ccc0afad6
Parent: c1f5ca6751eeda5925638447b561b05bdf8a250c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 24 16:30:23 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 24 16:41:08 2021 +0100
WHATS_NEW: updates
---
WHATS_NEW | 2 ++
1 file changed, 2 insertions(+)
diff --git a/WHATS_NEW b/WHATS_NEW
index 80e16d880..3e086f951 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.03.12 -
===================================
+ Report error when the filesystem is missing on fsadm resized volume.
+ Handle better blockdev with --getsize64 support for fsadm.
Do not include editline/history.h when using editline library.
Support lvconvert -Zn with thin-pool conversion.
Support error and zero segtype for thin-pool data for testing.
3 years, 1 month
main - tests: improve check raid_leg_status
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c1f5ca6751eeda59256...
Commit: c1f5ca6751eeda5925638447b561b05bdf8a250c
Parent: 0783c661b9eb407b0b436559b6950deefc906b4f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 24 16:05:03 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 24 16:38:12 2021 +0100
tests: improve check raid_leg_status
Enhance function to wait until raid status gets consisten
(shifts from 0/xxxxx to something else)
If it would took too long fail the check.
---
test/lib/check.sh | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/test/lib/check.sh b/test/lib/check.sh
index 4deb78a74..5b119430d 100644
--- a/test/lib/check.sh
+++ b/test/lib/check.sh
@@ -436,10 +436,19 @@ sysfs() {
raid_leg_status() {
local st
local val
- st=$(dmsetup status "$1-$2")
- val=$(echo "$st" | cut -d ' ' -f 6)
- test "$val" = "$3" || \
- die "$1-$2 status $val != $3 ($st)"
+
+ # Ignore inconsisten raid status 0/xxxxx idle
+ for i in {100..0} ; do
+ st=( $(dmsetup status $1-$2) ) || die "Unable to get status of $vg/$lv1"
+ b=( $(echo "${st[6]}" | sed s:/:' ':) )
+ [ "${b[0]}" = "0" ] || {
+ test "${st[5]}" = "$3" || break
+ return 0
+ }
+ sleep .1
+ done
+
+ die "$1-$2 status ${st[5]} != $3 ($st)"
}
grep_dmsetup() {
3 years, 1 month
main - tests: handle case of missing /dev/disk
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0783c661b9eb407b0b4...
Commit: 0783c661b9eb407b0b436559b6950deefc906b4f
Parent: 2151b71819ffd45e71f2565aa2c0d2cb9685e2c0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Mar 24 15:52:14 2021 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Mar 24 16:38:12 2021 +0100
tests: handle case of missing /dev/disk
In case there is no symlink - udev can optimize /dev/disk away,
thus find would fail in teardown.
---
test/lib/aux.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index f81d03e88..6c43790b7 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -581,7 +581,9 @@ teardown() {
}
# Remove any dangling symlink in /dev/disk (our tests can confuse udev)
- find /dev/disk -type l ! -exec test -e {} \; -print | xargs rm -f
+ test -d /dev/disk && {
+ find /dev/disk -type l ! -exec test -e {} \; -print | xargs rm -f || true
+ }
# Remove any metadata archives and backups from this test on system
rm -f /etc/lvm/archive/${PREFIX}* /etc/lvm/backup/${PREFIX}*
3 years, 1 month