Skip to contentSkip to conversation

master - tests: autoactivation tests for use without lvmetad

PATCH David Teigland 1 participant 1 message Jul 10, 2018

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=06439a256217b5d37ef33833051fc322a58b4859
Commit:        06439a256217b5d37ef33833051fc322a58b4859
Parent:        db741e75a21bd9327ed1478e42495f2b0a419be9
Author:        David Teigland <[email protected]>
AuthorDate:    Tue Jul 10 09:58:22 2018 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Tue Jul 10 10:49:34 2018 -0500

tests: autoactivation tests for use without lvmetad

Adjust a few lvmetad pvscan/autoactivation tests to be used without lvmetad, and add a test to cover some cases that have not been tested before.

---
 .../shell/lvmetad-pvscan-autoactivation-polling.sh |   75 ----------
 test/shell/lvmetad-pvscan-cache.sh                 |   63 ---------
 test/shell/lvmetad-pvscan-nomda-bg.sh              |   59 --------
 test/shell/pvscan-autoactivate.sh                  |  143 ++++++++++++++++++++
 test/shell/pvscan-autoactivation-polling.sh        |   74 ++++++++++
 test/shell/pvscan-cache.sh                         |   62 +++++++++
 test/shell/pvscan-nomda-bg.sh                      |   41 ++++++
 7 files changed, 320 insertions(+), 197 deletions(-)
test/shell/lvmetad-pvscan-autoactivation-polling.sh deleted +0 -75
deleted file mode 100644
index 46c454b..0000000
@@ -1,75 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright (C) 2016 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_WITHOUT_LVMETAD=1
-
-. lib/inittest
-
-# test if snapshot-merge target is available
-aux target_at_least dm-snapshot-merge 1 0 0 || skip
-
-which mkfs.ext3 || skip
-
-lvdev_() {
-    echo "$DM_DEV_DIR/$1/$2"
-}
-
-snap_lv_name_() {
-    echo ${1}_snap
-}
-
-setup_merge_() {
-    local VG_NAME=$1
-    local LV_NAME=$2
-    local NUM_EXTRA_SNAPS=${3:-0}
-    local BASE_SNAP_LV_NAME
-
-    BASE_SNAP_LV_NAME=$(snap_lv_name_ $LV_NAME)
-
-    lvcreate -aey -n $LV_NAME -l 50%FREE $VG_NAME
-    lvs
-    lvcreate -s -n $BASE_SNAP_LV_NAME -l 20%FREE ${VG_NAME}/${LV_NAME}
-    mkfs.ext3 "$(lvdev_ $VG_NAME $LV_NAME)"
-
-    if [ $NUM_EXTRA_SNAPS -gt 0 ]; then
-	for i in $(seq 1 $NUM_EXTRA_SNAPS); do
-	    lvcreate -s -n ${BASE_SNAP_LV_NAME}_${i} -l 20%ORIGIN ${VG_NAME}/${LV_NAME}
-	done
-    fi
-}
-
-aux prepare_pvs 1 50
-
-vgcreate $vg1 "$dev1"
-mkdir test_mnt
-
-setup_merge_ $vg1 $lv1
-mount "$(lvdev_ $vg1 $lv1)" test_mnt
-lvconvert --merge "$vg1/$(snap_lv_name_ "$lv1")"
-umount test_mnt
-vgchange -an $vg1
-
-# check snapshot get removed on autoactivation
-pvscan --cache -aay "$dev1"
-
-check active $vg1 $lv1
-i=100
-while ! check lv_not_exists "$vg1/$(snap_lv_name_ "$lv1")"; do
-	test $i -lt 0 && fail "Background polling failed to remove merged snapshot LV"
-	sleep .1
-	i=$((i-1))
-done
-
-# TODO: add similar simple tests for other interrupted/unfinished polling operation
-
-vgremove -ff $vg1
test/shell/lvmetad-pvscan-cache.sh deleted +0 -63

63 lines not on this page · raw message

test/shell/lvmetad-pvscan-nomda-bg.sh deleted +0 -59

59 lines not on this page · raw message

test/shell/pvscan-autoactivate.sh new file +143 -0

143 lines not on this page · raw message

test/shell/pvscan-autoactivation-polling.sh new file +74 -0

74 lines not on this page · raw message

test/shell/pvscan-cache.sh new file +62 -0

62 lines not on this page · raw message

test/shell/pvscan-nomda-bg.sh new file +41 -0

41 lines not on this page · raw message