mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
tests: detect same uuid on PV
Check we know how to handle same UUID Test currently does NOT work on lvmetad (or it's unclear it even should - thus test error is currently lowered to 'test warning') TODO: replace lib/test with a better shell script name
This commit is contained in:
parent
9240aca369
commit
a67774c1fa
27
test/shell/lvmetad-same-uuid.sh
Normal file
27
test/shell/lvmetad-same-uuid.sh
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
. lib/test
|
||||
|
||||
aux prepare_devs 3
|
||||
|
||||
pvcreate "$dev1"
|
||||
UUID1=$(get pv_field "$dev1" uuid)
|
||||
pvcreate --config "devices{filter=[\"a|$dev2|\",\"r|.*|\"]}" -u "$UUID1" --norestorefile "$dev2"
|
||||
pvcreate --config "devices{filter=[\"a|$dev3|\",\"r|.*|\"]}" -u "$UUID1" --norestorefile "$dev3"
|
||||
|
||||
pvs -o+uuid |& tee out
|
||||
COUNT=$(should grep --count "Found duplicate" out)
|
||||
|
||||
# FIXME lvmetad is not able to serve properly this case
|
||||
should [ "$COUNT" -eq 2 ]
|
||||
|
||||
pvs -o+uuid --config "devices{filter=[\"a|$dev2|\",\"r|.*|\"]}"
|
Loading…
Reference in New Issue
Block a user