tests: Adding test case to include multiple network definitions.

This commit includes a test case for multiple network definitions. It is
useful right now, but it will be more useful when the index used by LXC
version 3.X is implemented to support this new settings. The version 3.X
is using indexes to specify each network settings.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Julio Faracco 2018-11-30 20:43:37 +08:00 committed by John Ferlan
parent 53762677a8
commit daf4e2abca
4 changed files with 93 additions and 0 deletions

View File

@ -0,0 +1,23 @@
lxc.network.type = phys
lxc.network.link = eth0
lxc.network.name = eth1
lxc.network.ipv4 = 192.168.122.2/24
lxc.network.ipv4.gateway = 192.168.122.1
lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596/64
lxc.network.ipv6.gateway = 2003:db8:1:0:214:1234:fe0b:3595
lxc.network.type = vlan
lxc.network.flags = up
lxc.network.link = eth0
lxc.network.hwaddr = 02:00:15:8f:05:c1
lxc.network.vlan.id = 2
lxc.network.type = macvlan
lxc.network.flags = up
lxc.network.link = eth0
lxc.network.hwaddr = 02:00:15:8f:05:c1
lxc.network.macvlan.mode = vepa
lxc.rootfs = /var/lib/lxc/migrate_test/rootfs
lxc.utsname = migrate_test
lxc.autodev=1

View File

@ -0,0 +1,23 @@
lxc.network.type = phys
lxc.network.link = eth0
lxc.network.name = eth1
lxc.network.ipv4 = 192.168.122.2/24
lxc.network.ipv4.gateway = 192.168.122.1
lxc.network.ipv6 = 2003:db8:1:0:214:1234:fe0b:3596/64
lxc.network.ipv6.gateway = 2003:db8:1:0:214:1234:fe0b:3595
lxc.network.type = vlan
lxc.network.flags = up
lxc.network.link = eth0
lxc.network.hwaddr = 02:00:15:8f:05:c1
lxc.network.vlan.id = 2
lxc.network.type = macvlan
lxc.network.flags = up
lxc.network.link = eth0
lxc.network.hwaddr = 02:00:15:8f:05:c1
lxc.network.macvlan.mode = vepa
lxc.rootfs = /var/lib/lxc/migrate_test/rootfs
lxc.utsname = migrate_test
lxc.autodev=1

View File

@ -0,0 +1,45 @@
<domain type='lxc'>
<name>migrate_test</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>65536</memory>
<currentMemory unit='KiB'>65536</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type>exe</type>
<init>/sbin/init</init>
</os>
<features>
<capabilities policy='allow'>
</capabilities>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/libexec/libvirt_lxc</emulator>
<filesystem type='mount' accessmode='passthrough'>
<source dir='/var/lib/lxc/migrate_test/rootfs'/>
<target dir='/'/>
</filesystem>
<interface type='direct'>
<mac address='02:00:15:8f:05:c1'/>
<source dev='eth0' mode='vepa'/>
<link state='up'/>
</interface>
<hostdev mode='capabilities' type='net'>
<source>
<interface>eth0</interface>
</source>
<ip address='192.168.122.2' family='ipv4' prefix='24'/>
<ip address='2003:db8:1:0:214:1234:fe0b:3596' family='ipv6' prefix='64'/>
<route family='ipv4' address='0.0.0.0' gateway='192.168.122.1'/>
<route family='ipv6' address='::' gateway='2003:db8:1:0:214:1234:fe0b:3595'/>
</hostdev>
<hostdev mode='capabilities' type='net'>
<source>
<interface>eth0.2</interface>
</source>
</hostdev>
</devices>
</domain>

View File

@ -137,6 +137,7 @@ mymain(void)
DO_TEST("physnetwork", false);
DO_TEST("macvlannetwork", false);
DO_TEST("vlannetwork", false);
DO_TEST("miscnetwork", false);
DO_TEST("idmap", false);
DO_TEST("memtune", false);
DO_TEST("cputune", false);
@ -161,6 +162,7 @@ mymain(void)
DO_TEST3("physnetwork", false);
DO_TEST3("macvlannetwork", false);
DO_TEST3("vlannetwork", false);
DO_TEST3("miscnetwork", false);
DO_TEST3("idmap", false);
DO_TEST3("memtune", false);
DO_TEST3("cputune", false);