提交 076a2b40 编写于 作者: J Jim Fehlig

tests: xmconfigtest: add tests for cmdline formating

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: NJim Fehlig <jfehlig@suse.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 67c56f6e
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" ]
<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>
......@@ -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" ]
......@@ -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>
......
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" ]
<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>
......@@ -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" ]
......@@ -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>
......
......@@ -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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册