Signed-off-by: Marek Marczykowski-Górecki <marmarek(a)invisiblethingslab.com>
---
Changes in v3:
- update for modified "libxl: add support for PVH"
- skip PVH test on too old Xen
Changes in v5:
- adjust for xenpvh os type
---
tests/libxlxml2domconfigdata/basic-pvh.json | 49 ++++++++++++++++++++++-
tests/libxlxml2domconfigdata/basic-pvh.xml | 28 +++++++++++++-
tests/libxlxml2domconfigtest.c | 3 +-
3 files changed, 80 insertions(+)
create mode 100644 tests/libxlxml2domconfigdata/basic-pvh.json
create mode 100644 tests/libxlxml2domconfigdata/basic-pvh.xml
diff --git a/tests/libxlxml2domconfigdata/basic-pvh.json
b/tests/libxlxml2domconfigdata/basic-pvh.json
new file mode 100644
index 0000000..48365c9
--- /dev/null
+++ b/tests/libxlxml2domconfigdata/basic-pvh.json
@@ -0,0 +1,49 @@
+{
+ "c_info": {
+ "type": "pvh",
+ "name": "test-pvh",
+ "uuid": "039e9ee6-4a84-3055-4c81-8ba426ae2656"
+ },
+ "b_info": {
+ "max_vcpus": 4,
+ "avail_vcpus": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "max_memkb": 524288,
+ "target_memkb": 524288,
+ "shadow_memkb": 8192,
+ "sched_params": {
+
+ },
+ "kernel": "/boot/vmlinuz",
+ "ramdisk": "/boot/initrd.img",
+ "type.pvh": {
+ },
+ "arch_arm": {
+
+ }
+ },
+ "disks": [
+ {
+ "pdev_path": "/var/lib/xen/images/test-pv.img",
+ "vdev": "xvda",
+ "backend": "qdisk",
+ "format": "raw",
+ "removable": 1,
+ "readwrite": 1
+ }
+ ],
+ "nics": [
+ {
+ "devid": 0,
+ "mac": "00:16:3e:3e:86:60",
+ "bridge": "br0",
+ "script": "/etc/xen/scripts/vif-bridge",
+ "nictype": "vif"
+ }
+ ],
+ "on_reboot": "restart"
+}
diff --git a/tests/libxlxml2domconfigdata/basic-pvh.xml
b/tests/libxlxml2domconfigdata/basic-pvh.xml
new file mode 100644
index 0000000..fa9ff7c
--- /dev/null
+++ b/tests/libxlxml2domconfigdata/basic-pvh.xml
@@ -0,0 +1,28 @@
+<domain type='xen'>
+ <name>test-pvh</name>
+ <uuid>039e9ee6-4a84-3055-4c81-8ba426ae2656</uuid>
+ <memory>524288</memory>
+ <currentMemory>524288</currentMemory>
+ <vcpu>4</vcpu>
+ <os>
+ <type arch='x86_64' machine='xenpvh'>xenpvh</type>
+ <kernel>/boot/vmlinuz</kernel>
+ <initrd>/boot/initrd.img</initrd>
+ </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='qemu'/>
+ <source file='/var/lib/xen/images/test-pv.img'/>
+ <target dev='xvda'/>
+ </disk>
+ <interface type='bridge'>
+ <source bridge='br0'/>
+ <mac address='00:16:3e:3e:86:60'/>
+ <script path='/etc/xen/scripts/vif-bridge'/>
+ </interface>
+ </devices>
+</domain>
diff --git a/tests/libxlxml2domconfigtest.c b/tests/libxlxml2domconfigtest.c
index f380941..969d84e 100644
--- a/tests/libxlxml2domconfigtest.c
+++ b/tests/libxlxml2domconfigtest.c
@@ -203,6 +203,9 @@ mymain(void)
DO_TEST("basic-pv");
DO_TEST("basic-hvm");
+# ifdef HAVE_XEN_PVH
+ DO_TEST("basic-pvh");
+# endif
DO_TEST("cpu-shares-hvm");
DO_TEST("variable-clock-hvm");
DO_TEST("moredevs-hvm");
--
git-series 0.9.1