2013-08-22 02:53:04 +04:00
#!/bin/sh
# Copyright (C) 2008-2013 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.
test_description = 'Test vgs with duplicate vg names'
2016-02-23 01:13:42 +03:00
SKIP_WITH_LVMLOCKD = 1
2015-10-27 17:10:06 +03:00
SKIP_WITH_LVMPOLLD = 1
2013-08-22 02:53:04 +04:00
2014-06-06 19:40:04 +04:00
. lib/inittest
2013-08-22 02:53:04 +04:00
aux prepare_devs 2
2014-03-20 02:32:25 +04:00
pvcreate " $dev1 "
pvcreate " $dev2 "
2013-08-22 02:53:04 +04:00
2015-04-30 22:51:43 +03:00
aux disable_dev " $dev1 " " $dev2 "
2013-08-22 02:53:04 +04:00
2014-03-20 02:32:25 +04:00
aux enable_dev " $dev1 "
2013-08-30 20:45:12 +04:00
vgscan
2014-03-20 02:32:25 +04:00
vgcreate $vg1 " $dev1 "
2013-08-22 02:53:04 +04:00
UUID1 = $( vgs --noheading -o vg_uuid $vg1 )
2014-03-20 02:32:25 +04:00
aux disable_dev " $dev1 "
2013-08-22 02:53:04 +04:00
2014-03-20 02:32:25 +04:00
aux enable_dev " $dev2 "
2013-08-30 20:45:12 +04:00
vgscan
2014-03-20 02:32:25 +04:00
vgcreate $vg1 " $dev2 "
2013-08-22 02:53:04 +04:00
UUID2 = $( vgs --noheading -o vg_uuid $vg1 )
2014-03-20 02:32:25 +04:00
aux enable_dev " $dev1 "
2013-08-30 20:45:12 +04:00
# need vgscan after enabling/disabling devs
# so that the next commands properly see them
vgscan
2014-03-20 02:32:25 +04:00
pvs " $dev1 "
pvs " $dev2 "
2013-08-22 02:53:04 +04:00
2015-04-30 22:51:43 +03:00
vgs -o+vg_uuid | tee err
2013-08-22 02:53:04 +04:00
grep $UUID1 err
grep $UUID2 err
# should we specify and test which should be displayed?
# vgs --noheading -o vg_uuid $vg1 >err
# grep $UUID1 err
2014-03-20 02:32:25 +04:00
aux disable_dev " $dev2 "
2015-04-30 22:51:43 +03:00
vgs -o+vg_uuid | tee err
2013-08-22 02:53:04 +04:00
grep $UUID1 err
not grep $UUID2 err
2014-03-20 02:32:25 +04:00
aux enable_dev " $dev2 "
2013-08-30 20:45:12 +04:00
vgscan
2013-08-22 02:53:04 +04:00
2014-03-20 02:32:25 +04:00
aux disable_dev " $dev1 "
2015-04-30 22:51:43 +03:00
vgs -o+vg_uuid | tee err
2013-08-22 02:53:04 +04:00
grep $UUID2 err
not grep $UUID1 err
2014-03-20 02:32:25 +04:00
aux enable_dev " $dev1 "
2013-08-30 20:45:12 +04:00
vgscan