[PATCH] tests: add sample xml for <on_lockfailure>

Daniel P. Berrangé via Devel posted 1 patch 1 month, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20260925143035.2935011-1-berrange@redhat.com
tests/genericxml2xmlindata/locking.xml  | 18 ++++++++++++++++++
tests/genericxml2xmloutdata/locking.xml | 18 ++++++++++++++++++
tests/genericxml2xmltest.c              |  1 +
3 files changed, 37 insertions(+)
create mode 100644 tests/genericxml2xmlindata/locking.xml
create mode 100644 tests/genericxml2xmloutdata/locking.xml
[PATCH] tests: add sample xml for <on_lockfailure>
Posted by Daniel P. Berrangé via Devel 1 month, 2 weeks ago
From: Daniel P. Berrangé <berrange@redhat.com>

This part of the schema had zero coverage in test files.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tests/genericxml2xmlindata/locking.xml  | 18 ++++++++++++++++++
 tests/genericxml2xmloutdata/locking.xml | 18 ++++++++++++++++++
 tests/genericxml2xmltest.c              |  1 +
 3 files changed, 37 insertions(+)
 create mode 100644 tests/genericxml2xmlindata/locking.xml
 create mode 100644 tests/genericxml2xmloutdata/locking.xml

diff --git a/tests/genericxml2xmlindata/locking.xml b/tests/genericxml2xmlindata/locking.xml
new file mode 100644
index 0000000000..d0276ead2a
--- /dev/null
+++ b/tests/genericxml2xmlindata/locking.xml
@@ -0,0 +1,18 @@
+<domain type='qemu'>
+  <name>bar</name>
+  <uuid>00010203-0405-4607-8809-0a0b0c0d0e0f</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <on_lockfailure>pause</on_lockfailure>
+  <devices>
+  </devices>
+</domain>
diff --git a/tests/genericxml2xmloutdata/locking.xml b/tests/genericxml2xmloutdata/locking.xml
new file mode 100644
index 0000000000..d0276ead2a
--- /dev/null
+++ b/tests/genericxml2xmloutdata/locking.xml
@@ -0,0 +1,18 @@
+<domain type='qemu'>
+  <name>bar</name>
+  <uuid>00010203-0405-4607-8809-0a0b0c0d0e0f</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64' machine='pc'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <on_lockfailure>pause</on_lockfailure>
+  <devices>
+  </devices>
+</domain>
diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c
index 169c71efa3..3a2764a378 100644
--- a/tests/genericxml2xmltest.c
+++ b/tests/genericxml2xmltest.c
@@ -265,6 +265,7 @@ mymain(void)
     DO_TEST("iothreadids");
 
     DO_TEST("iommufd");
+    DO_TEST("locking");
 
     virObjectUnref(caps);
     virObjectUnref(xmlopt);
-- 
2.55.0

Re: [PATCH] tests: add sample xml for <on_lockfailure>
Posted by Michal Prívozník via Devel 1 month, 1 week ago
On 9/25/26 16:30, Daniel P. Berrangé via Devel wrote:
> From: Daniel P. Berrangé <berrange@redhat.com>
> 
> This part of the schema had zero coverage in test files.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  tests/genericxml2xmlindata/locking.xml  | 18 ++++++++++++++++++
>  tests/genericxml2xmloutdata/locking.xml | 18 ++++++++++++++++++
>  tests/genericxml2xmltest.c              |  1 +
>  3 files changed, 37 insertions(+)
>  create mode 100644 tests/genericxml2xmlindata/locking.xml
>  create mode 100644 tests/genericxml2xmloutdata/locking.xml

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

and safe for the freeze.

Michal