All of lore.kernel.org
 help / color / mirror / Atom feed
* main - tests: added check for kernel version
@ 2021-03-17  0:00 Zdenek Kabelac
  0 siblings, 0 replies; only message in thread
From: Zdenek Kabelac @ 2021-03-17  0:00 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=53bad89a7b802890067e1c006775345098cfa4dc
Commit:        53bad89a7b802890067e1c006775345098cfa4dc
Parent:        8b2cdd8d3a8ad0b3048f38580a0dc20f6e1e492d
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Tue Mar 16 20:54:28 2021 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Wed Mar 17 00:59:50 2021 +0100

tests: added check for kernel version

With older kernels this test can't work reliable,
since 'suspend' used to clean all dirty blocks
(taking even several seconds).
---
 test/shell/lvconvert-cache-abort.sh | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/test/shell/lvconvert-cache-abort.sh b/test/shell/lvconvert-cache-abort.sh
index 652c9f421..ecb0ff44d 100644
--- a/test/shell/lvconvert-cache-abort.sh
+++ b/test/shell/lvconvert-cache-abort.sh
@@ -50,14 +50,15 @@ test "$(get lv_field $vg/$lv1 cache_dirty_blocks)" -gt 0 || {
 	skip "Cannot make a dirty writeback cache LV."
 }
 
-LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -v --splitcache $vg/$lv1 >logconvert 2>&1 &
+LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -vvvv --splitcache $vg/$lv1 >logconvert 2>&1 &
 PID_CONVERT=$!
 for i in {1..50}; do
-	dmsetup table "$vg-$lv1" | grep cleaner && break
-	test "$i" -ge 100 && die "Waited for cleaner policy on $vg/$lv1 too long!"
-	echo "Waiting for cleaner policy on $vg/$lv1"
+	dmsetup table "$vg-$lv1" |& tee out
+	grep cleaner out && break
+	echo "$i: Waiting for cleaner policy on $vg/$lv1"
 	sleep .05
 done
+test "$i" -ge 49 && die "Waited for cleaner policy on $vg/$lv1 too long!"
 
 # While lvconvert updated table to 'cleaner' policy now it 
 # should be running in 'Flushing' loop and just 1 KILL should
@@ -68,9 +69,16 @@ wait
 
 #cat logconvert || true
 
+# Problem of this test is, in older kernels, even the initial change to cleaner
+# policy table line causes long suspend which in practice is cleaning all the
+# dirty blocks - so the test can't really break the cache clearing.
+#
+# So the failure of test is reported only for recent kernels > 5.6
+# ans skipped otherwise - as those can't be fixed anyway
 grep -E "Flushing.*aborted" logconvert || {
 	cat logconvert || true
 	vgremove -f $vg
+	aux kernel_at_least 5 6 || skip "Cache missed to abort flushing with older kernel"
 	die "Flushing of $vg/$lv1 not aborted ?"
 }
 



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-17  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-17  0:00 main - tests: added check for kernel version 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.