[libvirt] [PATCH 9/9] bhyvexml2xmltest: Test more XMLs

Michal Privoznik mprivozn at redhat.com
Tue Dec 27 09:30:10 UTC 2016


Currently, bhyvexml2xmltest does only one test. We can do better.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 .../bhyvexml2xmlout-acpiapic.xml                   | 34 ++++++++++++++++
 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml | 30 +++++++++++++++
 .../bhyvexml2xmlout-bhyveload-bootorder.xml        | 37 ++++++++++++++++++
 .../bhyvexml2xmlout-bhyveload-bootorder1.xml       | 37 ++++++++++++++++++
 .../bhyvexml2xmlout-bhyveload-bootorder2.xml       | 30 +++++++++++++++
 .../bhyvexml2xmlout-bhyveload-bootorder3.xml       | 37 ++++++++++++++++++
 .../bhyvexml2xmlout-bhyveload-bootorder4.xml       | 38 ++++++++++++++++++
 .../bhyvexml2xmlout-bhyveload-explicitargs.xml     | 30 +++++++++++++++
 .../bhyvexml2xmlout-console.xml                    | 38 ++++++++++++++++++
 .../bhyvexml2xmlout-custom-loader.xml              | 31 +++++++++++++++
 .../bhyvexml2xmlout-disk-cdrom-grub.xml            | 31 +++++++++++++++
 .../bhyvexml2xmlout-disk-cdrom.xml                 | 31 +++++++++++++++
 .../bhyvexml2xmlout-disk-virtio.xml                | 29 ++++++++++++++
 .../bhyvexml2xmlout-grub-bootorder.xml             | 43 +++++++++++++++++++++
 .../bhyvexml2xmlout-grub-bootorder2.xml            | 45 ++++++++++++++++++++++
 .../bhyvexml2xmlout-grub-defaults.xml              | 30 +++++++++++++++
 .../bhyvexml2xmlout-localtime.xml                  | 30 +++++++++++++++
 .../bhyvexml2xmlout-macaddr.xml                    | 30 +++++++++++++++
 .../bhyvexml2xmlout-serial-grub-nocons.xml         | 38 ++++++++++++++++++
 .../bhyvexml2xmlout-serial-grub.xml                | 38 ++++++++++++++++++
 .../bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml | 38 ++++++++++++++++++
 tests/bhyvexml2xmltest.c                           | 21 ++++++++++
 22 files changed, 746 insertions(+)
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-acpiapic.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder1.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder2.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder3.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder4.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-explicitargs.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-custom-loader.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom-grub.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-virtio.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder2.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-defaults.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-localtime.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-macaddr.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml
 create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml

diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-acpiapic.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-acpiapic.xml
new file mode 100644
index 000000000..b4720ecaf
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-acpiapic.xml
@@ -0,0 +1,34 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <features>
+    <acpi/>
+    <apic/>
+  </features>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:81:c4:b1'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml
new file mode 100644
index 000000000..cd4e4f80d
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-base.xml
@@ -0,0 +1,30 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>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>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:b9:94:02'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder.xml
new file mode 100644
index 000000000..ab01cb5ab
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder.xml
@@ -0,0 +1,37 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>hvm</type>
+    <boot dev='cdrom'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <disk type='file' device='cdrom'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/cdrom.iso'/>
+      <target dev='hdb' bus='sata'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='0' target='4' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:8d:10:e1'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder1.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder1.xml
new file mode 100644
index 000000000..df69c4e87
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder1.xml
@@ -0,0 +1,37 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>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>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <disk type='file' device='cdrom'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/cdrom.iso'/>
+      <target dev='hdb' bus='sata'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='0' target='4' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:92:68:0e'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder2.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder2.xml
new file mode 100644
index 000000000..89131dc85
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder2.xml
@@ -0,0 +1,30 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>hvm</type>
+    <boot dev='cdrom'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:1e:63:25'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder3.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder3.xml
new file mode 100644
index 000000000..96f9dc4dd
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder3.xml
@@ -0,0 +1,37 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <disk type='file' device='cdrom'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/cdrom.iso'/>
+      <target dev='hdc' bus='sata'/>
+      <readonly/>
+      <boot order='1'/>
+      <address type='drive' controller='0' bus='0' target='4' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:7a:f5:a4'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder4.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder4.xml
new file mode 100644
index 000000000..1dd180bc0
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-bootorder4.xml
@@ -0,0 +1,38 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <boot order='2'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <disk type='file' device='cdrom'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/cdrom.iso'/>
+      <target dev='hdb' bus='sata'/>
+      <readonly/>
+      <boot order='1'/>
+      <address type='drive' controller='0' bus='0' target='4' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:fe:97:82'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-explicitargs.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-explicitargs.xml
new file mode 100644
index 000000000..d7743a640
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-bhyveload-explicitargs.xml
@@ -0,0 +1,30 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>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>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:11:bd:26'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml
new file mode 100644
index 000000000..bf926f96b
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-console.xml
@@ -0,0 +1,38 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>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>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:b1:42:eb'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+    <serial type='nmdm'>
+      <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/>
+      <target port='0'/>
+    </serial>
+    <console type='nmdm'>
+      <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/>
+      <target type='serial' port='0'/>
+    </console>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-custom-loader.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-custom-loader.xml
new file mode 100644
index 000000000..3e7f145ed
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-custom-loader.xml
@@ -0,0 +1,31 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <bootloader>/fizz_buzz_bazz</bootloader>
+  <bootloader_args>-X -Y -Z</bootloader_args>
+  <os>
+    <type arch='x86_64'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:35:99:c2'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom-grub.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom-grub.xml
new file mode 100644
index 000000000..285842c01
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom-grub.xml
@@ -0,0 +1,31 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <bootloader>/usr/local/sbin/grub-bhyve</bootloader>
+  <os>
+    <type arch='x86_64'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='cdrom'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/cdrom.iso'/>
+      <target dev='hdc' bus='sata'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:6f:6a:53'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom.xml
new file mode 100644
index 000000000..02517e4fd
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-cdrom.xml
@@ -0,0 +1,31 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>hvm</type>
+    <boot dev='cdrom'/>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='cdrom'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/cdrom.iso'/>
+      <target dev='hdc' bus='sata'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:e3:ec:9b'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-virtio.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-virtio.xml
new file mode 100644
index 000000000..065ae813a
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-disk-virtio.xml
@@ -0,0 +1,29 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>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>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='vda' bus='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
+    </disk>
+    <interface type='bridge'>
+      <mac address='52:54:00:bc:85:fe'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder.xml
new file mode 100644
index 000000000..939f7ba58
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder.xml
@@ -0,0 +1,43 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <bootloader>/usr/local/sbin/grub-bhyve</bootloader>
+  <os>
+    <type arch='x86_64'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd1.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd2.img'/>
+      <target dev='hdb' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='4' unit='0'/>
+    </disk>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd3.img'/>
+      <target dev='hdc' bus='sata'/>
+      <boot order='1'/>
+      <address type='drive' controller='0' bus='0' target='6' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:f4:6c:be'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder2.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder2.xml
new file mode 100644
index 000000000..f774411e9
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-bootorder2.xml
@@ -0,0 +1,45 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <bootloader>/usr/local/sbin/grub-bhyve</bootloader>
+  <os>
+    <type arch='x86_64'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd1.img'/>
+      <target dev='hda' bus='sata'/>
+      <boot order='111'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd2.img'/>
+      <target dev='hdb' bus='sata'/>
+      <boot order='22'/>
+      <address type='drive' controller='0' bus='0' target='4' unit='0'/>
+    </disk>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd3.img'/>
+      <target dev='hdc' bus='sata'/>
+      <boot order='3'/>
+      <address type='drive' controller='0' bus='0' target='6' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:0e:d2:6f'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-defaults.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-defaults.xml
new file mode 100644
index 000000000..758986b3f
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-grub-defaults.xml
@@ -0,0 +1,30 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <bootloader>/usr/local/sbin/grub-bhyve</bootloader>
+  <os>
+    <type arch='x86_64'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:ee:f5:79'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-localtime.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-localtime.xml
new file mode 100644
index 000000000..7e08ff9de
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-localtime.xml
@@ -0,0 +1,30 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>hvm</type>
+    <boot dev='hd'/>
+  </os>
+  <clock offset='localtime'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:82:ca:a3'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-macaddr.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-macaddr.xml
new file mode 100644
index 000000000..4e4e672fc
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-macaddr.xml
@@ -0,0 +1,30 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>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>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:22:ee:11'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml
new file mode 100644
index 000000000..a379f1274
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub-nocons.xml
@@ -0,0 +1,38 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <bootloader>/usr/local/sbin/grub-bhyve</bootloader>
+  <os>
+    <type arch='x86_64'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:a7:cd:5b'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+    <serial type='nmdm'>
+      <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/>
+      <target port='0'/>
+    </serial>
+    <console type='nmdm'>
+      <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/>
+      <target type='serial' port='0'/>
+    </console>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml
new file mode 100644
index 000000000..2864089ae
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-grub.xml
@@ -0,0 +1,38 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <bootloader>/usr/local/sbin/grub-bhyve</bootloader>
+  <os>
+    <type arch='x86_64'>hvm</type>
+  </os>
+  <clock offset='utc'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>destroy</on_crash>
+  <devices>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:f0:72:11'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+    <serial type='nmdm'>
+      <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/>
+      <target port='0'/>
+    </serial>
+    <console type='nmdm'>
+      <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/>
+      <target type='serial' port='0'/>
+    </console>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml
new file mode 100644
index 000000000..954c58aca
--- /dev/null
+++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial.xml
@@ -0,0 +1,38 @@
+<domain type='bhyve'>
+  <name>bhyve</name>
+  <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+  <memory unit='KiB'>219136</memory>
+  <currentMemory unit='KiB'>219136</currentMemory>
+  <vcpu placement='static'>1</vcpu>
+  <os>
+    <type arch='x86_64'>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>
+    <disk type='file' device='disk'>
+      <driver name='file' type='raw'/>
+      <source file='/tmp/freebsd.img'/>
+      <target dev='hda' bus='sata'/>
+      <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+    </disk>
+    <controller type='sata' index='0'/>
+    <interface type='bridge'>
+      <mac address='52:54:00:4f:f3:5b'/>
+      <source bridge='virbr0'/>
+      <model type='virtio'/>
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+    </interface>
+    <serial type='nmdm'>
+      <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/>
+      <target port='0'/>
+    </serial>
+    <console type='nmdm'>
+      <source master='/dev/nmdm0A' slave='/dev/nmdm0B'/>
+      <target type='serial' port='0'/>
+    </console>
+  </devices>
+</domain>
diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c
index 756d5d2fc..e95cee4b8 100644
--- a/tests/bhyvexml2xmltest.c
+++ b/tests/bhyvexml2xmltest.c
@@ -63,7 +63,28 @@ mymain(void)
 # define DO_TEST_DIFFERENT(name) \
     DO_TEST_FULL(name, true)
 
