]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: xmconfigtest: add tests for cmdline formating osstest/frozen/xen-4.10-testing osstest/frozen/xen-4.11-testing osstest/frozen/xen-4.9-testing
authorJim Fehlig <jfehlig@suse.com>
Wed, 23 May 2018 21:09:45 +0000 (15:09 -0600)
committerJim Fehlig <jfehlig@suse.com>
Tue, 5 Jun 2018 02:59:16 +0000 (20:59 -0600)
Commit 656151bf fixed formatting of the <cmdline> element. Perhaps it
would have been noticed and fixed earlier if we had a test. With this
change, all possible cases of formatting <cmdline> from xmconfig are
covered

1. no 'extra=' or 'root=' in xm.cfg
2. 'extra=' but no 'root=' in xm.cfg
3. 'root=' but no 'extra=' in xm.cfg
4. both 'root=' and 'extra=' in xm.cfg

Case 1 is covered by all existing paravirt tests since they have no
'extra=' or 'root='. Case 2 is covered by adding 'extra=' to a few
of the existing paravirt tests. Cases 3 and 4 are covered by new
tests that only test conversion of xm.cfg to xml.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
tests/xmconfigdata/test-paravirt-extra-root.cfg [new file with mode: 0644]
tests/xmconfigdata/test-paravirt-extra-root.xml [new file with mode: 0644]
tests/xmconfigdata/test-paravirt-maxvcpus.cfg
tests/xmconfigdata/test-paravirt-maxvcpus.xml
tests/xmconfigdata/test-paravirt-root.cfg [new file with mode: 0644]
tests/xmconfigdata/test-paravirt-root.xml [new file with mode: 0644]
tests/xmconfigdata/test-paravirt-vcpu.cfg
tests/xmconfigdata/test-paravirt-vcpu.xml
tests/xmconfigtest.c

diff --git a/tests/xmconfigdata/test-paravirt-extra-root.cfg b/tests/xmconfigdata/test-paravirt-extra-root.cfg
new file mode 100644 (file)
index 0000000..2569f2f
--- /dev/null
@@ -0,0 +1,13 @@
+name = "XenGuest1"
+uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
+memory = 512
+vcpus = 2
+localtime = 0
+on_poweroff = "destroy"
+on_reboot = "restart"
+on_crash = "restart"
+vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge" ]
+bootloader = "/usr/bin/pygrub"
+root = "/dev/xvda2"
+extra = "console=hvc0"
+disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
diff --git a/tests/xmconfigdata/test-paravirt-extra-root.xml b/tests/xmconfigdata/test-paravirt-extra-root.xml
new file mode 100644 (file)
index 0000000..325b07d
--- /dev/null
@@ -0,0 +1,34 @@
+<domain type='xen'>
+  <name>XenGuest1</name>
+  <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>524288</memory>
+  <currentMemory unit='KiB'>524288</currentMemory>
+  <vcpu placement='static'>2</vcpu>
+  <bootloader>/usr/bin/pygrub</bootloader>
+  <os>
+    <type arch='x86_64' machine='xenpv'>linux</type>
+    <cmdline>root=/dev/xvda2 console=hvc0</cmdline>
+  </os>
+  <clock offset='utc' adjustment='reset'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
+  <devices>
+    <disk type='block' device='disk'>
+      <driver name='phy' type='raw'/>
+      <source dev='/dev/HostVG/XenGuest1'/>
+      <target dev='xvda' bus='xen'/>
+    </disk>
+    <interface type='bridge'>
+      <mac address='00:16:3e:66:94:9c'/>
+      <source bridge='br0'/>
+      <script path='vif-bridge'/>
+    </interface>
+    <console type='pty'>
+      <target type='xen' port='0'/>
+    </console>
+    <input type='mouse' bus='xen'/>
+    <input type='keyboard' bus='xen'/>
+    <memballoon model='xen'/>
+  </devices>
+</domain>
index 8d1ac4d78675d9c71d33f0ed84c8c5a3ea82a69b..f06db611713e1628d3fa52dfa611ddd4ec4904a1 100644 (file)
@@ -10,4 +10,5 @@ on_reboot = "restart"
 on_crash = "restart"
 vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge" ]
 bootloader = "/usr/bin/pygrub"
