Skip to contentSkip to conversation

main - aux: add wait_recalc

PATCH Zdenek Kabelac 1 participant 1 message Apr 21, 2023

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=80ebec099dbb20e46655958e1ca7fcfd466b78d8
Commit:        80ebec099dbb20e46655958e1ca7fcfd466b78d8
Parent:        4e0aab74288390b633c25c1bcf3efdb127e3a364
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Apr 20 17:08:42 2023 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Apr 21 14:52:43 2023 +0200

aux: add wait_recalc

Share function across tests.

---
 test/lib/aux.sh                     |  25 ++++
 test/shell/integrity-blocksize-2.sh |  43 +-----
 test/shell/integrity-blocksize-3.sh |  67 +++------
 test/shell/integrity-caching.sh     | 154 ++++++++------------
 test/shell/integrity-dmeventd.sh    |  61 ++------
 test/shell/integrity-large.sh       |  43 +-----
 test/shell/integrity-syncaction.sh  |  55 ++-----
 test/shell/integrity.sh             | 282 ++++++++++++++++--------------------
 8 files changed, 268 insertions(+), 462 deletions(-)
test/lib/aux.sh +25 -0
index 33710a007..62635ce84 100644
@@ -1757,6 +1757,31 @@ wait_for_sync() {
 	return 1
 }
 
+wait_recalc() {
+	local checklv=$1
+
+	for i in {1..100} ; do
+		sync=$(get lv_field "$checklv" sync_percent | cut -d. -f1)
+		echo "sync_percent is $sync"
+
+		test "$sync" = "100" && return
+
+		sleep .1
+	done
+
+	# TODO: There is some strange bug, first leg of RAID with integrity
+	# enabled never gets in sync. I saw this in BB, but not when executing
+	# the commands manually
+#	if test -z "$sync"; then
+#		echo "TEST\ WARNING: Resync of dm-integrity device '$checklv' failed"
+#                dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
+#		exit
+#	fi
+	echo "Timeout waiting for recalc"
+	dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
+	return 1
+}
+
 # Check if tests are running on 64bit architecture
 can_use_16T() {
 	test "$(getconf LONG_BIT)" -eq 64
test/shell/integrity-blocksize-2.sh +6 -37

67 lines not on this page · raw message

test/shell/integrity-blocksize-3.sh +18 -49

127 lines not on this page · raw message

test/shell/integrity-caching.sh +61 -93

280 lines not on this page · raw message

test/shell/integrity-dmeventd.sh +15 -46

91 lines not on this page · raw message

test/shell/integrity-large.sh +6 -37

67 lines not on this page · raw message

test/shell/integrity-syncaction.sh +12 -43

87 lines not on this page · raw message

test/shell/integrity.sh +125 -157

509 lines not on this page · raw message