From daf4e2abca914fd8340d2243e2cb070a43dd7149 Mon Sep 17 00:00:00 2001 From: Julio Faracco Date: Fri, 30 Nov 2018 20:43:37 +0800 Subject: [PATCH] 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 ACKed-by: Michal Privoznik --- .../lxcconf2xml-miscnetwork-v3.config | 23 ++++++++++ .../lxcconf2xml-miscnetwork.config | 23 ++++++++++ .../lxcconf2xml-miscnetwork.xml | 45 +++++++++++++++++++ tests/lxcconf2xmltest.c | 2 + 4 files changed, 93 insertions(+) create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.config create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.xml diff --git a/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config b/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config new file mode 100644 index 0000000000..b46cb3ee7d --- /dev/null +++ b/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork-v3.config @@ -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 diff --git a/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.config b/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.config new file mode 100644 index 0000000000..b46cb3ee7d --- /dev/null +++ b/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.config @@ -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 diff --git a/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.xml b/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.xml new file mode 100644 index 0000000000..63189cfaec --- /dev/null +++ b/tests/lxcconf2xmldata/lxcconf2xml-miscnetwork.xml @@ -0,0 +1,45 @@ + + migrate_test + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 65536 + 65536 + 1 + + exe + /sbin/init + + + + + + + destroy + restart + destroy + + /usr/libexec/libvirt_lxc + + + + + + + + + + + + eth0 + + + + + + + + + eth0.2 + + + + diff --git a/tests/lxcconf2xmltest.c b/tests/lxcconf2xmltest.c index 0766239ec4..2a277042ce 100644 --- a/tests/lxcconf2xmltest.c +++ b/tests/lxcconf2xmltest.c @@ -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); -- 2.47.2