main - tests: correct generated metadata

Zdenek Kabelac <[email protected]>
Newsgroups gmane.linux.lvm.devel
Message-ID <[email protected]>
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5848f75278250835dd718fbcacc167133af66b35
Commit:        5848f75278250835dd718fbcacc167133af66b35
Parent:        0a5712ada4753cd034d862389e6e91af387c406f
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sat Jun 24 22:34:38 2023 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Sun Jun 25 12:00:57 2023 +0200

tests: correct generated metadata

Newer thin_check actually rejects such restored data.
---
 test/shell/lvextend-thin-metadata-dmeventd.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test/shell/lvextend-thin-metadata-dmeventd.sh b/test/shell/lvextend-thin-metadata-dmeventd.sh
index 3193cc29c..732f67023 100644
--- a/test/shell/lvextend-thin-metadata-dmeventd.sh
+++ b/test/shell/lvextend-thin-metadata-dmeventd.sh
@@ -48,7 +48,7 @@ fake_metadata_() {
 	for i in $(seq 10 $1)
 	do
 		echo ' <device dev_id="'$i'" mapped_blocks="30" transaction="0" creation_time="0" snap_time="0">'
-		echo '  <range_mapping origin_begin="0" data_begin="0" length="29" time="0"/>'
+		echo '  <range_mapping origin_begin="0" data_begin="0" length="30" time="0"/>'
 		echo ' </device>'
 		set +x
 	done
@@ -98,6 +98,10 @@ DATA=7200  # Newer version of thin-pool have hidden reserve, so use lower value
 test -z "$BIG_DATA" || DATA=7400
 fake_metadata_ "$DATA" 2 >data
 "$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv2"
+
+# Check tha restored metadata are OK for thin_check
+"$LVM_TEST_THIN_CHECK_CMD" "$DM_DEV_DIR/mapper/$vg-$lv2"
+
 # Swap volume with restored fake metadata
 lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv2
 lvchange -ay $vg/pool

--
lvm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/lvm-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.