From 8ebd45fde759c438e854d6b4f02f0e9803094fea Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 15 Jan 2018 13:29:14 +0100 Subject: [PATCH] tests: check preserved exclusivness of snapshot merge Detect if origin remains exclusively activated after merging. --- 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 9d0a2643f..41e7b00a2 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 3abda4098..24dec967d 100644 --- a/test/shell/thin-merge.sh +++ b/test/shell/thin-merge.sh @@ -29,6 +29,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