tests: Remove storage UUID hackery

In several cases we were trying to define two different pools with
the same UUID. Libvirt used to accept that but as of a recent
commit it started rejecting it for the test driver.

The UUID stuff isn't adding anything so drop it from all the test
cases and data.
This commit is contained in:
Cole Robinson 2017-12-14 12:42:08 -05:00
parent fe59c33772
commit 4224b0926e
19 changed files with 1 additions and 39 deletions

View File

@ -1,6 +1,5 @@
<pool type="dir">
<name>pool-dir</name>
<uuid>10010511-4100-1051-1410-010511410010</uuid>
<target>
<path>/some/target/path</path>
</target>

View File

@ -1,6 +1,5 @@
<pool type="disk">
<name>pool-disk</name>
<uuid>10010511-5107-1001-0511-510710010511</uuid>
<source>
<format type="dos"/>
<device path="/some/source/path"/>

View File

@ -1,6 +1,5 @@
<pool type="fs">
<name>pool-fs</name>
<uuid>10211510-2115-1021-1510-211510211510</uuid>
<source>
<format type="auto"/>
<device path="/some/source/path"/>

View File

@ -1,6 +1,5 @@
<pool type="gluster">
<name>pool-gluster</name>
<uuid>10310811-7115-1161-0111-410310811711</uuid>
<source>
<host name="some.random.hostname"/>
<dir path="/some/source/path"/>

View File

@ -1,6 +1,5 @@
<pool type="iscsi">
<name>pool-iscsi</name>
<uuid>10511599-1151-0510-5115-991151051051</uuid>
<source>
<host name="some.random.hostname"/>
<device path="/some/source/path"/>

View File

@ -1,6 +1,5 @@
<pool type="logical">
<name>pool-logical-list0</name>
<uuid>10811110-3105-9997-1084-510810511511</uuid>
<source>
<format type="lvm2"/>
<device path="/dev/sda20"/>

View File

@ -1,6 +1,5 @@
<pool type="logical">
<name>pool-logical-list1</name>
<uuid>10811110-3105-9997-1084-510810511511</uuid>
<source>
<format type="lvm2"/>
<device path="/dev/sda21"/>

View File

@ -1,6 +1,5 @@
<pool type="logical">
<name>pool-logical-srcname</name>
<uuid>10811110-3105-9997-1084-511511499110</uuid>
<source>
<device path="/some/source/path"/>
<name>vgname</name>

View File

@ -1,6 +1,5 @@
<pool type="logical">
<name>pool-logical-target-srcname</name>
<uuid>10811110-3105-9997-1084-511697114103</uuid>
<source>
<device path="/some/source/path"/>
<name>vgfoobar</name>

View File

@ -1,6 +1,5 @@
<pool type="logical">
<name>pool-logical</name>
<uuid>10811110-3105-9997-1081-081111031059</uuid>
<source>
<device path="/some/source/path"/>
<name>pool-logical</name>

View File

@ -1,6 +1,5 @@
<pool type="mpath">
<name>pool-mpath</name>
<uuid>10911297-1161-0410-9112-971161041091</uuid>
<target>
<path>/some/target/path</path>
</target>

View File

@ -5,7 +5,6 @@
<dir path="/testshare"/>
</source>
<name>pool-netfs-list0</name>
<uuid>11010111-6102-1154-5108-105115116481</uuid>
<target>
<path>/var/lib/libvirt/images/pool-netfs-list0</path>
</target>

View File

@ -1,6 +1,5 @@
<pool type="netfs">
<name>pool-netfs</name>
<uuid>11010111-6102-1151-1010-111610211511</uuid>
<source>
<format type="auto"/>
<host name="some.random.hostname"/>

View File

@ -1,6 +1,5 @@
<pool type="scsi">
<name>pool-scsi</name>
<uuid>11599115-1051-1599-1151-051159911510</uuid>
<source>
<adapter name="/some/source/path"/>
</source>

View File

@ -29,34 +29,15 @@ from tests import utils
basepath = os.path.join(os.getcwd(), "tests", "storage-xml")
def generate_uuid_from_string(msg):
res = msg.split("-", 1)
if len(res) > 1:
# Split off common prefix
msg = res[1]
numstr = ""
for c in msg:
numstr += str(ord(c))
numstr *= 32
return "-".join([numstr[0:8], numstr[8:12], numstr[12:16], numstr[16:20],
numstr[20:32]])
def createPool(conn, ptype, poolname=None, fmt=None, target_path=None,
source_path=None, source_name=None, uuid=None, iqn=None):
source_path=None, source_name=None, iqn=None):
if poolname is None:
poolname = StoragePool.find_free_name(conn, "%s-pool" % ptype)
if uuid is None:
uuid = generate_uuid_from_string(poolname)
pool_inst = StoragePool(conn)
pool_inst.name = poolname
pool_inst.type = ptype
pool_inst.uuid = uuid
if pool_inst.supports_property("hosts"):
pool_inst.add_host("some.random.hostname")
@ -218,7 +199,6 @@ class TestStorage(unittest.TestCase):
def _enumerateCompare(self, name, pool_list):
for pool in pool_list:
pool.name = name + str(pool_list.index(pool))
pool.uuid = generate_uuid_from_string(pool.name)
poolCompare(pool)
def testEnumerateLogical(self):

View File

@ -1,6 +1,5 @@
<pool type="gluster">
<name>pool-gluster</name>
<uuid>10310811-7115-1161-0111-410310811711</uuid>
<source>
<host name="my.host"/>
<dir path="/foo"/>

View File

@ -1,6 +1,5 @@
<pool type="iscsi">
<name>pool-iscsi</name>
<uuid>10511599-1151-0510-5115-991151051051</uuid>
<source>
<host name="my.host"/>
<device path="/some/source/path"/>

View File

@ -1,6 +1,5 @@
<pool type="rbd">
<name>rbd-pool</name>
<uuid>4bcd023e-990e-fcf6-d95c-52dd0cd938c8</uuid>
<capacity unit="bytes">47256127143936</capacity>
<allocation unit="bytes">5537792235090</allocation>
<available unit="bytes">35978000121856</available>

View File

@ -1,6 +1,5 @@
<pool type='rbd'>
<name>rbd-pool</name>
<uuid>4bcd023e-990e-fcf6-d95c-52dd0cd938c8</uuid>
<capacity unit='bytes'>47256127143936</capacity>
<allocation unit='bytes'>5537792235090</allocation>
<available unit='bytes'>35978000121856</available>