[libvirt] [PATCH 4/4] tests: add startuppolicy testcase for multiple mixed harddisks
Guannan Ren
gren at redhat.com
Fri Aug 16 07:52:52 UTC 2013
---
tests/qemustartuppolicytest.c | 4 +++
...ixed-multiple-disks-absent-policy-mandatory.xml | 36 ++++++++++++++++++++++
...mixed-multiple-disks-absent-policy-optional.xml | 36 ++++++++++++++++++++++
...input-multiple-disks-absent-policy-optional.xml | 36 ++++++++++++++++++++++
...ixed-multiple-disks-absent-policy-mandatory.xml | 36 ++++++++++++++++++++++
...mixed-multiple-disks-absent-policy-optional.xml | 27 ++++++++++++++++
...utput-multiple-disks-absent-policy-optional.xml | 22 +++++++++++++
7 files changed, 197 insertions(+)
create mode 100644 tests/qemustartuppolicytestdata/domain-input-mixed-multiple-disks-absent-policy-mandatory.xml
create mode 100644 tests/qemustartuppolicytestdata/domain-input-mixed-multiple-disks-absent-policy-optional.xml
create mode 100644 tests/qemustartuppolicytestdata/domain-input-multiple-disks-absent-policy-optional.xml
create mode 100644 tests/qemustartuppolicytestdata/domain-output-mixed-multiple-disks-absent-policy-mandatory.xml
create mode 100644 tests/qemustartuppolicytestdata/domain-output-mixed-multiple-disks-absent-policy-optional.xml
create mode 100644 tests/qemustartuppolicytestdata/domain-output-multiple-disks-absent-policy-optional.xml
diff --git a/tests/qemustartuppolicytest.c b/tests/qemustartuppolicytest.c
index 7081400..4757ed3 100644
--- a/tests/qemustartuppolicytest.c
+++ b/tests/qemustartuppolicytest.c
@@ -205,6 +205,10 @@ mymain(void)
DO_TEST_OPTIONAL("disk-present-policy-none", true);
DO_TEST_MANDATORY("disk-absent-policy-mandatory", false, true);
+ DO_TEST_OPTIONAL("multiple-disks-absent-policy-optional", false);
+ DO_TEST_OPTIONAL("mixed-multiple-disks-absent-policy-optional", false);
+ DO_TEST_MANDATORY("mixed-multiple-disks-absent-policy-mandatory", false, true);
+
virObjectUnref(driver.caps);
virObjectUnref(driver.xmlopt);
virObjectUnref(driver.config);
diff --git a/tests/qemustartuppolicytestdata/domain-input-mixed-multiple-disks-absent-policy-mandatory.xml b/tests/qemustartuppolicytestdata/domain-input-mixed-multiple-disks-absent-policy-mandatory.xml
new file mode 100644
index 0000000..b98fa80
--- /dev/null
+++ b/tests/qemustartuppolicytestdata/domain-input-mixed-multiple-disks-absent-policy-mandatory.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' 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>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='file' device='disk'>
+ <target dev='vda' bus='virtio'/>
+ <driver name='qemu' type='raw'/>
+ <source file='/dev/disk-nonexist1' startupPolicy='mandatory'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <target dev='vdb' bus='virtio'/>
+ <driver name='qemu' type='raw'/>
+ <source file='/dev/null' startupPolicy='mandatory'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <target dev='vdc' bus='virtio'/>
+ <driver name='qemu' type='raw'/>
+ <source file='/dev/disk-nonexist3' startupPolicy='optional'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemustartuppolicytestdata/domain-input-mixed-multiple-disks-absent-policy-optional.xml b/tests/qemustartuppolicytestdata/domain-input-mixed-multiple-disks-absent-policy-optional.xml
new file mode 100644
index 0000000..2f68912
--- /dev/null
+++ b/tests/qemustartuppolicytestdata/domain-input-mixed-multiple-disks-absent-policy-optional.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' 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>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='file' device='disk'>
+ <target dev='vda' bus='virtio'/>
+ <driver name='qemu' type='raw'/>
+ <source file='/dev/disk-nonexist1' startupPolicy='optional'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <target dev='vdb' bus='virtio'/>
+ <driver name='qemu' type='raw'/>
+ <source file='/dev/null' startupPolicy='mandatory'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <target dev='vdc' bus='virtio'/>
+ <driver name='qemu' type='raw'/>
+ <source file='/dev/disk-nonexist3' startupPolicy='optional'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemustartuppolicytestdata/domain-input-multiple-disks-absent-policy-optional.xml b/tests/qemustartuppolicytestdata/domain-input-multiple-disks-absent-policy-optional.xml
new file mode 100644
index 0000000..da7572f
--- /dev/null
+++ b/tests/qemustartuppolicytestdata/domain-input-multiple-disks-absent-policy-optional.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' 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>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='file' device='disk'>
+ <target dev='vda' bus='virtio'/>
+ <driver name='qemu' type='raw'/>
+ <source file='/dev/disk-nonexist1' startupPolicy='optional'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <target dev='vdb' bus='virtio'/>
+ <driver name='qemu' type='raw'/>
+ <source file='/dev/disk-nonexist2' startupPolicy='optional'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <target dev='vdc' bus='virtio'/>
+ <driver name='qemu' type='raw'/>
+ <source file='/dev/disk-nonexist3' startupPolicy='optional'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemustartuppolicytestdata/domain-output-mixed-multiple-disks-absent-policy-mandatory.xml b/tests/qemustartuppolicytestdata/domain-output-mixed-multiple-disks-absent-policy-mandatory.xml
new file mode 100644
index 0000000..b98fa80
--- /dev/null
+++ b/tests/qemustartuppolicytestdata/domain-output-mixed-multiple-disks-absent-policy-mandatory.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' 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>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='file' device='disk'>
+ <target dev='vda' bus='virtio'/>
+ <driver name='qemu' type='raw'/>
+ <source file='/dev/disk-nonexist1' startupPolicy='mandatory'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <target dev='vdb' bus='virtio'/>
+ <driver name='qemu' type='raw'/>
+ <source file='/dev/null' startupPolicy='mandatory'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <target dev='vdc' bus='virtio'/>
+ <driver name='qemu' type='raw'/>
+ <source file='/dev/disk-nonexist3' startupPolicy='optional'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemustartuppolicytestdata/domain-output-mixed-multiple-disks-absent-policy-optional.xml b/tests/qemustartuppolicytestdata/domain-output-mixed-multiple-disks-absent-policy-optional.xml
new file mode 100644
index 0000000..e23a712
--- /dev/null
+++ b/tests/qemustartuppolicytestdata/domain-output-mixed-multiple-disks-absent-policy-optional.xml
@@ -0,0 +1,27 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' 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>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source file='/dev/null' startupPolicy='mandatory'/>
+ <target dev='vdb' bus='virtio'/>
+ </disk>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
diff --git a/tests/qemustartuppolicytestdata/domain-output-multiple-disks-absent-policy-optional.xml b/tests/qemustartuppolicytestdata/domain-output-multiple-disks-absent-policy-optional.xml
new file mode 100644
index 0000000..d68cd79
--- /dev/null
+++ b/tests/qemustartuppolicytestdata/domain-output-multiple-disks-absent-policy-optional.xml
@@ -0,0 +1,22 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219100</memory>
+ <currentMemory unit='KiB'>219100</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='i686' 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>
+ <devices>
+ <emulator>/usr/bin/qemu</emulator>
+ <controller type='usb' index='0'/>
+ <controller type='ide' index='0'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <memballoon model='virtio'/>
+ </devices>
+</domain>
--
1.8.3.1
More information about the libvir-list
mailing list