Commit 935cfd3e by 0x0916

testcase: define a network before checks

Signed-off-by: 's avatar0x0916 <w@laoqinren.net>
parent ae1dc8b4
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:xx:xx:xx
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx
......@@ -298,6 +298,22 @@ int main(int argc, char *argv[])
}
printf("%d: get_config_item(lxc.network) returned %d %s\n", __LINE__, ret, v2);
if (!c->set_config_item(c, "lxc.network.type", "veth")) {
fprintf(stderr, "%d: failed to set network.type\n", __LINE__);
goto out;
}
if (!c->set_config_item(c, "lxc.network.link", "lxcbr0")) {
fprintf(stderr, "%d: failed to set network.link\n", __LINE__);
goto out;
}
if (!c->set_config_item(c, "lxc.network.flags", "up")) {
fprintf(stderr, "%d: failed to set network.flags\n", __LINE__);
goto out;
}
if (!c->set_config_item(c, "lxc.network.hwaddr", "00:16:3e:xx:xx:xx")) {
fprintf(stderr, "%d: failed to set network.hwaddr\n", __LINE__);
goto out;
}
if (!c->set_config_item(c, "lxc.network.ipv4", "10.2.3.4")) {
fprintf(stderr, "%d: failed to set ipv4\n", __LINE__);
goto out;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment