Gitweb:
http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=506bc045b55799...
Commit: 506bc045b55799df3c20107020e76e0e42995f04
Parent: 8c511122f4a0be6f7d8ac0db7d845cd44b16a774
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Aug 21 17:53:04 2013 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Aug 23 14:19:59 2013 -0500
test: add process-each-duplicate-vgnames
Test that vgs shows both vgs when two vgs
exist with the same name but different uuids.
---
test/shell/process-each-duplicate-vgnames.sh | 53 ++++++++++++++++++++++++++
1 files changed, 53 insertions(+), 0 deletions(-)
diff --git a/test/shell/process-each-duplicate-vgnames.sh
b/test/shell/process-each-duplicate-vgnames.sh
new file mode 100644
index 0000000..865ef9f
--- /dev/null
+++ b/test/shell/process-each-duplicate-vgnames.sh
@@ -0,0 +1,53 @@
+#!/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/test
+
+aux prepare_devs 2
+
+pvcreate $dev1
+pvcreate $dev2
+
+aux disable_dev $dev1
+aux disable_dev $dev2
+
+aux enable_dev $dev1
+vgcreate $vg1 $dev1
+UUID1=$(vgs --noheading -o vg_uuid $vg1)
+aux disable_dev $dev1
+
+aux enable_dev $dev2
+vgcreate $vg1 $dev2
+UUID2=$(vgs --noheading -o vg_uuid $vg1)
+
+aux enable_dev $dev1
+
+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
+
+aux disable_dev $dev1
+vgs -o+vg_uuid >err
+cat err
+grep $UUID2 err
+not grep $UUID1 err
+aux enable_dev $dev1
+