Blob Blame History Raw
From 509497ae21a4c84f4714835c6f8017a66b666308 Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
Date: Mon, 15 Jan 2018 13:29:14 +0100
Subject: [PATCH 22/25] tests: check preserved exclusivness of snapshot merge

Detect if origin remains exclusively activated after merging.

(cherry picked from commit 8ebd45fde759c438e854d6b4f02f0e9803094fea)
---
 test/shell/snapshot-merge.sh | 4 ++++
 test/shell/thin-merge.sh     | 9 +++++++++
 2 files changed, 13 insertions(+)

diff --git a/test/shell/snapshot-merge.sh b/test/shell/snapshot-merge.sh
index 9d0a264..41e7b00 100644
--- a/test/shell/snapshot-merge.sh
+++ b/test/shell/snapshot-merge.sh
@@ -54,7 +54,11 @@ setup_merge_ $vg $lv1
 
 # make sure lvconvert --merge requires explicit LV listing
 not lvconvert --merge
+
+# check exclusive lock is preserved after merge
+check lv_field "$vg/$lv1" lv_active_exclusively "active exclusively"
 lvconvert --merge "$vg/$(snap_lv_name_ "$lv1")"
+check lv_field "$vg/$lv1" lv_active_exclusively "active exclusively"
 lvremove -f $vg/$lv1
 
 setup_merge_ $vg $lv1
diff --git a/test/shell/thin-merge.sh b/test/shell/thin-merge.sh
index 3abda40..24dec96 100644
--- a/test/shell/thin-merge.sh
+++ b/test/shell/thin-merge.sh
@@ -30,6 +30,15 @@ aux have_thin 1 0 0 || skip
 aux prepare_vg 2
 
 lvcreate -T -L8M $vg/pool -V10M -n $lv1
+lvcreate -s -K -n snap $vg/$lv1
+# check exclusive lock is preserved after merge
+check lv_field "$vg/$lv1" lv_active_exclusively "active exclusively"
+lvconvert --merge $vg/snap
+check lv_field "$vg/$lv1" lv_active_exclusively "active exclusively"
+lvremove -ff $vg
+
+
+lvcreate -T -L8M $vg/pool -V10M -n $lv1
 lvchange --addtag tagL $vg/$lv1
 
 mkdir mnt
-- 
1.8.3.1