1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00
lvm2/test/shell/process-each-duplicate-vgnames.sh
Zdenek Kabelac 5c5177c37c tests: rename test to inittest
We are getting into problem when we use 'test' for commands like
should/not/...

So avoid overloading test name and change it to inittest.
2014-06-10 10:51:27 +02:00

63 lines
1.2 KiB
Bash

#!/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'
. lib/inittest
aux prepare_devs 2
pvcreate "$dev1"
pvcreate "$dev2"
aux disable_dev "$dev1"
aux disable_dev "$dev2"
aux enable_dev "$dev1"
vgscan
vgcreate $vg1 "$dev1"
UUID1=$(vgs --noheading -o vg_uuid $vg1)
aux disable_dev "$dev1"
aux enable_dev "$dev2"
vgscan
vgcreate $vg1 "$dev2"
UUID2=$(vgs --noheading -o vg_uuid $vg1)
aux enable_dev "$dev1"
# need vgscan after enabling/disabling devs
# so that the next commands properly see them
vgscan
pvs "$dev1"
pvs "$dev2"
vgs -o+vg_uuid >err
cat err
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
aux disable_dev "$dev2"
vgs -o+vg_uuid >err
cat err
grep $UUID1 err
not grep $UUID2 err
aux enable_dev "$dev2"
vgscan
aux disable_dev "$dev1"
vgs -o+vg_uuid >err
cat err
grep $UUID2 err
not grep $UUID1 err
aux enable_dev "$dev1"
vgscan