master - tests: restore some test changes
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f8034e14e6c8012dbd51dc3c5e5fc1c0036e00a0 Commit: f8034e14e6c8012dbd51dc3c5e5fc1c0036e00a0 Parent: 3018cdcaa7aa258a432738b95077098985fb0c74 Author: Zdenek Kabelac <[email protected]> AuthorDate: Mon Apr 3 15:57:32 2017 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Wed Apr 12 21:34:08 2017 +0200
tests: restore some test changes
Restore existing tests and separate new tests
for new options later.
Keep coverage for existing syntax
Reverts bits from commits:
a801b92b2c81213dddccc9f9a09794208f92bfc9.d71aaca07b2c14049130ab368221510c65236af7fa2a728a395639a32707bb75e6bb4197b02769de1e2420bca85da9a37570871cd70192e9ae83178646abc28a480069b3e8b2c5c7c3448ffa25ec17ba0e3e611a137a264a343335d18d500fce7af8e0f7
--- test/shell/lvconvert-cache-snapshot.sh | 2 +- test/shell/lvconvert-cache.sh | 44 ++++++++++--------- test/shell/lvconvert-mirror.sh | 18 ++++---- test/shell/lvconvert-repair-thin.sh | 8 ++-- test/shell/lvconvert-thin-raid.sh | 6 ++- test/shell/lvconvert-thin.sh | 25 ++++++----- test/shell/lvcreate-cache.sh | 3 +- test/shell/lvextend-thin-full.sh | 2 +- test/shell/lvextend-thin-metadata-dmeventd.sh | 12 +++--- .../shell/lvmetad-pvscan-autoactivation-polling.sh | 2 +- test/shell/snapshot-merge-stack.sh | 2 +- test/shell/snapshot-merge.sh | 16 ++++---- test/shell/thin-flags.sh | 2 +- test/shell/thin-merge.sh | 6 +- test/shell/thin-vglock.sh | 2 +- test/shell/vgextend-restoremissing.sh | 2 + 16 files changed, 81 insertions(+), 71 deletions(-)
test/shell/lvconvert-cache-snapshot.sh +1 -1
@@ -33,7 +33,7 @@ lvcreate -L3 -n cow $vg not lvconvert -s cow $vg/$lv1 # Use cached LV with 'striped' cow volume -lvconvert -y -s $vg/$lv1 $vg/cow +lvconvert -y -s $vg/$lv1 cow check lv_field $vg/cow segtype linear check lv_field $vg/$lv1 segtype cache
test/shell/lvconvert-cache.sh +23 -21
80 lines not on this page · raw message
test/shell/lvconvert-mirror.sh +9 -9
@@ -87,7 +87,7 @@ aux delay_dev "$dev2" 0 2000 ${offset}:1 lvcreate -aey -l5 -Zn -Wn --type mirror --regionsize 16K -m2 -n $lv1 $vg "$dev1" "$dev2" "$dev4" "$dev3:$DEVRANGE" should not lvconvert -m-1 $vg/$lv1 "$dev1" aux enable_dev "$dev2" -lvconvert --startpoll $vg/$lv1 || true # wait +should lvconvert $vg/$lv1 # wait lvconvert -m2 $vg/$lv1 "$dev1" "$dev2" "$dev4" "$dev3:0" # If the above "should" failed... aux wait_for_sync $vg $lv1
@@ -113,7 +113,7 @@ LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4" # Next convert should fail b/c we can't have 2 at once should not lvconvert -m+1 $vg/$lv1 "$dev5" aux enable_dev "$dev4" -lvconvert --startpoll $vg/$lv1 || true # wait +should lvconvert $vg/$lv1 # wait lvconvert -m2 $vg/$lv1 # In case the above "should" actually failed check mirror $vg $lv1 "$dev3"
@@ -156,7 +156,7 @@ lvcreate -aey -l2 --type mirror -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:$DEVRANGE lvchange -an $vg/$lv1 lvconvert -m+1 $vg/$lv1 "$dev4" lvchange -aey $vg/$lv1 -lvconvert --startpoll $vg/$lv1 || true # wait +should lvconvert $vg/$lv1 # wait check mirror $vg $lv1 "$dev3" check mirror_no_temporaries $vg $lv1 lvremove -ff $vg
@@ -168,7 +168,7 @@ lvremove -ff $vg lvcreate -aey -l2 --type mirror -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:$DEVRANGE" LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4" lvconvert -m-1 $vg/$lv1 "$dev4" -lvconvert --startpoll $vg/$lv1 || true # wait +should lvconvert $vg/$lv1 # wait check mirror $vg $lv1 "$dev3" check mirror_no_temporaries $vg $lv1
@@ -179,7 +179,7 @@ lvremove -ff $vg lvcreate -aey -l2 --type mirror -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:$DEVRANGE" LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+2 -b $vg/$lv1 "$dev4" "$dev5" lvconvert -m-1 $vg/$lv1 "$dev4" -lvconvert --startpoll $vg/$lv1 || true # wait +should lvconvert $vg/$lv1 # wait check mirror $vg $lv1 "$dev3" check mirror_no_temporaries $vg $lv1
@@ -192,9 +192,9 @@ LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4" # FIXME: Extra wait here for mirror upconvert synchronization # otherwise we may fail her on parallel upconvert and downconvert # lvconvert-mirror-updown.sh tests this errornous case separately -lvconvert --startpoll $vg/$lv1 || true +should lvconvert $vg/$lv1 lvconvert -m-1 $vg/$lv1 "$dev2" -lvconvert --startpoll $vg/$lv1 || true +should lvconvert $vg/$lv1 check mirror $vg $lv1 "$dev3" check mirror_no_temporaries $vg $lv1
@@ -207,9 +207,9 @@ LVM_TEST_TAG="kill_me_$PREFIX" lvconvert -m+1 -b $vg/$lv1 "$dev4" # FIXME: Extra wait here for mirror upconvert synchronization # otherwise we may fail her on parallel upconvert and downconvert # lvconvert-mirror-updown.sh tests this errornous case separately -lvconvert --startpoll $vg/$lv1 || true +should lvconvert $vg/$lv1 lvconvert -m-1 $vg/$lv1 "$dev2" -lvconvert --startpoll $vg/$lv1 || true +should lvconvert $vg/$lv1 check mirror $vg $lv1 "$dev3" check mirror_no_temporaries $vg $lv1
test/shell/lvconvert-repair-thin.sh +4 -4
@@ -45,7 +45,7 @@ lvchange -an $vg/$lv2 $vg/$lv1 $vg/pool $vg/repair # Manual repair steps: # Test swapping - swap out thin-pool's metadata with our repair volume -lvconvert -y -f --swapmetadata --poolmetadata $vg/repair $vg/pool +lvconvert -y -f --poolmetadata $vg/repair --thinpool $vg/pool lvchange -ay $vg/repair
@@ -74,7 +74,7 @@ not "$LVM_TEST_THIN_DUMP_CMD" "$DM_DEV_DIR/$vg/repair" | tee dump lvchange -an $vg # Swap repaired metadata back -lvconvert -y -f --swapmetadata --poolmetadata $vg/fixed $vg/pool +lvconvert -y -f --poolmetadata $vg/fixed --thinpool $vg/pool # Check pool still preserves its original settings check lv_field $vg/pool chunksize "128.00k"
@@ -87,7 +87,7 @@ vgchange -ay $vg vgchange -an $vg # Put back 'broken' metadata -lvconvert -y -f --swapmetadata --poolmetadata $vg/repair $vg/pool +lvconvert -y -f --poolmetadata $vg/repair --thinpool $vg/pool # Check --repair usage lvconvert -v --repair $vg/pool
@@ -98,7 +98,7 @@ lvchange -ay $vg/pool vgchange -an $vg # Restore damaged metadata -lvconvert -y -f --swapmetadata --poolmetadata $vg/pool_meta0 $vg/pool +lvconvert -y -f --poolmetadata $vg/pool_meta0 --thinpool $vg/pool # Check lvremove -ff works even with damaged pool lvremove -ff $vg
test/shell/lvconvert-thin-raid.sh +4 -2
@@ -29,9 +29,11 @@ aux wait_for_sync $vg $lv1 aux wait_for_sync $vg $lv2 lvchange -an $vg/$lv1 +# FIXME: temporarily we return error code 5 +INVALID=not # conversion fails for internal volumes -not lvconvert --thinpool $vg/${lv1}_rimage_0 -not lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/${lv2}_rimage_0 +$INVALID lvconvert --thinpool $vg/${lv1}_rimage_0 +$INVALID lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/${lv2}_rimage_0 lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/$lv2
test/shell/lvconvert-thin.sh +14 -11
@@ -57,14 +57,17 @@ lvchange -an $vg/$lv1 # conversion fails for mirror segment type fail lvconvert --thinpool $vg/$lv1 + +# FIXME: temporarily we return error code 5 +INVALID=not # cannot use same LV -not lvconvert --yes --thinpool $vg/$lv2 --poolmetadata $vg/$lv2 +$INVALID lvconvert --yes --thinpool $vg/$lv2 --poolmetadata $vg/$lv2 prepare_lvs # conversion fails for internal volumes # can't use --readahead with --poolmetadata -not lvconvert --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 --readahead 512 +invalid lvconvert --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 --readahead 512 lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 prepare_lvs
@@ -81,9 +84,9 @@ grep "Pool zeroing and large" err UUID=$(get lv_field $vg/$lv2 uuid) # Fail is pool is active # TODO maybe detect inactive pool and deactivate -fail lvconvert --swapmetadata --yes --poolmetadata $lv2 $vg/$lv1 +fail lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $lv2 lvchange -an $vg -lvconvert --swapmetadata --yes --poolmetadata $lv2 $vg/$lv1 +lvconvert --yes --thinpool $vg/$lv1 --poolmetadata $lv2 check lv_field $vg/${lv1}_tmeta uuid "$UUID" lvremove -f $vg
@@ -96,20 +99,20 @@ lvcreate -L1M -n $lv3 $vg # chunk size is bigger then size of thin pool data fail lvconvert --yes -c 1G --thinpool $vg/$lv3 # stripes can't be used with poolmetadata -not lvconvert --stripes 2 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 +invalid lvconvert --stripes 2 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 # too small metadata (<2M) fail lvconvert --yes -c 64 --thinpool $vg/$lv1 --poolmetadata $vg/$lv3 # too small chunk size fails -not lvconvert -c 4 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 +$INVALID lvconvert -c 4 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 # too big chunk size fails -not lvconvert -c 2G --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 +$INVALID lvconvert -c 2G --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 # negative chunk size fails -not lvconvert -c -256 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 +$INVALID lvconvert -c -256 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 # non multiple of 64KiB fails -not lvconvert -c 88 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 +$INVALID lvconvert -c 88 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 # cannot use same LV for pool and convertion -not lvconvert --yes --thinpool $vg/$lv3 -T $vg/$lv3 +$INVALID lvconvert --yes --thinpool $vg/$lv3 -T $vg/$lv3 # Warning about smaller then suggested lvconvert --yes -c 256 --thinpool $vg/$lv1 --poolmetadata $vg/$lv2 2>&1 | tee err
@@ -129,7 +132,7 @@ if test "$TSIZE" = 64T; then lvcreate -L24T -n $lv1 $vg # Warning about bigger then needed (24T data and 16G -> 128K chunk) lvconvert --yes -c 64 --thinpool $vg/$lv1 2>&1 | tee err -grep "too small" err +grep "WARNING: Chunk size is too small" err lvremove -f $vg fi
test/shell/lvcreate-cache.sh +2 -1
@@ -56,7 +56,8 @@ fail lvcreate -l 1 --cachepool pool8 $vg # no size specified invalid lvcreate --cachepool pool $vg 2>&1 | tee err -# grep "specify either size or extents" err +#grep "specify either size or extents" err +grep "Incorrect syntax" err # Check nothing has been created yet check vg_field $vg lv_count 0
test/shell/lvextend-thin-full.sh +1 -1
@@ -38,7 +38,7 @@ lvchange -an $vg lvcreate -L2M -n $lv1 $vg "$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1" -lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool +lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1 # Cannot resize if set to 0% not lvextend --use-policies --config 'activation{thin_pool_autoextend_percent = 0}' $vg/pool 2>&1 | tee err
test/shell/lvextend-thin-metadata-dmeventd.sh +6 -6
@@ -78,7 +78,7 @@ fake_metadata_ 400 2 >data "$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1" # Swap volume with restored fake metadata -lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv1 $vg/pool +lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1 # Not alllowed when thin-pool metadata free space is <75% for 2M meta fail lvcreate -V20 $vg/pool
@@ -91,7 +91,7 @@ lvchange -an $vg/pool fake_metadata_ 7400 2 >data "$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv2" # Swap volume with restored fake metadata -lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv2 $vg/pool +lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv2 lvchange -ay $vg/pool # Check generated metadata consume more then 88% test "$(meta_percent_)" -gt "88"
@@ -138,7 +138,7 @@ lvchange -an $vg/thin $vg/thin2 $vg/pool # Transaction_id is lower by 1 and there are no messages -> ERROR fake_metadata_ 10 0 >data "$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1" -lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool +lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1 not vgchange -ay $vg 2>&1 | tee out grep expected out
@@ -147,7 +147,7 @@ check inactive $vg pool_tmeta # Transaction_id is higher by 1 fake_metadata_ 10 3 >data "$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1" -lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool +lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1 not vgchange -ay $vg 2>&1 | tee out grep expected out
@@ -158,7 +158,7 @@ fake_metadata_ 400 2 >data "$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1" # Swap volume with restored fake metadata -lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv1 $vg/pool +lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1 vgchange -ay $vg
@@ -173,7 +173,7 @@ fake_metadata_ 350 2 >data lvchange -ay $vg/$lv1 "$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1" -lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv1 $vg/pool +lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1 lvchange -ay $vg/pool $vg/$lv1 lvs -a $vg
test/shell/lvmetad-pvscan-autoactivation-polling.sh +1 -1
@@ -54,7 +54,7 @@ mkdir test_mnt setup_merge_ $vg1 $lv1 mount "$(lvdev_ $vg1 $lv1)" test_mnt -lvconvert --mergesnapshot $vg1/$(snap_lv_name_ $lv1) +lvconvert --merge $vg1/$(snap_lv_name_ $lv1) umount test_mnt vgchange -an $vg1
test/shell/snapshot-merge-stack.sh +1 -1
@@ -32,7 +32,7 @@ snap_and_merge() { SLEEP_PID=$(aux hold_device_open $vg $lv1 20) # initiate background merge - lvconvert -b --mergesnapshot $vg/$lv2 + lvconvert -b --merge $vg/$lv2 lvs -a -o+lv_merging,lv_merge_failed $vg get lv_field $vg/$lv1 lv_attr | grep "Owi-ao"
test/shell/snapshot-merge.sh +8 -8
@@ -51,15 +51,15 @@ mkdir test_mnt # test full merge of a single LV setup_merge_ $vg $lv1 -# make sure lvconvert --mergesnapshot requires explicit LV listing -not lvconvert --mergesnapshot -lvconvert --mergesnapshot $vg/$(snap_lv_name_ $lv1) +# make sure lvconvert --merge requires explicit LV listing +not lvconvert --merge +lvconvert --merge $vg/$(snap_lv_name_ $lv1) lvremove -f $vg/$lv1 # test that an actively merging snapshot may not be removed setup_merge_ $vg $lv1 -lvconvert -i+100 --mergesnapshot --background $vg/$(snap_lv_name_ $lv1) +lvconvert -i+100 --merge --background $vg/$(snap_lv_name_ $lv1) not lvremove -f $vg/$(snap_lv_name_ $lv1) lvremove -f $vg/$lv1
@@ -67,7 +67,7 @@ lvremove -f $vg/$lv1 # "onactivate merge" test setup_merge_ $vg $lv1 mount "$(lvdev_ $vg $lv1)" test_mnt -lvconvert --mergesnapshot $vg/$(snap_lv_name_ $lv1) +lvconvert --merge $vg/$(snap_lv_name_ $lv1) # -- refresh LV while FS is still mounted (merge must not start), # verify 'snapshot-origin' target is still being used lvchange --refresh $vg/$lv1
@@ -88,7 +88,7 @@ lvremove -f $vg/$lv1 # to make sure preload of origin's metadata is _not_ performed setup_merge_ $vg $lv1 mount "$(lvdev_ $vg $lv1)" test_mnt -lvconvert --mergesnapshot $vg/$(snap_lv_name_ $lv1) +lvconvert --merge $vg/$(snap_lv_name_ $lv1) # -- refresh LV while FS is still mounted (merge must not start), # verify 'snapshot-origin' target is still being used lvchange --refresh $vg/$lv1
@@ -99,7 +99,7 @@ lvremove -f $vg/$lv1 # test multiple snapshot merge; tests copy out that is driven by merge setup_merge_ $vg $lv1 1 -lvconvert --mergesnapshot $vg/$(snap_lv_name_ $lv1) +lvconvert --merge $vg/$(snap_lv_name_ $lv1) lvremove -f $vg/$lv1
@@ -108,7 +108,7 @@ setup_merge_ $vg $lv1 setup_merge_ $vg $lv2 lvchange --addtag this_is_a_test $vg/$(snap_lv_name_ $lv1) lvchange --addtag this_is_a_test $vg/$(snap_lv_name_ $lv2) -lvconvert --mergesnapshot @this_is_a_test +lvconvert --merge @this_is_a_test lvs $vg | tee out not grep $(snap_lv_name_ $lv1) out not grep $(snap_lv_name_ $lv2) out
test/shell/thin-flags.sh +1 -1
@@ -71,7 +71,7 @@ aux prepare_thin_metadata 490 1 | tee data "$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1" # Swap volume with restored fake metadata -lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool +lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1 lvchange -ay $vg
test/shell/thin-merge.sh +3 -3
@@ -44,7 +44,7 @@ touch mntsnap/test_snap lvs -o+tags,thin_id $vg -lvconvert --mergethin $vg/snap +lvconvert --merge $vg/snap umount mnt
@@ -102,12 +102,12 @@ lvcreate -s -n snap $vg/$lv1 lvcreate -s -L10 -n oldsnapof_${lv1} $vg/$lv1 not lvconvert --merge $vg/snap $MKFS "$DM_DEV_DIR/$vg/oldsnapof_${lv1}" -lvconvert --mergesnapshot $vg/oldsnapof_${lv1} +lvconvert --merge $vg/oldsnapof_${lv1} fsck -n "$DM_DEV_DIR/$vg/$lv1" check lv_not_exists $vg oldsnapof_${lv1} # Add old snapshot to thin snapshot lvcreate -s -L10 -n oldsnapof_snap $vg/snap -lvconvert --mergethin $vg/snap +lvconvert --merge $vg/snap lvremove -f $vg/oldsnapof_snap vgremove -ff $vg
test/shell/thin-vglock.sh +1 -1
@@ -34,7 +34,7 @@ mount "$DM_DEV_DIR/$vg/$lv1" mnt lvcreate -s -n snap $vg/$lv1 check lv_field $vg/snap thin_id "3" -lvconvert --mergethin $vg/snap +lvconvert --merge $vg/snap umount mnt
test/shell/vgextend-restoremissing.sh +2 -0
@@ -23,6 +23,8 @@ lvcreate -l 1 -n lv1 $vg "$dev1" invalid vgextend # --metadatacopies => use --pvmetadatacopies invalid vgextend --metadatacopies 3 $vg "$dev1" 2>&1 | tee out +#grep -- "use --pvmetadatacopies" out +grep -- "unrecognized option '--metadatacopies'" out # VG name should exist fail vgextend --restoremissing $vg-invalid "$dev1"