+extra = "console=hvc0"
 disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
index ce66503dc503654013b7ed6725c1e4d31a3aa31e..3012821ad4a4f7be2dd0da9fe17ca7e0e2445892 100644 (file)
@@ -7,6 +7,7 @@
   <bootloader>/usr/bin/pygrub</bootloader>
   <os>
     <type arch='x86_64' machine='xenpv'>linux</type>
+    <cmdline>console=hvc0</cmdline>
   </os>
   <clock offset='utc' adjustment='reset'/>
   <on_poweroff>destroy</on_poweroff>
diff --git a/tests/xmconfigdata/test-paravirt-root.cfg b/tests/xmconfigdata/test-paravirt-root.cfg
new file mode 100644 (file)
index 0000000..8cdfbd9
--- /dev/null
@@ -0,0 +1,12 @@
+name = "XenGuest1"
+uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
+memory = 512
+vcpus = 2
+localtime = 0
+on_poweroff = "destroy"
+on_reboot = "restart"
+on_crash = "restart"
+vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge" ]
+bootloader = "/usr/bin/pygrub"
+root = "/dev/xvda2"
+disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
diff --git a/tests/xmconfigdata/test-paravirt-root.xml b/tests/xmconfigdata/test-paravirt-root.xml
new file mode 100644 (file)
index 0000000..12d1e3b
--- /dev/null
@@ -0,0 +1,34 @@
+<domain type='xen'>
+  <name>XenGuest1</name>
+  <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
+  <memory unit='KiB'>524288</memory>
+  <currentMemory unit='KiB'>524288</currentMemory>
+  <vcpu placement='static'>2</vcpu>
+  <bootloader>/usr/bin/pygrub</bootloader>
+  <os>
+    <type arch='x86_64' machine='xenpv'>linux</type>
+    <cmdline>root=/dev/xvda2</cmdline>
+  </os>
+  <clock offset='utc' adjustment='reset'/>
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
+  <devices>
+    <disk type='block' device='disk'>
+      <driver name='phy' type='raw'/>
+      <source dev='/dev/HostVG/XenGuest1'/>
+      <target dev='xvda' bus='xen'/>
+    </disk>
+    <interface type='bridge'>
+      <mac address='00:16:3e:66:94:9c'/>
+      <source bridge='br0'/>
+      <script path='vif-bridge'/>
+    </interface>
+    <console type='pty'>
+      <target type='xen' port='0'/>
+    </console>
+    <input type='mouse' bus='xen'/>
+    <input type='keyboard' bus='xen'/>
+    <memballoon model='xen'/>
+  </devices>
+</domain>
index 8d1ac4d78675d9c71d33f0ed84c8c5a3ea82a69b..f06db611713e1628d3fa52dfa611ddd4ec4904a1 100644 (file)
@@ -10,4 +10,5 @@ on_reboot = "restart"
 on_crash = "restart"
 vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge" ]
 bootloader = "/usr/bin/pygrub"
+extra = "console=hvc0"
 disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
index ce66503dc503654013b7ed6725c1e4d31a3aa31e..3012821ad4a4f7be2dd0da9fe17ca7e0e2445892 100644 (file)
@@ -7,6 +7,7 @@
   <bootloader>/usr/bin/pygrub</bootloader>
   <os>
     <type arch='x86_64' machine='xenpv'>linux</type>
+    <cmdline>console=hvc0</cmdline>
   </os>
   <clock offset='utc' adjustment='reset'/>
   <on_poweroff>destroy</on_poweroff>
index 6851fa73cdd2b4cca768e91fae7ac18a470055ce..eaec7c3a5c99669fa45210a52d92b5ff3b6db8f2 100644 (file)
@@ -200,6 +200,8 @@ mymain(void)
     DO_TEST("paravirt-net-vifname");
     DO_TEST("paravirt-vcpu");
     DO_TEST("paravirt-maxvcpus");
+    DO_TEST_FORMAT("paravirt-root");
+    DO_TEST_FORMAT("paravirt-extra-root");
     DO_TEST("fullvirt-new-cdrom");
     DO_TEST("fullvirt-utc");
     DO_TEST("fullvirt-localtime");