mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
tests: Add several net model passthrough tests
Examples of passing unknown strings through <interface> <model type=X/> Acked-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
5f18cd03af
commit
c800e29b87
43
tests/qemuxml2argvdata/net-many-models.args
Normal file
43
tests/qemuxml2argvdata/net-many-models.args
Normal file
@ -0,0 +1,43 @@
|
||||
LC_ALL=C \
|
||||
PATH=/bin \
|
||||
HOME=/tmp/lib/domain--1-QEMUGuest1 \
|
||||
USER=test \
|
||||
LOGNAME=test \
|
||||
XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
|
||||
XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
|
||||
XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
|
||||
QEMU_AUDIO_DRV=none \
|
||||
/usr/bin/qemu-system-i686 \
|
||||
-name QEMUGuest1 \
|
||||
-S \
|
||||
-machine pc,accel=tcg,usb=off,dump-guest-core=off \
|
||||
-m 214 \
|
||||
-realtime mlock=off \
|
||||
-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 \
|
||||
-netdev user,id=hostnet0 \
|
||||
-device idontexist,netdev=hostnet0,id=net0,mac=00:11:22:33:44:55,bus=pci.0,\
|
||||
addr=0x3 \
|
||||
-netdev user,id=hostnet1 \
|
||||
-device vmxnet3,netdev=hostnet1,id=net1,mac=00:11:22:33:44:56,bus=pci.0,\
|
||||
addr=0x4 \
|
||||
-netdev user,id=hostnet2 \
|
||||
-device netfront,netdev=hostnet2,id=net2,mac=00:11:22:33:44:57,bus=pci.0,\
|
||||
addr=0x5 \
|
||||
-netdev user,id=hostnet3 \
|
||||
-device virtio-net-pci,netdev=hostnet3,id=net3,mac=00:11:22:33:44:58,bus=pci.0,\
|
||||
addr=0x6 \
|
||||
-netdev user,id=hostnet4 \
|
||||
-device ne2k_pci,netdev=hostnet4,id=net4,mac=00:11:22:33:44:58,bus=pci.0,\
|
||||
addr=0x7 \
|
||||
-netdev user,id=hostnet5 \
|
||||
-device pcnet,netdev=hostnet5,id=net5,mac=00:11:22:33:44:58,bus=pci.0,addr=0x8
|
37
tests/qemuxml2argvdata/net-many-models.xml
Normal file
37
tests/qemuxml2argvdata/net-many-models.xml
Normal file
@ -0,0 +1,37 @@
|
||||
<domain type='qemu'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory unit='KiB'>219136</memory>
|
||||
<os>
|
||||
<type arch='i686' machine='pc'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<devices>
|
||||
<interface type='user'>
|
||||
<mac address='00:11:22:33:44:55'/>
|
||||
<model type='idontexist'/>
|
||||
</interface>
|
||||
<interface type='user'>
|
||||
<mac address='00:11:22:33:44:56'/>
|
||||
<model type='vmxnet3'/>
|
||||
</interface>
|
||||
<interface type='user'>
|
||||
<mac address='00:11:22:33:44:57'/>
|
||||
<model type='netfront'/>
|
||||
</interface>
|
||||
<interface type='user'>
|
||||
<mac address='00:11:22:33:44:58'/>
|
||||
<model type='virtio'/>
|
||||
</interface>
|
||||
<interface type='user'>
|
||||
<mac address='00:11:22:33:44:58'/>
|
||||
<model type='ne2k_pci'/>
|
||||
</interface>
|
||||
<interface type='user'>
|
||||
<mac address='00:11:22:33:44:58'/>
|
||||
<model type='pcnet'/>
|
||||
</interface>
|
||||
<controller type='usb' index='0' model='none'/>
|
||||
<memballoon model='none'/>
|
||||
</devices>
|
||||
</domain>
|
@ -1268,6 +1268,7 @@ mymain(void)
|
||||
DO_TEST("net-eth-hostip", NONE);
|
||||
DO_TEST("net-client", NONE);
|
||||
DO_TEST("net-server", NONE);
|
||||
DO_TEST("net-many-models", NONE);
|
||||
DO_TEST("net-mcast", NONE);
|
||||
DO_TEST("net-udp", NONE);
|
||||
DO_TEST("net-hostdev", NONE);
|
||||
|
53
tests/qemuxml2xmloutdata/net-many-models.xml
Normal file
53
tests/qemuxml2xmloutdata/net-many-models.xml
Normal file
@ -0,0 +1,53 @@
|
||||
<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>
|
||||
<controller type='usb' index='0' model='none'/>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<interface type='user'>
|
||||
<mac address='00:11:22:33:44:55'/>
|
||||
<model type='idontexist'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||
</interface>
|
||||
<interface type='user'>
|
||||
<mac address='00:11:22:33:44:56'/>
|
||||
<model type='vmxnet3'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
||||
</interface>
|
||||
<interface type='user'>
|
||||
<mac address='00:11:22:33:44:57'/>
|
||||
<model type='netfront'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
|
||||
</interface>
|
||||
<interface type='user'>
|
||||
<mac address='00:11:22:33:44:58'/>
|
||||
<model type='virtio'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
|
||||
</interface>
|
||||
<interface type='user'>
|
||||
<mac address='00:11:22:33:44:58'/>
|
||||
<model type='ne2k_pci'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
|
||||
</interface>
|
||||
<interface type='user'>
|
||||
<mac address='00:11:22:33:44:58'/>
|
||||
<model type='pcnet'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
||||
</interface>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<input type='keyboard' bus='ps2'/>
|
||||
<memballoon model='none'/>
|
||||
</devices>
|
||||
</domain>
|
@ -408,6 +408,7 @@ mymain(void)
|
||||
DO_TEST("net-bandwidth2", NONE);
|
||||
DO_TEST("net-mtu", NONE);
|
||||
DO_TEST("net-coalesce", NONE);
|
||||
DO_TEST("net-many-models", NONE);
|
||||
|
||||
DO_TEST("serial-tcp-tlsx509-chardev", NONE);
|
||||
DO_TEST("serial-tcp-tlsx509-chardev-notls", NONE);
|
||||
|
24
tests/xlconfigdata/test-net-fakemodel.cfg
Normal file
24
tests/xlconfigdata/test-net-fakemodel.cfg
Normal file
@ -0,0 +1,24 @@
|
||||
name = "XenGuest2"
|
||||
uuid = "c7a5fdb2-cdaf-9455-926a-d65c16db1809"
|
||||
maxmem = 579
|
||||
memory = 394
|
||||
vcpus = 1
|
||||
pae = 1
|
||||
acpi = 1
|
||||
apic = 1
|
||||
viridian = 0
|
||||
rtc_timeoffset = 0
|
||||
localtime = 0
|
||||
on_poweroff = "destroy"
|
||||
on_reboot = "restart"
|
||||
on_crash = "restart"
|
||||
device_model = "/usr/lib/xen/bin/qemu-system-i386"
|
||||
sdl = 0
|
||||
vnc = 1
|
||||
vncunused = 1
|
||||
vnclisten = "127.0.0.1"
|
||||
vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=fakemodel" ]
|
||||
parallel = "none"
|
||||
serial = "none"
|
||||
builder = "hvm"
|
||||
boot = "d"
|
40
tests/xlconfigdata/test-net-fakemodel.xml
Normal file
40
tests/xlconfigdata/test-net-fakemodel.xml
Normal file
@ -0,0 +1,40 @@
|
||||
<domain type='xen'>
|
||||
<name>XenGuest2</name>
|
||||
<uuid>c7a5fdb2-cdaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory unit='KiB'>592896</memory>
|
||||
<currentMemory unit='KiB'>403456</currentMemory>
|
||||
<vcpu placement='static'>1</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64' machine='xenfv'>hvm</type>
|
||||
<loader type='rom'>/usr/lib/xen/boot/hvmloader</loader>
|
||||
<boot dev='cdrom'/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
</features>
|
||||
<clock offset='variable' adjustment='0' basis='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>restart</on_crash>
|
||||
<devices>
|
||||
<emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
|
||||
<controller type='xenbus' index='0'/>
|
||||
<interface type='bridge'>
|
||||
<mac address='00:16:3e:66:92:9c'/>
|
||||
<source bridge='xenbr1'/>
|
||||
<script path='vif-bridge'/>
|
||||
<model type='fakemodel'/>
|
||||
</interface>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<input type='keyboard' bus='ps2'/>
|
||||
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'>
|
||||
<listen type='address' address='127.0.0.1'/>
|
||||
</graphics>
|
||||
<video>
|
||||
<model type='cirrus' vram='8192' heads='1' primary='yes'/>
|
||||
</video>
|
||||
<memballoon model='xen'/>
|
||||
</devices>
|
||||
</domain>
|
@ -259,6 +259,7 @@ mymain(void)
|
||||
#ifdef LIBXL_HAVE_QED
|
||||
DO_TEST_FORMAT("disk-qed", false);
|
||||
#endif
|
||||
DO_TEST("net-fakemodel");
|
||||
DO_TEST("spice");
|
||||
DO_TEST("spice-features");
|
||||
DO_TEST("vif-rate");
|
||||
|
13
tests/xmconfigdata/test-paravirt-net-fakemodel.cfg
Normal file
13
tests/xmconfigdata/test-paravirt-net-fakemodel.cfg
Normal file
@ -0,0 +1,13 @@
|
||||
name = "XenGuest1"
|
||||
uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
|
||||
maxmem = 579
|
||||
memory = 394
|
||||
vcpus = 1
|
||||
localtime = 0
|
||||
on_poweroff = "destroy"
|
||||
on_reboot = "restart"
|
||||
on_crash = "restart"
|
||||
vfb = [ "type=vnc,vncunused=1,vnclisten=127.0.0.1,vncpasswd=123poi" ]
|
||||
vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge,model=fakemodel" ]
|
||||
bootloader = "/usr/bin/pygrub"
|
||||
disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
|
41
tests/xmconfigdata/test-paravirt-net-fakemodel.xml
Normal file
41
tests/xmconfigdata/test-paravirt-net-fakemodel.xml
Normal file
@ -0,0 +1,41 @@
|
||||
<domain type='xen'>
|
||||
<name>XenGuest1</name>
|
||||
<uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory unit='KiB'>592896</memory>
|
||||
<currentMemory unit='KiB'>403456</currentMemory>
|
||||
<vcpu placement='static'>1</vcpu>
|
||||
<bootloader>/usr/bin/pygrub</bootloader>
|
||||
<os>
|
||||
<type arch='x86_64' machine='xenpv'>linux</type>
|
||||
</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>
|
||||
<controller type='xenbus' index='0'/>
|
||||
<interface type='bridge'>
|
||||
<mac address='00:16:3e:66:94:9c'/>
|
||||
<source bridge='br0'/>
|
||||
<script path='vif-bridge'/>
|
||||
<model type='fakemodel'/>
|
||||
</interface>
|
||||
<console type='pty'>
|
||||
<target type='xen' port='0'/>
|
||||
</console>
|
||||
<input type='mouse' bus='xen'/>
|
||||
<input type='keyboard' bus='xen'/>
|
||||
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'>
|
||||
<listen type='address' address='127.0.0.1'/>
|
||||
</graphics>
|
||||
<video>
|
||||
<model type='xen' vram='4096' heads='1' primary='yes'/>
|
||||
</video>
|
||||
<memballoon model='xen'/>
|
||||
</devices>
|
||||
</domain>
|
13
tests/xmconfigdata/test-paravirt-net-modelstr.cfg
Normal file
13
tests/xmconfigdata/test-paravirt-net-modelstr.cfg
Normal file
@ -0,0 +1,13 @@
|
||||
name = "XenGuest1"
|
||||
uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
|
||||
maxmem = 579
|
||||
memory = 394
|
||||
vcpus = 1
|
||||
localtime = 0
|
||||
on_poweroff = "destroy"
|
||||
on_reboot = "restart"
|
||||
on_crash = "restart"
|
||||
vfb = [ "type=vnc,vncunused=1,vnclisten=127.0.0.1,vncpasswd=123poi" ]
|
||||
vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge,model=fakemodel" ]
|
||||
bootloader = "/usr/bin/pygrub"
|
||||
disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
|
@ -193,6 +193,7 @@ mymain(void)
|
||||
DO_TEST("paravirt-new-pvfb");
|
||||
DO_TEST("paravirt-new-pvfb-vncdisplay");
|
||||
DO_TEST("paravirt-net-e1000");
|
||||
DO_TEST("paravirt-net-fakemodel");
|
||||
DO_TEST("paravirt-net-vifname");
|
||||
DO_TEST("paravirt-vcpu");
|
||||
DO_TEST("paravirt-maxvcpus");
|
||||
|
1
tests/xml2sexprdata/xml2sexpr-fv-net-many-models.sexpr
Normal file
1
tests/xml2sexprdata/xml2sexpr-fv-net-many-models.sexpr
Normal file
@ -0,0 +1 @@
|
||||
(vm (name 'fvtest')(memory 400)(maxmem 400)(vcpus 1)(uuid 'b5d70dd2-75cd-aca5-1776-9660b059d8bc')(on_poweroff 'destroy')(on_reboot 'restart')(on_crash 'destroy')(image (hvm (kernel '/usr/lib/xen/boot/hvmloader')(vcpus 1)(boot c)(pae 1)(usb 1)(parallel none)(serial none)(device_model '/usr/lib64/xen/bin/qemu-dm')(rtc_timeoffset 0)(localtime 0)))(localtime 0)(device (vif (mac '00:11:22:33:44:55')(bridge 'xenbr0')(script 'vif-bridge')(model 'idontexist')))(device (vif (mac '00:11:22:33:44:56')(bridge 'xenbr0')(script 'vif-bridge')(model 'vmxnet3')))(device (vif (mac '00:11:22:33:44:57')(bridge 'xenbr0')(script 'vif-bridge')(type netfront)))(device (vif (mac '00:11:22:33:44:58')(bridge 'xenbr0')(script 'vif-bridge')(model 'virtio')))(device (vif (mac '00:11:22:33:44:58')(bridge 'xenbr0')(script 'vif-bridge')(model 'ne2k_pci')))(device (vif (mac '00:11:22:33:44:58')(bridge 'xenbr0')(script 'vif-bridge')(model 'pcnet'))))
|
43
tests/xml2sexprdata/xml2sexpr-fv-net-many-models.xml
Normal file
43
tests/xml2sexprdata/xml2sexpr-fv-net-many-models.xml
Normal file
@ -0,0 +1,43 @@
|
||||
<domain type='xen'>
|
||||
<name>fvtest</name>
|
||||
<uuid>b5d70dd275cdaca517769660b059d8bc</uuid>
|
||||
<memory unit='KiB'>409600</memory>
|
||||
<os>
|
||||
<type>hvm</type>
|
||||
<loader>/usr/lib/xen/boot/hvmloader</loader>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<devices>
|
||||
<emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
|
||||
<interface type='bridge'>
|
||||
<source bridge='xenbr0'/>
|
||||
<mac address='00:11:22:33:44:55'/>
|
||||
<model type='idontexist'/>
|
||||
</interface>
|
||||
<interface type='bridge'>
|
||||
<source bridge='xenbr0'/>
|
||||
<mac address='00:11:22:33:44:56'/>
|
||||
<model type='vmxnet3'/>
|
||||
</interface>
|
||||
<interface type='bridge'>
|
||||
<source bridge='xenbr0'/>
|
||||
<mac address='00:11:22:33:44:57'/>
|
||||
<model type='netfront'/>
|
||||
</interface>
|
||||
<interface type='bridge'>
|
||||
<source bridge='xenbr0'/>
|
||||
<mac address='00:11:22:33:44:58'/>
|
||||
<model type='virtio'/>
|
||||
</interface>
|
||||
<interface type='bridge'>
|
||||
<source bridge='xenbr0'/>
|
||||
<mac address='00:11:22:33:44:58'/>
|
||||
<model type='ne2k_pci'/>
|
||||
</interface>
|
||||
<interface type='bridge'>
|
||||
<source bridge='xenbr0'/>
|
||||
<mac address='00:11:22:33:44:58'/>
|
||||
<model type='pcnet'/>
|
||||
</interface>
|
||||
</devices>
|
||||
</domain>
|
@ -151,6 +151,7 @@ mymain(void)
|
||||
|
||||
DO_TEST("fv-sound", "fv-sound", "fvtest");
|
||||
|
||||
DO_TEST("fv-net-many-models", "fv-net-many-models", "fvtest");
|
||||
DO_TEST("fv-net-netfront", "fv-net-netfront", "fvtest");
|
||||
DO_TEST("fv-net-rate", "fv-net-rate", "fvtest");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user