diff --git a/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-scsi.xml b/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-scsi.xml
index a06158b8ff9f16c27e9c3a6b4ad1c4ca17e11981..ca46e5a8ea901bc05e5ad07c20b43a109f53c18d 100644
--- a/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-scsi.xml
+++ b/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-scsi.xml
@@ -42,5 +42,5 @@
-
+
diff --git a/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-usb.xml b/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-usb.xml
index 1ea0f88313a9e71e8a23cf6f5d52a5a535bb7bd1..7904c4fc6580f8237020cee042ea369e1aadb386 100644
--- a/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-usb.xml
+++ b/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-usb.xml
@@ -41,5 +41,5 @@
-
+
diff --git a/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-virtio.xml b/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-virtio.xml
index e96055c3552efd3f669b076e4a2621bf8f9b394c..f3d0351f2993907fef1dda4c7ea10fc09fed295f 100644
--- a/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-virtio.xml
+++ b/tests/qemuhotplugtestdata/qemuhotplug-hotplug-base+disk-virtio.xml
@@ -42,5 +42,5 @@
-
+
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hotplug-base.xml b/tests/qemuxml2argvdata/qemuxml2argv-hotplug-base.xml
index bfb0167f39e27de81b90473cae01e9ca8ff05040..f1a55009e77d6f4f0ad3ad67988788abc9f0d269 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hotplug-base.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hotplug-base.xml
@@ -34,5 +34,5 @@
-
+
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-none-relabel.xml b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-none-relabel.xml
new file mode 100644
index 0000000000000000000000000000000000000000..47f253b5f776c2c9c4486915434a2963fe59e2b0
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-seclabel-dynamic-none-relabel.xml
@@ -0,0 +1,53 @@
+
+ migt10
+ 0d73c5c3-43d0-f75b-31de-6aa919b0176b
+ 262144
+ 262144
+
+
+
+
+
+ 4
+
+ hvm
+
+
+
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu-system-x86_64
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-dynamic-none-relabel.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-dynamic-none-relabel.xml
new file mode 100644
index 0000000000000000000000000000000000000000..1b36533db3aeb3bd3c723d6038d6cd5c99d413cc
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-dynamic-none-relabel.xml
@@ -0,0 +1,53 @@
+
+ migt10
+ 0d73c5c3-43d0-f75b-31de-6aa919b0176b
+ 262144
+ 262144
+
+
+
+
+
+ 4
+
+ hvm
+
+
+
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu-system-x86_64
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-dynamic-relabel.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-dynamic-relabel.xml
new file mode 100644
index 0000000000000000000000000000000000000000..cec59f8bf49f2c63ca4112eab4156360a153042e
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-dynamic-relabel.xml
@@ -0,0 +1,28 @@
+
+ QEMUGuest1
+ c7a5fdbd-edaf-9455-926a-d65c16db1809
+ 219100
+ 219100
+ 1
+
+ hvm
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-none.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-none.xml
new file mode 100644
index 0000000000000000000000000000000000000000..cec59f8bf49f2c63ca4112eab4156360a153042e
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-none.xml
@@ -0,0 +1,28 @@
+
+ QEMUGuest1
+ c7a5fdbd-edaf-9455-926a-d65c16db1809
+ 219100
+ 219100
+ 1
+
+ hvm
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index b4ab67149b92e0979848ff00cdc9a5724e1c1fbb..03c05daf747efec83b42be42262014237ce04401 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -315,12 +315,13 @@ mymain(void)
DO_TEST_FULL("seclabel-dynamic-baselabel", false, WHEN_INACTIVE);
DO_TEST_FULL("seclabel-dynamic-override", false, WHEN_INACTIVE);
DO_TEST_FULL("seclabel-dynamic-labelskip", true, WHEN_INACTIVE);
- DO_TEST_FULL("seclabel-dynamic-relabel", false, WHEN_INACTIVE);
+ DO_TEST_FULL("seclabel-dynamic-relabel", true, WHEN_INACTIVE);
DO_TEST("seclabel-static");
DO_TEST_FULL("seclabel-static-labelskip", false, WHEN_ACTIVE);
- DO_TEST("seclabel-none");
+ DO_TEST_DIFFERENT("seclabel-none");
DO_TEST("seclabel-dac-none");
DO_TEST("seclabel-dynamic-none");
+ DO_TEST_FULL("seclabel-dynamic-none-relabel", true, WHEN_INACTIVE);
DO_TEST("numad-static-vcpu-no-numatune");
DO_TEST("disk-scsi-lun-passthrough-sgio");
diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 52abb8c47a49f65f9bcbb8d1a67ae52ad1d41c5d..7b26e50bde6241509b68961db7832daa17c0a0a1 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -252,6 +252,16 @@ virCapsPtr testQemuCapsInit(void)
false, false)) == NULL)
return NULL;
+ /* Add dummy 'none' security_driver. This is equal to setting
+ * security_driver = "none" in qemu.conf. */
+ if (VIR_ALLOC_N(caps->host.secModels, 1) < 0)
+ goto cleanup;
+ caps->host.nsecModels = 1;
+
+ if (VIR_STRDUP(caps->host.secModels[0].model, "none") < 0 ||
+ VIR_STRDUP(caps->host.secModels[0].doi, "0") < 0)
+ goto cleanup;
+
if ((caps->host.cpu = virCPUDefCopy(&host_cpu)) == NULL ||
(machines = testQemuAllocMachines(&nmachines)) == NULL)
goto cleanup;