virt-manager/SOURCES/virt-manager-tests-clitest-Add-a-test-case-for-the-last-commit.patch
2021-09-10 05:41:54 +00:00

103 lines
3.5 KiB
Diff

From c4ce5e02fededc9121c181a7b20ea0e6ebd1c1de Mon Sep 17 00:00:00 2001
Message-Id: <c4ce5e02fededc9121c181a7b20ea0e6ebd1c1de@dist-git>
From: Pavel Hrdina <phrdina@redhat.com>
Date: Wed, 15 May 2019 08:06:10 -0400
Subject: [PATCH] tests: clitest: Add a test case for the last commit
From: Cole Robinson <crobinso@redhat.com>
We need a custom test driver input to reproduce the pool collision
(cherry picked from commit fcabcb7a95c9dd81fb7c1335c3c181bb08a31ad0)
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1714752
---
.../testdriver-defaultpool-collision.xml | 47 +++++++++++++++++++
tests/clitest.py | 1 +
tests/utils.py | 2 +
3 files changed, 50 insertions(+)
create mode 100644 tests/cli-test-xml/testdriver-defaultpool-collision.xml
diff --git a/tests/cli-test-xml/testdriver-defaultpool-collision.xml b/tests/cli-test-xml/testdriver-defaultpool-collision.xml
new file mode 100644
index 00000000..1343f812
--- /dev/null
+++ b/tests/cli-test-xml/testdriver-defaultpool-collision.xml
@@ -0,0 +1,47 @@
+<node>
+
+ <cpu>
+ <nodes>1</nodes>
+ <sockets>4</sockets>
+ <cores>4</cores>
+ <threads>1</threads>
+ <active>4</active>
+ <mhz>4000</mhz>
+ <model>i686</model>
+ </cpu>
+ <memory>10000000</memory>
+
+
+<network>
+ <name>default</name>
+ <uuid>715666b7-dbd4-6c78-fa55-94863da09f2d</uuid>
+ <forward mode='nat'/>
+ <bridge name='virbr0' stp='on' forwardDelay='0' />
+ <ip address='192.168.122.1' netmask='255.255.255.0'>
+ <dhcp>
+ <range start='192.168.122.2' end='192.168.122.254' />
+ </dhcp>
+ </ip>
+</network>
+
+
+
+<pool type='dir'>
+ <name>default-pool-path-collision</name>
+ <uuid>35bb2ad9-388a-cdfe-461a-b8907f6e53fe</uuid>
+ <capacity>107374182400</capacity>
+ <allocation>0</allocation>
+ <available>107374182400</available>
+ <source>
+ </source>
+ <target>
+ <path>/var/lib/libvirt/images</path>
+ <permissions>
+ <mode>0700</mode>
+ <owner>10736</owner>
+ <group>10736</group>
+ </permissions>
+ </target>
+</pool>
+
+</node>
diff --git a/tests/clitest.py b/tests/clitest.py
index 824293e4..ecdf3731 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -684,6 +684,7 @@ c.add_valid("--nodisks --pxe", grep="VM performance may suffer") # os variant w
c.add_invalid("--hvm --nodisks --pxe foobar") # Positional arguments error
c.add_invalid("--nodisks --pxe --name test") # Colliding name
c.add_compare("--cdrom %(EXISTIMG1)s --disk size=1 --disk %(EXISTIMG2)s,device=cdrom", "cdrom-double") # ensure --disk device=cdrom is ordered after --cdrom, this is important for virtio-win installs with a driver ISO
+c.add_valid("--connect %s --pxe --disk size=1" % utils.URIs.test_defaultpool_collision) # testdriver already has a pool using the 'default' path, make sure we don't error
diff --git a/tests/utils.py b/tests/utils.py
index d22933d3..ef7c613a 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -56,6 +56,8 @@ class _URIs(object):
self.test_full = _testtmpl % (os.getcwd() + "/tests/testdriver.xml")
self.test_suite = _testtmpl % (os.getcwd() + "/tests/testsuite.xml")
self.test_remote = self.test_full + ",remote"
+ self.test_defaultpool_collision = (_testtmpl % (os.getcwd() +
+ "/tests/cli-test-xml/testdriver-defaultpool-collision.xml"))
self.xen = self.test_full + _caps("xen-rhel5.4.xml") + ",xen"
self.lxc = self.test_full + _caps("lxc.xml") + ",lxc"
--
2.21.0