+    DO_TEST_DIFFERENT("acpiapic");
+    DO_TEST_DIFFERENT("base");
+    DO_TEST_DIFFERENT("bhyveload-bootorder");
+    DO_TEST_DIFFERENT("bhyveload-bootorder1");
+    DO_TEST_DIFFERENT("bhyveload-bootorder2");
+    DO_TEST_DIFFERENT("bhyveload-bootorder3");
+    DO_TEST_DIFFERENT("bhyveload-bootorder4");
+    DO_TEST_DIFFERENT("bhyveload-explicitargs");
+    DO_TEST_DIFFERENT("console");
+    DO_TEST_DIFFERENT("custom-loader");
+    DO_TEST_DIFFERENT("disk-cdrom");
+    DO_TEST_DIFFERENT("disk-cdrom-grub");
+    DO_TEST_DIFFERENT("disk-virtio");
+    DO_TEST_DIFFERENT("grub-bootorder");
+    DO_TEST_DIFFERENT("grub-bootorder2");
+    DO_TEST_DIFFERENT("grub-defaults");
+    DO_TEST_DIFFERENT("localtime");
+    DO_TEST_DIFFERENT("macaddr");
     DO_TEST_DIFFERENT("metadata");
+    DO_TEST_DIFFERENT("serial");
+    DO_TEST_DIFFERENT("serial-grub");
+    DO_TEST_DIFFERENT("serial-grub-nocons");
 
     virObjectUnref(driver.caps);
     virObjectUnref(driver.xmlopt);
-- 
2.11.0




More information about the libvir-list mailing list