[libvirt] [PATCHv6 7/7] Add tests for blkdeviotune

Daniel Veillard veillard at redhat.com
Thu Nov 24 08:31:28 UTC 2011


On Wed, Nov 23, 2011 at 02:44:49PM -0700, Eric Blake wrote:
> From: Lei Li <lilei at linux.vnet.ibm.com>
> 
> Signed-off-by: Lei Li <lilei at linux.vnet.ibm.com>
> Signed-off-by: Zhi Yong Wu <wuzhy at linux.vnet.ibm.com>
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  .../qemuxml2argv-blkdeviotune.args                 |    7 ++++
>  .../qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml |   30 ++++++++++++++++++++
>  tests/qemuxml2argvtest.c                           |    2 +
>  tests/qemuxml2xmltest.c                            |    1 +
>  4 files changed, 40 insertions(+), 0 deletions(-)
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
>  create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
> 
> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
> new file mode 100644
> index 0000000..9615290
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.args
> @@ -0,0 +1,7 @@
> +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test /usr/bin/qemu -S -M \
> +pc -m 214 -smp 1 -name QEMUGuest1 -nographic -nodefaults \
> +-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \
> +-drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-ide0-0-0,cache=off,\
> +bps=5000,iops=6000 -device \
> +ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -usb \
> +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
> new file mode 100644
> index 0000000..48553e4
> --- /dev/null
> +++ b/tests/qemuxml2argvdata/qemuxml2argv-blkdeviotune.xml
> @@ -0,0 +1,30 @@
> +<domain type='qemu'>
> +  <name>QEMUGuest1</name>
> +  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
> +  <memory>219100</memory>
> +  <currentMemory>219100</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'>
> +      <driver name='qemu' type='qcow2' cache='none'/>
> +      <source dev='/dev/HostVG/QEMUGuest1'/>
> +      <target dev='hda' bus='ide'/>
> +      <iotune>
> +        <total_bytes_sec>5000</total_bytes_sec>
> +        <total_iops_sec>6000</total_iops_sec>
> +      </iotune>
> +      <address type='drive' controller='0' bus='0' unit='0'/>
> +    </disk>
> +    <controller type='ide' index='0'/>
> +    <memballoon model='virtio'/>
> +  </devices>
> +</domain>
> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
> index fe24354..40ce00c 100644
> --- a/tests/qemuxml2argvtest.c
> +++ b/tests/qemuxml2argvtest.c
> @@ -645,6 +645,8 @@ mymain(void)
>      DO_TEST("blkiotune", false, QEMU_CAPS_NAME);
>      DO_TEST("cputune", false, QEMU_CAPS_NAME);
>      DO_TEST("numatune-memory", false, NONE);
> +    DO_TEST("blkdeviotune", false, QEMU_CAPS_NAME, QEMU_CAPS_DEVICE,
> +            QEMU_CAPS_DRIVE);
> 
>      DO_TEST("multifunction-pci-device", false,
>              QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG,
> diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
> index 3f37520..2e6b5c7 100644
> --- a/tests/qemuxml2xmltest.c
> +++ b/tests/qemuxml2xmltest.c
> @@ -191,6 +191,7 @@ mymain(void)
>      DO_TEST("event_idx");
> 
>      DO_TEST("usb-redir");
> +    DO_TEST("blkdeviotune");
> 
>      /* These tests generate different XML */
>      DO_TEST_DIFFERENT("balloon-device-auto");

  ACK, but I would suggest to extend this (or augment the test) to
list 2 <disk> with iotune,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list