From bc286910ecb9a1a5962b93618852d1ed4a7ca7dc Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Fri, 6 Apr 2018 15:25:46 +0200 Subject: [PATCH] test: add lvcreate-raid-volume_list Test that no (Sub)LV remnants persist if the volume group is not listed in configuration variable activation/volume_list, hence not activatable thus causing initialization of rmeta SubLVs to fail. Related: rhbz1161347 --- WHATS_NEW | 1 + test/shell/lvcreate-raid-volume_list.sh | 42 +++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 test/shell/lvcreate-raid-volume_list.sh diff --git a/WHATS_NEW b/WHATS_NEW index 37503419f..e5d34dc24 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.178 - ===================================== + Add test for activation/volume_list (Sub)LV remnants. Disallow usage of cache format 2 with mq cache policy. Again accept striped LV as COW LV with lvconvert -s (2.02.169). Fix raid target version testing for supported features. diff --git a/test/shell/lvcreate-raid-volume_list.sh b/test/shell/lvcreate-raid-volume_list.sh new file mode 100644 index 000000000..a47b9614d --- /dev/null +++ b/test/shell/lvcreate-raid-volume_list.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2018 Red Hat, Inc. All rights reserved. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions +# of the GNU General Public License v.2. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +SKIP_WITH_LVMLOCKD=1 +SKIP_WITH_LVMPOLLD=1 + +# bz1161347 - When raid creation is aborted, left-over devices appear + +. lib/inittest + +######################################################## +# MAIN +######################################################## +aux have_raid 1 3 0 || skip + +aux prepare_pvs 2 # 2 devices for RAID1 +get_devs +vgcreate -s 512k "$vg" "${DEVICES[@]}" + +aux lvmconf "activation/volume_list = [ \"vg_not_exist\" ]" + +########################################################## +# Create 2-way raid1 which fails due to $vg not listed on +# activation/volume_list. Check for any (Sub)LV remnants. +########################################################## +not lvcreate --yes --type raid1 -l 2 -n $lv $vg +check lv_not_exists $vg/${lv}_rmeta_0 +check lv_not_exists $vg/${lv}_rmeta_1 +check lv_not_exists $vg/${lv}_rimage_0 +check lv_not_exists $vg/${lv}_rimage_1 +check lv_not_exists $vg/$lv + +vgremove -ff $vg