Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
b3033b99
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b3033b99
编写于
7月 18, 2007
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added testsuite for QEMU XML routines
上级
0bd91c25
变更
37
显示空白变更内容
内联
并排
Showing
37 changed file
with
775 addition
and
2 deletion
+775
-2
ChangeLog
ChangeLog
+7
-0
tests/.cvsignore
tests/.cvsignore
+2
-0
tests/Makefile.am
tests/Makefile.am
+15
-2
tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args
tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml
tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml
+23
-0
tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args
tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.xml
tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.xml
+26
-0
tests/qemuxml2argvdata/qemuxml2argv-boot-network.args
tests/qemuxml2argvdata/qemuxml2argv-boot-network.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml
tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml
+22
-0
tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args
tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.xml
tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.xml
+22
-0
tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args
tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml
tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml
+22
-0
tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args
tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml
tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml
+27
-0
tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args
tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.xml
tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.xml
+30
-0
tests/qemuxml2argvdata/qemuxml2argv-disk-many.args
tests/qemuxml2argvdata/qemuxml2argv-disk-many.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml
tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml
+34
-0
tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args
tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml
tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml
+24
-0
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml
+24
-0
tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args
tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.xml
tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.xml
+23
-0
tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args
tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.xml
tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.xml
+23
-0
tests/qemuxml2argvdata/qemuxml2argv-minimal.args
tests/qemuxml2argvdata/qemuxml2argv-minimal.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-minimal.xml
tests/qemuxml2argvdata/qemuxml2argv-minimal.xml
+22
-0
tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args
tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml
tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml
+25
-0
tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args
tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.xml
tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.xml
+22
-0
tests/qemuxml2argvdata/qemuxml2argv-net-user.args
tests/qemuxml2argvdata/qemuxml2argv-net-user.args
+1
-0
tests/qemuxml2argvdata/qemuxml2argv-net-user.xml
tests/qemuxml2argvdata/qemuxml2argv-net-user.xml
+25
-0
tests/qemuxml2argvtest.c
tests/qemuxml2argvtest.c
+188
-0
tests/qemuxml2xmltest.c
tests/qemuxml2xmltest.c
+153
-0
未找到文件。
ChangeLog
浏览文件 @
b3033b99
Wed Jul 18 17:15:08 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* tests/Makefile.am: Added QEMU tests
* tests/qemuxml2argvdata/*: Data files for QEMU tests
* tests/qemuxml2argvtest.c: Test XML -> argv conversion
* tests/qemuxml2xmltest.c: Test XML -> XML roundtrip
Wed Jul 18 17:11:08 EST 2007 Daniel P. Berrange <berrange@redhat.com>
Wed Jul 18 17:11:08 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* src/xmlrpctest.c, src/xml2sexprtest.c: More void * to
* src/xmlrpctest.c, src/xml2sexprtest.c: More void * to
...
...
tests/.cvsignore
浏览文件 @
b3033b99
...
@@ -10,6 +10,8 @@ conftest
...
@@ -10,6 +10,8 @@ conftest
reconnect
reconnect
xmconfigtest
xmconfigtest
xencapstest
xencapstest
qemuxml2xmltest
qemuxml2argvtest
*.gcda
*.gcda
*.gcno
*.gcno
tests/Makefile.am
浏览文件 @
b3033b99
...
@@ -32,9 +32,10 @@ LDADDS = \
...
@@ -32,9 +32,10 @@ LDADDS = \
EXTRA_DIST
=
xmlrpcserver.py test_conf.sh
EXTRA_DIST
=
xmlrpcserver.py test_conf.sh
noinst_PROGRAMS
=
xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest
\
noinst_PROGRAMS
=
xmlrpctest xml2sexprtest sexpr2xmltest virshtest conftest
\
reconnect xmconfigtest xencapstest
reconnect xmconfigtest xencapstest
qemuxml2argvtest qemuxml2xmltest
TESTS
=
xml2sexprtest sexpr2xmltest virshtest test_conf.sh xmconfigtest xencapstest
TESTS
=
xml2sexprtest sexpr2xmltest virshtest test_conf.sh xmconfigtest
\
xencapstest qemuxml2argvtest qemuxml2xmltest
if
ENABLE_XEN_TESTS
if
ENABLE_XEN_TESTS
TESTS
+=
reconnect
TESTS
+=
reconnect
endif
endif
...
@@ -70,6 +71,18 @@ xmconfigtest_SOURCES = \
...
@@ -70,6 +71,18 @@ xmconfigtest_SOURCES = \
xmconfigtest_LDFLAGS
=
xmconfigtest_LDFLAGS
=
xmconfigtest_LDADD
=
$(LDADDS)
xmconfigtest_LDADD
=
$(LDADDS)
qemuxml2argvtest_SOURCES
=
\
qemuxml2argvtest.c
\
testutils.c testutils.h
qemuxml2argvtest_LDFLAGS
=
qemuxml2argvtest_LDADD
=
$(LDADDS)
qemuxml2xmltest_SOURCES
=
\
qemuxml2xmltest.c
\
testutils.c testutils.h
qemuxml2xmltest_LDFLAGS
=
qemuxml2xmltest_LDADD
=
$(LDADDS)
virshtest_SOURCES
=
\
virshtest_SOURCES
=
\
virshtest.c
\
virshtest.c
\
testutils.c testutils.h
testutils.c testutils.h
...
...
tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot d -cdrom /dev/cdrom -net none -usb -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-boot-cdrom.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
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>
<emulator>
/usr/bin/qemu
</emulator>
<disk
type=
'block'
device=
'cdrom'
>
<source
dev=
'/dev/cdrom'
/>
<target
dev=
'hdc'
/>
<readonly/>
</disk>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot a -hda /dev/HostVG/QEMUGuest1 -fda /tmp/firmware.img -net none -usb -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-boot-floppy.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'fd'
/>
</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=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
<disk
type=
'file'
device=
'floppy'
>
<source
file=
'/tmp/firmware.img'
/>
<target
dev=
'fda'
/>
</disk>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-boot-network.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot n -hda /dev/HostVG/QEMUGuest1 -net none -usb -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-boot-network.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'net'
/>
</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=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -localtime -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-clock-localtime.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
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>
<emulator>
/usr/bin/qemu
</emulator>
<disk
type=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-clock-utc.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
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=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -cdrom /root/boot.iso -net none -usb -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
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=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
<disk
type=
'file'
device=
'cdrom'
>
<source
file=
'/root/boot.iso'
/>
<target
dev=
'hdc'
/>
<readonly/>
</disk>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -fda /dev/fd0 -fdb /tmp/firmware.img -net none -usb -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-disk-floppy.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
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=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
<disk
type=
'block'
device=
'floppy'
>
<source
dev=
'/dev/fd0'
/>
<target
dev=
'fda'
/>
</disk>
<disk
type=
'file'
device=
'floppy'
>
<source
file=
'/tmp/firmware.img'
/>
<target
dev=
'fdb'
/>
</disk>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-disk-many.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -hdb /dev/HostVG/QEMUGuest2 -hdc /tmp/data.img -hdd /tmp/logs.img -net none -usb -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-disk-many.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
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=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
<disk
type=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest2'
/>
<target
dev=
'hdb'
/>
</disk>
<disk
type=
'file'
device=
'disk'
>
<source
file=
'/tmp/data.img'
/>
<target
dev=
'hdc'
/>
</disk>
<disk
type=
'file'
device=
'disk'
>
<source
file=
'/tmp/logs.img'
/>
<target
dev=
'hdd'
/>
</disk>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb -sdl
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
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=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
<input
type=
'mouse'
bus=
'ps2'
/>
<graphics
type=
'sdl'
/>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb -vnc 127.0.0.1:3
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
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=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
<input
type=
'mouse'
bus=
'ps2'
/>
<graphics
type=
'vnc'
port=
'5903'
listen=
'127.0.0.1'
/>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb -usbdevice mouse -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-input-usbmouse.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
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=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
<input
type=
'mouse'
bus=
'usb'
/>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb -usbdevice tablet -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-input-usbtablet.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
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=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
<input
type=
'tablet'
bus=
'usb'
/>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-minimal.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-minimal.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
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=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'hd'
/>
</os>
<features>
<acpi/>
</features>
<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=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-reboot -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net none -usb -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-misc-no-reboot.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
1
</vcpu>
<os>
<type
arch=
'i686'
machine=
'pc'
>
hvm
</type>
<boot
dev=
'hd'
/>
</os>
<clock
offset=
'utc'
/>
<on_poweroff>
destroy
</on_poweroff>
<on_reboot>
destroy
</on_reboot>
<on_crash>
destroy
</on_crash>
<devices>
<emulator>
/usr/bin/qemu
</emulator>
<disk
type=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
</devices>
</domain>
tests/qemuxml2argvdata/qemuxml2argv-net-user.args
0 → 100644
浏览文件 @
b3033b99
/usr/bin/qemu -M pc -m 214 -smp 1 -monitor pty -no-acpi -boot c -hda /dev/HostVG/QEMUGuest1 -net nic,macaddr=00:11:22:33:44:55,vlan=0 -net user,vlan=0 -usb -nographic
\ No newline at end of file
tests/qemuxml2argvdata/qemuxml2argv-net-user.xml
0 → 100644
浏览文件 @
b3033b99
<domain
type=
'qemu'
>
<name>
QEMUGuest1
</name>
<uuid>
c7a5fdbd-edaf-9455-926a-d65c16db1809
</uuid>
<memory>
219200
</memory>
<currentMemory>
219200
</currentMemory>
<vcpu>
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=
'block'
device=
'disk'
>
<source
dev=
'/dev/HostVG/QEMUGuest1'
/>
<target
dev=
'hda'
/>
</disk>
<interface
type=
'user'
>
<mac
address=
'00:11:22:33:44:55'
/>
</interface>
</devices>
</domain>
tests/qemuxml2argvtest.c
0 → 100644
浏览文件 @
b3033b99
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <fcntl.h>
#include "testutils.h"
#include "qemu_conf.h"
#include "internal.h"
static
char
*
progname
;
struct
qemud_driver
driver
;
#define MAX_FILE 4096
static
int
testCompareXMLToArgvFiles
(
const
char
*
xml
,
const
char
*
cmd
)
{
char
xmlData
[
MAX_FILE
];
char
argvData
[
MAX_FILE
];
char
*
xmlPtr
=
&
(
xmlData
[
0
]);
char
*
expectargv
=
&
(
argvData
[
0
]);
char
*
actualargv
=
NULL
;
char
**
argv
=
NULL
;
char
**
tmp
=
NULL
;
int
ret
=
-
1
,
len
;
struct
qemud_vm_def
*
vmdef
;
struct
qemud_vm
vm
;
if
(
virtTestLoadFile
(
xml
,
&
xmlPtr
,
MAX_FILE
)
<
0
)
goto
fail
;
if
(
virtTestLoadFile
(
cmd
,
&
expectargv
,
MAX_FILE
)
<
0
)
goto
fail
;
if
(
!
(
vmdef
=
qemudParseVMDef
(
NULL
,
&
driver
,
xmlData
,
"test"
)))
goto
fail
;
vm
.
def
=
vmdef
;
vm
.
pid
=
-
1
;
vm
.
id
=
-
1
;
vmdef
->
vncActivePort
=
vmdef
->
vncPort
;
if
(
qemudBuildCommandLine
(
NULL
,
&
driver
,
&
vm
,
&
argv
)
<
0
)
goto
fail
;
tmp
=
argv
;
len
=
0
;
while
(
*
tmp
)
{
len
+=
strlen
(
*
tmp
)
+
1
;
tmp
++
;
}
actualargv
=
malloc
(
sizeof
(
char
)
*
len
);
actualargv
[
0
]
=
'\0'
;
tmp
=
argv
;
len
=
0
;
while
(
*
tmp
)
{
if
(
actualargv
[
0
])
strcat
(
actualargv
,
" "
);
strcat
(
actualargv
,
*
tmp
);
tmp
++
;
}
if
(
strcmp
(
expectargv
,
actualargv
))
{
if
(
getenv
(
"DEBUG_TESTS"
))
{
printf
(
"Expect %4d '%s'
\n
"
,
(
int
)
strlen
(
expectargv
),
expectargv
);
printf
(
"Actual %4d '%s'
\n
"
,
(
int
)
strlen
(
actualargv
),
actualargv
);
}
goto
fail
;
}
ret
=
0
;
fail:
free
(
actualargv
);
if
(
argv
)
{
tmp
=
argv
;
while
(
*
tmp
)
{
free
(
*
tmp
);
tmp
++
;
}
free
(
argv
);
}
return
ret
;
}
static
int
testCompareXMLToArgvHelper
(
const
void
*
data
)
{
char
xml
[
PATH_MAX
];
char
args
[
PATH_MAX
];
snprintf
(
xml
,
PATH_MAX
,
"qemuxml2argvdata/qemuxml2argv-%s.xml"
,
(
const
char
*
)
data
);
snprintf
(
args
,
PATH_MAX
,
"qemuxml2argvdata/qemuxml2argv-%s.args"
,
(
const
char
*
)
data
);
return
testCompareXMLToArgvFiles
(
xml
,
args
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
ret
=
0
;
progname
=
argv
[
0
];
if
(
argc
>
1
)
{
fprintf
(
stderr
,
"Usage: %s
\n
"
,
progname
);
exit
(
EXIT_FAILURE
);
}
driver
.
qemuVersion
=
0
*
1000
*
100
+
(
8
*
1000
)
+
1
;
driver
.
qemuCmdFlags
=
QEMUD_CMD_FLAG_VNC_COLON
|
QEMUD_CMD_FLAG_NO_REBOOT
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV minimal"
,
1
,
testCompareXMLToArgvHelper
,
"minimal"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Boot CDROM"
,
1
,
testCompareXMLToArgvHelper
,
"boot-cdrom"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Boot Network"
,
1
,
testCompareXMLToArgvHelper
,
"boot-network"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Boot Floppy"
,
1
,
testCompareXMLToArgvHelper
,
"boot-floppy"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Clock UTC"
,
1
,
testCompareXMLToArgvHelper
,
"clock-utc"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Clock Localtime"
,
1
,
testCompareXMLToArgvHelper
,
"clock-localtime"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Disk CDROM"
,
1
,
testCompareXMLToArgvHelper
,
"disk-cdrom"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Disk Floppy"
,
1
,
testCompareXMLToArgvHelper
,
"disk-floppy"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Disk Many"
,
1
,
testCompareXMLToArgvHelper
,
"disk-many"
)
<
0
)
ret
=
-
1
;
if
(
0
&&
virtTestRun
(
"QEMU XML-2-ARGV Graphics VNC"
,
1
,
testCompareXMLToArgvHelper
,
"graphics-vnc"
)
<
0
)
ret
=
-
1
;
if
(
0
&&
virtTestRun
(
"QEMU XML-2-ARGV Graphics SDL"
,
1
,
testCompareXMLToArgvHelper
,
"graphics-sdl"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Input USB Mouse"
,
1
,
testCompareXMLToArgvHelper
,
"input-usbmouse"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Input USB Tablet"
,
1
,
testCompareXMLToArgvHelper
,
"input-usbtablet"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Misc ACPI"
,
1
,
testCompareXMLToArgvHelper
,
"misc-acpi"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Misc No Reboot"
,
1
,
testCompareXMLToArgvHelper
,
"misc-no-reboot"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Net User"
,
1
,
testCompareXMLToArgvHelper
,
"net-user"
)
<
0
)
ret
=
-
1
;
exit
(
ret
==
0
?
EXIT_SUCCESS
:
EXIT_FAILURE
);
}
/*
* Local variables:
* indent-tabs-mode: nil
* c-indent-level: 4
* c-basic-offset: 4
* tab-width: 4
* End:
*/
tests/qemuxml2xmltest.c
0 → 100644
浏览文件 @
b3033b99
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <fcntl.h>
#include "testutils.h"
#include "qemu_conf.h"
#include "internal.h"
static
char
*
progname
;
struct
qemud_driver
driver
;
#define MAX_FILE 4096
static
int
testCompareXMLToXMLFiles
(
const
char
*
xml
)
{
char
xmlData
[
MAX_FILE
];
char
*
xmlPtr
=
&
(
xmlData
[
0
]);
char
*
actual
=
NULL
;
int
ret
=
-
1
;
struct
qemud_vm_def
*
vmdef
;
struct
qemud_vm
vm
;
if
(
virtTestLoadFile
(
xml
,
&
xmlPtr
,
MAX_FILE
)
<
0
)
goto
fail
;
if
(
!
(
vmdef
=
qemudParseVMDef
(
NULL
,
&
driver
,
xmlData
,
"test"
)))
goto
fail
;
vm
.
def
=
vmdef
;
vm
.
pid
=
-
1
;
vm
.
id
=
-
1
;
vmdef
->
vncActivePort
=
vmdef
->
vncPort
;
if
(
!
(
actual
=
qemudGenerateXML
(
NULL
,
&
driver
,
&
vm
,
vmdef
,
0
)))
goto
fail
;
if
(
strcmp
(
xmlData
,
actual
))
{
if
(
getenv
(
"DEBUG_TESTS"
))
{
printf
(
"Expect %4d '%s'
\n
"
,
(
int
)
strlen
(
xmlData
),
xmlData
);
printf
(
"Actual %4d '%s'
\n
"
,
(
int
)
strlen
(
actual
),
actual
);
}
goto
fail
;
}
ret
=
0
;
fail:
free
(
actual
);
return
ret
;
}
static
int
testCompareXMLToXMLHelper
(
const
void
*
data
)
{
char
xml
[
PATH_MAX
];
snprintf
(
xml
,
PATH_MAX
,
"qemuxml2argvdata/qemuxml2argv-%s.xml"
,
(
const
char
*
)
data
);
return
testCompareXMLToXMLFiles
(
xml
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
ret
=
0
;
progname
=
argv
[
0
];
if
(
argc
>
1
)
{
fprintf
(
stderr
,
"Usage: %s
\n
"
,
progname
);
exit
(
EXIT_FAILURE
);
}
driver
.
qemuVersion
=
0
*
1000
*
100
+
(
8
*
1000
)
+
1
;
driver
.
qemuCmdFlags
=
QEMUD_CMD_FLAG_VNC_COLON
|
QEMUD_CMD_FLAG_NO_REBOOT
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV minimal"
,
1
,
testCompareXMLToXMLHelper
,
"minimal"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Boot CDROM"
,
1
,
testCompareXMLToXMLHelper
,
"boot-cdrom"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Boot Network"
,
1
,
testCompareXMLToXMLHelper
,
"boot-network"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Boot Floppy"
,
1
,
testCompareXMLToXMLHelper
,
"boot-floppy"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Clock UTC"
,
1
,
testCompareXMLToXMLHelper
,
"clock-utc"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Clock Localtime"
,
1
,
testCompareXMLToXMLHelper
,
"clock-localtime"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Disk CDROM"
,
1
,
testCompareXMLToXMLHelper
,
"disk-cdrom"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Disk Floppy"
,
1
,
testCompareXMLToXMLHelper
,
"disk-floppy"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Disk Many"
,
1
,
testCompareXMLToXMLHelper
,
"disk-many"
)
<
0
)
ret
=
-
1
;
if
(
0
&&
virtTestRun
(
"QEMU XML-2-ARGV Graphics VNC"
,
1
,
testCompareXMLToXMLHelper
,
"graphics-vnc"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Graphics SDL"
,
1
,
testCompareXMLToXMLHelper
,
"graphics-sdl"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Input USB Mouse"
,
1
,
testCompareXMLToXMLHelper
,
"input-usbmouse"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Input USB Tablet"
,
1
,
testCompareXMLToXMLHelper
,
"input-usbtablet"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Misc ACPI"
,
1
,
testCompareXMLToXMLHelper
,
"misc-acpi"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Misc No Reboot"
,
1
,
testCompareXMLToXMLHelper
,
"misc-no-reboot"
)
<
0
)
ret
=
-
1
;
if
(
virtTestRun
(
"QEMU XML-2-ARGV Net User"
,
1
,
testCompareXMLToXMLHelper
,
"net-user"
)
<
0
)
ret
=
-
1
;
exit
(
ret
==
0
?
EXIT_SUCCESS
:
EXIT_FAILURE
);
}
/*
* Local variables:
* indent-tabs-mode: nil
* c-indent-level: 4
* c-basic-offset: 4
* tab-width: 4
* End:
*/
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录