1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
From 87ce425197c2d6bfaf675dc4c0f92a2f615a39a5 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 6 Apr 2021 15:21:00 -0400
Subject: [PATCH] tests: storage: Fix with latest libvirt XML output
Patch-Source: https://github.com/virt-manager/virt-manager/commit/87ce425197c2d6bfaf675dc4c0f92a2f615a39a5
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
tests/data/storage/pool-fs-volclone.xml | 2 --
tests/data/storage/pool-logical-volclone.xml | 2 --
tests/data/storage/pool-netfs-volclone.xml | 2 --
tests/test_storage.py | 11 ++++++-----
6 files changed, 6 insertions(+), 15 deletions(-)
diff --git a/tests/data/storage/pool-fs-volclone.xml b/tests/data/storage/pool-fs-volclone.xml
index 34e8cd088..6c7d3b9dd 100644
--- a/tests/data/storage/pool-fs-volclone.xml
+++ b/tests/data/storage/pool-fs-volclone.xml
@@ -1,8 +1,6 @@
<volume type="file">
<name>pool-fs-volclone</name>
<key>/var/lib/libvirt/images/pool-fs/pool-fs-vol</key>
- <source>
- </source>
<capacity unit="bytes">10737418240</capacity>
<allocation unit="bytes">5368709120</allocation>
<target>
diff --git a/tests/data/storage/pool-logical-volclone.xml b/tests/data/storage/pool-logical-volclone.xml
index c012017ef..8abcfa64c 100644
--- a/tests/data/storage/pool-logical-volclone.xml
+++ b/tests/data/storage/pool-logical-volclone.xml
@@ -1,8 +1,6 @@
<volume type="file">
<name>pool-logical-volclone</name>
<key>/dev/pool-logical/pool-logical-vol</key>
- <source>
- </source>
<capacity unit="bytes">10737418240</capacity>
<allocation unit="bytes">10737418240</allocation>
<target>
diff --git a/tests/data/storage/pool-netfs-volclone.xml b/tests/data/storage/pool-netfs-volclone.xml
index b6b39f79d..b7fd26507 100644
--- a/tests/data/storage/pool-netfs-volclone.xml
+++ b/tests/data/storage/pool-netfs-volclone.xml
@@ -1,8 +1,6 @@
<volume type="file">
<name>pool-netfs-volclone</name>
<key>/var/lib/libvirt/images/pool-netfs/pool-netfs-vol</key>
- <source>
- </source>
<capacity unit="bytes">10737418240</capacity>
<allocation unit="bytes">5368709120</allocation>
<target>
diff --git a/tests/test_storage.py b/tests/test_storage.py
index ee33ab32e..ba0e4e711 100644
--- a/tests/test_storage.py
+++ b/tests/test_storage.py
@@ -65,11 +65,6 @@ def createVol(conn, poolobj, volname=None, input_vol=None, clone_vol=None):
if volname is None:
volname = poolobj.name() + "-vol"
- # Format here depends on libvirt-1.2.0 and later
- if clone_vol and conn.local_libvirt_version() < 1002000:
- log.debug("skip clone compare")
- return
-
alloc = 5 * 1024 * 1024 * 1024
cap = 10 * 1024 * 1024 * 1024
vol_inst = StorageVolume(conn)
@@ -91,6 +86,12 @@ def createVol(conn, poolobj, volname=None, input_vol=None, clone_vol=None):
vol_inst.validate()
filename = os.path.join(BASEPATH, vol_inst.name + ".xml")
+
+ # Format here depends on libvirt-7.2.0 and later
+ if clone_vol and conn.local_libvirt_version() < 7002000:
+ log.debug("skip clone compare")
+ return
+
utils.diff_compare(vol_inst.get_xml(), filename)
return vol_inst.install(meter=False)
diff --git a/tests/data/storage/pool-disk-volclone.xml b/tests/data/storage/pool-disk-volclone.xml
index a4e9c3d..24f71a1 100644
--- a/tests/data/storage/pool-disk-volclone.xml
+++ b/tests/data/storage/pool-disk-volclone.xml
@@ -1,8 +1,6 @@
<volume type="file">
<name>pool-disk-volclone</name>
<key>/dev/pool-disk-vol</key>
- <source>
- </source>
<capacity unit="bytes">10737418240</capacity>
<allocation unit="bytes">5368709120</allocation>
<target>
diff --git a/tests/data/storage/pool-dir-volclone.xml b/tests/data/storage/pool-dir-volclone.xml
index c8bde66..16f1e56 100644
--- a/tests/data/storage/pool-dir-volclone.xml
+++ b/tests/data/storage/pool-dir-volclone.xml
@@ -1,8 +1,6 @@
<volume type="file">
<name>pool-dir-volclone</name>
<key>/var/lib/libvirt/images/pool-dir/pool-dir-vol</key>
- <source>
- </source>
<capacity unit="bytes">10737418240</capacity>
<allocation unit="bytes">5368709120</allocation>
<target>
|