mirror of https://gitee.com/openkylin/libvirt.git
tests: qemu: Unify iscsi disk source testing
Move various different iSCSI configuration into one test file. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
d1c9c6bf74
commit
a717cf2c94
|
@ -1,34 +0,0 @@
|
|||
LC_ALL=C \
|
||||
PATH=/bin \
|
||||
HOME=/home/test \
|
||||
USER=test \
|
||||
LOGNAME=test \
|
||||
QEMU_AUDIO_DRV=none \
|
||||
/usr/bin/qemu-system-i686 \
|
||||
-name QEMUGuest1 \
|
||||
-S \
|
||||
-machine pc,accel=tcg,usb=off,dump-guest-core=off \
|
||||
-m 214 \
|
||||
-smp 1,sockets=1,cores=1,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
-nodefaults \
|
||||
-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
|
||||
server,nowait \
|
||||
-mon chardev=charmonitor,id=monitor,mode=control \
|
||||
-rtc base=utc \
|
||||
-no-shutdown \
|
||||
-no-acpi \
|
||||
-boot c \
|
||||
-usb \
|
||||
-drive file=iscsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@example.org:\
|
||||
6000/iqn.1992-01.com.example%3Astorage/1,format=raw,if=none,\
|
||||
id=drive-virtio-disk0 \
|
||||
-device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,\
|
||||
id=virtio-disk0 \
|
||||
-drive file=iscsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@example.org:\
|
||||
6000/iqn.1992-01.com.example%3Astorage/2,format=raw,if=none,\
|
||||
id=drive-virtio-disk1 \
|
||||
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk1,\
|
||||
id=virtio-disk1
|
|
@ -1,43 +0,0 @@
|
|||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory unit='KiB'>219136</memory>
|
||||
<currentMemory unit='KiB'>219136</currentMemory>
|
||||
<vcpu placement='static'>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-system-i686</emulator>
|
||||
<disk type='network' device='disk'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<auth username='myname'>
|
||||
<secret type='iscsi' usage='mycluster_myname'/>
|
||||
</auth>
|
||||
<source protocol='iscsi' name='iqn.1992-01.com.example:storage/1'>
|
||||
<host name='example.org' port='6000'/>
|
||||
</source>
|
||||
<target dev='vda' bus='virtio'/>
|
||||
</disk>
|
||||
<disk type='network' device='disk'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<auth username='myname'>
|
||||
<secret type='iscsi' usage='mycluster_myname'/>
|
||||
</auth>
|
||||
<source protocol='iscsi' name='iqn.1992-01.com.example:storage/2'>
|
||||
<host name='example.org' port='6000'/>
|
||||
</source>
|
||||
<target dev='vdb' bus='virtio'/>
|
||||
</disk>
|
||||
<controller type='usb' index='0'/>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<input type='keyboard' bus='ps2'/>
|
||||
<memballoon model='none'/>
|
||||
</devices>
|
||||
</domain>
|
|
@ -1,29 +0,0 @@
|
|||
LC_ALL=C \
|
||||
PATH=/bin \
|
||||
HOME=/home/test \
|
||||
USER=test \
|
||||
LOGNAME=test \
|
||||
QEMU_AUDIO_DRV=none \
|
||||
/usr/bin/qemu-system-i686 \
|
||||
-name QEMUGuest1 \
|
||||
-S \
|
||||
-machine pc,accel=tcg,usb=off,dump-guest-core=off \
|
||||
-m 214 \
|
||||
-smp 1,sockets=1,cores=1,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
-nodefaults \
|
||||
-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
|
||||
server,nowait \
|
||||
-mon chardev=charmonitor,id=monitor,mode=control \
|
||||
-rtc base=utc \
|
||||
-no-shutdown \
|
||||
-no-acpi \
|
||||
-boot c \
|
||||
-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \
|
||||
-usb \
|
||||
-drive file=iscsi://example.org:3260/iqn.1992-01.com.example/0,format=raw,\
|
||||
if=none,id=drive-scsi0-0-0-0 \
|
||||
-device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
|
||||
drive=drive-scsi0-0-0-0,id=scsi0-0-0-0
|
|
@ -1,28 +0,0 @@
|
|||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory unit='KiB'>219136</memory>
|
||||
<currentMemory unit='KiB'>219136</currentMemory>
|
||||
<vcpu placement='static'>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-system-i686</emulator>
|
||||
<disk type='network' device='lun'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<source protocol='iscsi' name='iqn.1992-01.com.example'>
|
||||
<host name='example.org' port='3260'/>
|
||||
</source>
|
||||
<target dev='sda' bus='scsi'/>
|
||||
</disk>
|
||||
<controller type='usb' index='0'/>
|
||||
<controller type='scsi' index='0' model='virtio-scsi'/>
|
||||
<memballoon model='none'/>
|
||||
</devices>
|
||||
</domain>
|
|
@ -21,12 +21,27 @@ server,nowait \
|
|||
-no-shutdown \
|
||||
-no-acpi \
|
||||
-boot c \
|
||||
-device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0x3 \
|
||||
-usb \
|
||||
-drive file=iscsi://example.org:6000/iqn.1992-01.com.example/0,format=raw,\
|
||||
if=none,id=drive-virtio-disk0 \
|
||||
-device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,\
|
||||
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\
|
||||
id=virtio-disk0 \
|
||||
-drive file=iscsi://example.org:6000/iqn.1992-01.com.example/1,format=raw,\
|
||||
if=none,id=drive-virtio-disk1 \
|
||||
-device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk1,\
|
||||
id=virtio-disk1
|
||||
-device virtio-blk-pci,bus=pci.0,addr=0x5,drive=drive-virtio-disk1,\
|
||||
id=virtio-disk1 \
|
||||
-drive file=iscsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@example.org:\
|
||||
6000/iqn.1992-01.com.example%3Astorage/1,format=raw,if=none,\
|
||||
id=drive-virtio-disk2 \
|
||||
-device virtio-blk-pci,bus=pci.0,addr=0x6,drive=drive-virtio-disk2,\
|
||||
id=virtio-disk2 \
|
||||
-drive file=iscsi://myname:AQCVn5hO6HzFAhAAq0NCv8jtJcIcE+HOBlMQ1A@example.org:\
|
||||
6000/iqn.1992-01.com.example%3Astorage/2,format=raw,if=none,\
|
||||
id=drive-virtio-disk3 \
|
||||
-device virtio-blk-pci,bus=pci.0,addr=0x7,drive=drive-virtio-disk3,\
|
||||
id=virtio-disk3 \
|
||||
-drive file=iscsi://example.org:3260/iqn.1992-01.com.example/0,format=raw,\
|
||||
if=none,id=drive-scsi0-0-0-0 \
|
||||
-device scsi-block,bus=scsi0.0,channel=0,scsi-id=0,lun=0,\
|
||||
drive=drive-scsi0-0-0-0,id=scsi0-0-0-0
|
||||
|
|
|
@ -28,8 +28,36 @@
|
|||
</source>
|
||||
<target dev='vdb' bus='virtio'/>
|
||||
</disk>
|
||||
<disk type='network' device='disk'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<auth username='myname'>
|
||||
<secret type='iscsi' usage='mycluster_myname'/>
|
||||
</auth>
|
||||
<source protocol='iscsi' name='iqn.1992-01.com.example:storage/1'>
|
||||
<host name='example.org' port='6000'/>
|
||||
</source>
|
||||
<target dev='vdc' bus='virtio'/>
|
||||
</disk>
|
||||
<disk type='network' device='disk'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<auth username='myname'>
|
||||
<secret type='iscsi' usage='mycluster_myname'/>
|
||||
</auth>
|
||||
<source protocol='iscsi' name='iqn.1992-01.com.example:storage/2'>
|
||||
<host name='example.org' port='6000'/>
|
||||
</source>
|
||||
<target dev='vdd' bus='virtio'/>
|
||||
</disk>
|
||||
<disk type='network' device='lun'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<source protocol='iscsi' name='iqn.1992-01.com.example'>
|
||||
<host name='example.org' port='3260'/>
|
||||
</source>
|
||||
<target dev='sda' bus='scsi'/>
|
||||
</disk>
|
||||
<controller type='usb' index='0'/>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<controller type='scsi' index='0' model='virtio-scsi'/>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<input type='keyboard' bus='ps2'/>
|
||||
<memballoon model='none'/>
|
||||
|
|
|
@ -1041,14 +1041,10 @@ mymain(void)
|
|||
DO_TEST("disk-network-nbd-ipv6", NONE);
|
||||
DO_TEST("disk-network-nbd-ipv6-export", NONE);
|
||||
DO_TEST("disk-network-nbd-unix", NONE);
|
||||
DO_TEST("disk-network-iscsi", NONE);
|
||||
DO_TEST("disk-network-iscsi-auth", NONE);
|
||||
DO_TEST("disk-network-iscsi", QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_SCSI_BLOCK);
|
||||
DO_TEST_PARSE_ERROR("disk-network-iscsi-auth-secrettype-invalid", NONE);
|
||||
DO_TEST_PARSE_ERROR("disk-network-iscsi-auth-wrong-secrettype", NONE);
|
||||
DO_TEST_PARSE_ERROR("disk-network-source-auth-both", NONE);
|
||||
DO_TEST("disk-network-iscsi-lun",
|
||||
QEMU_CAPS_VIRTIO_SCSI,
|
||||
QEMU_CAPS_SCSI_BLOCK);
|
||||
DO_TEST("disk-network-gluster",
|
||||
QEMU_CAPS_GLUSTER_DEBUG_LEVEL);
|
||||
DO_TEST("disk-network-rbd", NONE);
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory unit='KiB'>219136</memory>
|
||||
<currentMemory unit='KiB'>219136</currentMemory>
|
||||
<vcpu placement='static'>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-system-i686</emulator>
|
||||
<disk type='network' device='disk'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<auth username='myname'>
|
||||
<secret type='iscsi' usage='mycluster_myname'/>
|
||||
</auth>
|
||||
<source protocol='iscsi' name='iqn.1992-01.com.example:storage/1'>
|
||||
<host name='example.org' port='6000'/>
|
||||
</source>
|
||||
<target dev='vda' bus='virtio'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||
</disk>
|
||||
<disk type='network' device='disk'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<auth username='myname'>
|
||||
<secret type='iscsi' usage='mycluster_myname'/>
|
||||
</auth>
|
||||
<source protocol='iscsi' name='iqn.1992-01.com.example:storage/2'>
|
||||
<host name='example.org' port='6000'/>
|
||||
</source>
|
||||
<target dev='vdb' bus='virtio'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
||||
</disk>
|
||||
<controller type='usb' index='0'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||
</controller>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<input type='keyboard' bus='ps2'/>
|
||||
<memballoon model='none'/>
|
||||
</devices>
|
||||
</domain>
|
|
@ -20,7 +20,7 @@
|
|||
<host name='example.org' port='6000'/>
|
||||
</source>
|
||||
<target dev='vda' bus='virtio'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
||||
</disk>
|
||||
<disk type='network' device='disk'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
|
@ -28,12 +28,45 @@
|
|||
<host name='example.org' port='6000'/>
|
||||
</source>
|
||||
<target dev='vdb' bus='virtio'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
|
||||
</disk>
|
||||
<disk type='network' device='disk'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<auth username='myname'>
|
||||
<secret type='iscsi' usage='mycluster_myname'/>
|
||||
</auth>
|
||||
<source protocol='iscsi' name='iqn.1992-01.com.example:storage/1'>
|
||||
<host name='example.org' port='6000'/>
|
||||
</source>
|
||||
<target dev='vdc' bus='virtio'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
|
||||
</disk>
|
||||
<disk type='network' device='disk'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<auth username='myname'>
|
||||
<secret type='iscsi' usage='mycluster_myname'/>
|
||||
</auth>
|
||||
<source protocol='iscsi' name='iqn.1992-01.com.example:storage/2'>
|
||||
<host name='example.org' port='6000'/>
|
||||
</source>
|
||||
<target dev='vdd' bus='virtio'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
|
||||
</disk>
|
||||
<disk type='network' device='lun'>
|
||||
<driver name='qemu' type='raw'/>
|
||||
<source protocol='iscsi' name='iqn.1992-01.com.example/0'>
|
||||
<host name='example.org' port='3260'/>
|
||||
</source>
|
||||
<target dev='sda' bus='scsi'/>
|
||||
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||
</disk>
|
||||
<controller type='usb' index='0'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||
</controller>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<controller type='scsi' index='0' model='virtio-scsi'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||
</controller>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<input type='keyboard' bus='ps2'/>
|
||||
<memballoon model='none'/>
|
||||
|
|
|
@ -363,8 +363,7 @@ mymain(void)
|
|||
DO_TEST("disk-network-nbd-ipv6", NONE);
|
||||
DO_TEST("disk-network-nbd-ipv6-export", NONE);
|
||||
DO_TEST("disk-network-nbd-unix", NONE);
|
||||
DO_TEST("disk-network-iscsi", NONE);
|
||||
DO_TEST("disk-network-iscsi-auth", NONE);
|
||||
DO_TEST("disk-network-iscsi", QEMU_CAPS_VIRTIO_SCSI);
|
||||
DO_TEST("disk-network-gluster", NONE);
|
||||
DO_TEST("disk-network-rbd", NONE);
|
||||
DO_TEST("disk-network-rbd-auth", NONE);
|
||||
|
|
Loading…
Reference in New Issue