1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

tests: use lvname with space

Occasionally this test fails as soemtimes UUID actually
may constain LV[d] string causing it to grep mismatch
UUID and LV name and eventually fail test for wrong reason.

As a simple workaround print the LV name first and
check the name is followed by a space character.
This commit is contained in:
Zdenek Kabelac 2024-04-10 15:46:24 +02:00
parent a14cb2495b
commit faf4fe0714

View File

@ -106,8 +106,8 @@ not grep active out
vgchange -an vgchange -an
not lvcreate -l1 -an -n $lv2 $vg1 not lvcreate -l1 -an -n $lv2 $vg1
lvs --foreign -o vguuid,name |tee out lvs --foreign -o name,vguuid |tee out
grep $UUID1 out | not grep $lv2 grep $UUID1 out | not grep "$lv2 "
not vgremove $vg1 not vgremove $vg1
vgs --foreign -o+uuid |tee out vgs --foreign -o+uuid |tee out
@ -154,9 +154,9 @@ not grep active out
vgchange -an vgchange -an
not lvcreate -l1 -an -n $lv2 $vg1 not lvcreate -l1 -an -n $lv2 $vg1
lvs --foreign -o vguuid,name |tee out lvs --foreign -o name,vguuid |tee out
grep $UUID1 out | not grep $lv2 grep $UUID1 out | not grep "$lv2 "
grep $UUID2 out | not grep $lv2 grep $UUID2 out | not grep "$lv2 "
not vgremove $vg1 not vgremove $vg1
vgs --foreign -o+uuid |tee out vgs --foreign -o+uuid |tee out
@ -208,9 +208,9 @@ grep $UUID2 out | not grep active
vgchange -an vgchange -an
lvcreate -l1 -an -n $lv2 $vg1 lvcreate -l1 -an -n $lv2 $vg1
lvs --foreign -o vguuid,name |tee out lvs --foreign -o name,vguuid |tee out
grep $UUID1 out | grep $lv2 grep $UUID1 out | grep "$lv2 "
grep $UUID2 out | not grep $lv2 grep $UUID2 out | not grep "$lv2 "
vgremove -y $vg1 vgremove -y $vg1
vgs -o+uuid |tee out vgs -o+uuid |tee out
@ -274,10 +274,10 @@ grep $UUID3 out | not grep active
vgchange -an vgchange -an
lvcreate -l1 -an -n $lv2 $vg1 lvcreate -l1 -an -n $lv2 $vg1
lvs --foreign -o vguuid,name |tee out lvs --foreign -o name,vguuid |tee out
grep $UUID1 out | grep $lv2 grep $UUID1 out | grep "$lv2 "
grep $UUID2 out | not grep $lv2 grep $UUID2 out | not grep "$lv2 "
grep $UUID3 out | not grep $lv2 grep $UUID3 out | not grep "$lv2 "
vgremove -y $vg1 vgremove -y $vg1
vgs -o+uuid |tee out vgs -o+uuid |tee out
@ -327,9 +327,9 @@ grep $UUID2 out | not grep active
vgchange -an vgchange -an
not lvcreate -l1 -an -n $lv2 $vg1 not lvcreate -l1 -an -n $lv2 $vg1
lvs --foreign -o vguuid,name |tee out lvs --foreign -o name,vguuid |tee out
grep $UUID1 out | not grep $lv2 grep $UUID1 out | not grep "$lv2 "
grep $UUID2 out | not grep $lv2 grep $UUID2 out | not grep "$lv2 "
not vgremove $vg1 not vgremove $vg1
vgs -o+uuid |tee out vgs -o+uuid |tee out
@ -395,10 +395,10 @@ grep $UUID3 out | not grep active
vgchange -an vgchange -an
not lvcreate -l1 -an -n $lv2 $vg1 not lvcreate -l1 -an -n $lv2 $vg1
lvs --foreign -o vguuid,name |tee out lvs --foreign -o name,vguuid |tee out
grep $UUID1 out | not grep $lv2 grep $UUID1 out | not grep "$lv2 "
grep $UUID2 out | not grep $lv2 grep $UUID2 out | not grep "$lv2 "
grep $UUID3 out | not grep $lv2 grep $UUID3 out | not grep "$lv2 "
not vgremove $vg1 not vgremove $vg1
vgs --foreign -o+uuid |tee out vgs --foreign -o+uuid |tee out
@ -476,11 +476,11 @@ grep $UUID4 out | not grep active
vgchange -an vgchange -an
not lvcreate -l1 -an -n $lv2 $vg1 not lvcreate -l1 -an -n $lv2 $vg1
lvs --foreign -o vguuid,name |tee out lvs --foreign -o name,vguuid |tee out
grep $UUID1 out | not grep $lv2 grep $UUID1 out | not grep "$lv2 "
grep $UUID2 out | not grep $lv2 grep $UUID2 out | not grep "$lv2 "
grep $UUID3 out | not grep $lv2 grep $UUID3 out | not grep "$lv2 "
grep $UUID4 out | not grep $lv2 grep $UUID4 out | not grep "$lv2 "
not vgremove $vg1 not vgremove $vg1
vgs --foreign -o+uuid |tee out vgs --foreign -o+uuid |tee out
@ -567,13 +567,13 @@ grep $UUID6 out | not grep active
vgchange -an vgchange -an
not lvcreate -l1 -an -n $lv2 $vg1 not lvcreate -l1 -an -n $lv2 $vg1
lvs --foreign -o vguuid,name |tee out lvs --foreign -o name,vguuid |tee out
grep $UUID1 out | not grep $lv2 grep $UUID1 out | not grep "$lv2 "
grep $UUID2 out | not grep $lv2 grep $UUID2 out | not grep "$lv2 "
grep $UUID3 out | not grep $lv2 grep $UUID3 out | not grep "$lv2 "
grep $UUID4 out | not grep $lv2 grep $UUID4 out | not grep "$lv2 "
grep $UUID5 out | not grep $lv2 grep $UUID5 out | not grep "$lv2 "
grep $UUID6 out | not grep $lv2 grep $UUID6 out | not grep "$lv2 "
not vgremove $vg1 not vgremove $vg1
vgs --foreign -o+uuid |tee out vgs --foreign -o+uuid |tee out