1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

tests: select-tools.sh: pvchange now uses process_each_pv

pvchange now uses process_each_pv so uncomment parts of the test
which check proper functionality of intersection between selection
result and PVs or PV tags directly provided on command line. This
didn't work properly before when pvchange was not using process_each_pv.

For example:

  pvchange -u -S 'pv_name=/dev/sda' /dev/sdb

..changes nothing since clearly the intersection of /dev/sda and
/dev/sdb is empty set. The same applies for tags:

  pvchange -u -S 'pv_name=/dev/sda' @some_tag

..changes nothing if /dev/sda is not tagged with some_tag.
This commit is contained in:
Peter Rajnoha 2015-02-13 10:52:36 +01:00
parent 969d2bf448
commit 1c005b557a

View File

@ -196,17 +196,6 @@ lvchange --deltag 210 --deltag tag $vg1 $vg2
# exercise process_each_pv with selection # # exercise process_each_pv with selection #
########################################### ###########################################
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# WARNING: pvchange doesn't use process_each_pv yet
# but add the tests anyway as this transition
# will happen soon - all these tests should
# just work (for now, there's a workaround done
# in pvchange code to work with the selection).
# Let's use {vg,lv,pv}change to exercise all this
# selection support so the tests remain readable
# and consistent.
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# select contains VGS field # select contains VGS field
pvchange --addtag 301 -S "vg_name=$vg1" pvchange --addtag 301 -S "vg_name=$vg1"
check pv_field $dev1 pv_tags 301 check pv_field $dev1 pv_tags 301
@ -250,30 +239,28 @@ pvchange -a --deltag 305
# intersection between selection # intersection between selection
# result and supplied VG name/tag # result and supplied VG name/tag
# ENABLE TESTS BELOW ONCE process_each_pv is used for pvchange pvchange --addtag 306 -S "pv_name=$dev1" $dev2
not check pv_field $dev1 pv_tags 306
#pvchange --addtag 306 -S "pv_name=$dev1" $dev2 not check pv_field $dev2 pv_tags 306
#not check pv_field $dev1 pv_tags 306 not check pv_field $dev3 pv_tags 306
#not check pv_field $dev2 pv_tags 306 not check pv_field $dev4 pv_tags 306
#not check pv_field $dev3 pv_tags 306 pvchange -a --deltag 306
#not check pv_field $dev4 pv_tags 306 pvchange --addtag 307 -S "pv_name=$dev1" $dev1
#pvchange -a --deltag 306 check pv_field $dev1 pv_tags 307
#pvchange --addtag 307 -S "pv_name=$dev1" $dev1 not check pv_field $dev2 pv_tags 307
#check pv_field $dev1 pv_tags 307 not check pv_field $dev3 pv_tags 307
#not check pv_field $dev2 pv_tags 307 not check pv_field $dev4 pv_tags 307
#not check pv_field $dev3 pv_tags 307 pvchange -a --deltag 307
#not check pv_field $dev4 pv_tags 307 pvchange --addtag "tag" $dev1
#pvchange -a --deltag 307 pvchange --addtag 308 -S "pv_name=$dev2" @tag
#pvchange --addtag "tag" $dev1 not check pv_field $dev1 pv_tags "308,tag"
#pvchange --addtag 308 -S "pv_name=$dev2" @tag not check pv_field $dev2 pv_tags "308,tag"
#not check pv_field $dev1 pv_tags "308,tag" not check pv_field $dev3 pv_tags "308,tag"
#not check pv_field $dev2 pv_tags "308,tag" not check pv_field $dev4 pv_tags "308,tag"
#not check pv_field $dev3 pv_tags "308,tag" pvchange --deltag 308 $dev1
#not check pv_field $dev4 pv_tags "308,tag" pvchange --addtag 309 -S "pv_name=$dev1" @tag
#pvchange --deltag 308 $dev1 check pv_field $dev1 pv_tags "309,tag"
#pvchange --addtag 309 -S "pv_name=$dev1" @tag not check pv_field $dev2 pv_tags "309,tag"
#check pv_field $dev1 pv_tags "309,tag" not check pv_field $dev3 pv_tags "309,tag"
#not check pv_field $dev2 pv_tags "309,tag" not check pv_field $dev4 pv_tags "309,tag"
#not check pv_field $dev3 pv_tags "309,tag" pvchange -a --deltag 309 --deltag tag
#not check pv_field $dev4 pv_tags "309,tag"
#pvchange -a --deltag 210 --deltag tag