]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/tests/parse_config_file.c
tests: use busybox in lxc-test-unpriv
[mirror_lxc.git] / src / tests / parse_config_file.c
index bc68ae24cca81ed9ebfeb7bd7a77fa064bb68fdd..8b5b1b0d295079f636067b8cb0d40554c65f218b 100644 (file)
@@ -560,6 +560,11 @@ int main(int argc, char *argv[])
                goto non_test_error;
        }
 
+       if (set_get_compare_clear_save_load(c, "lxc.autodev.tmpfs.size", "1", tmpf, true) < 0) {
+               lxc_error("%s\n", "lxc.autodev.tmpfs.size");
+               goto non_test_error;
+       }
+
        if (set_get_compare_clear_save_load(c, "lxc.autodev", "1", tmpf, true) <
            0) {
                lxc_error("%s\n", "lxc.autodev");
@@ -771,6 +776,21 @@ int main(int argc, char *argv[])
                return -1;
        }
 
+       if (set_get_compare_clear_save_load_network(c, "lxc.net.0.veth.vlan.id", "none", tmpf, false, "veth")) {
+               lxc_error("%s\n", "lxc.net.0.veth.vlan.id");
+               return -1;
+       }
+
+       if (set_get_compare_clear_save_load_network(c, "lxc.net.0.veth.vlan.id", "2", tmpf, true, "veth")) {
+               lxc_error("%s\n", "lxc.net.0.veth.vlan.id");
+               return -1;
+       }
+
+       if (set_get_compare_clear_save_load_network(c, "lxc.net.0.veth.vlan.tagged.id", "2", tmpf, true, "veth")) {
+               lxc_error("%s\n", "lxc.net.0.veth.vlan.tagged.id");
+               return -1;
+       }
+
        if (set_get_compare_clear_save_load(c, "lxc.net.0.script.up", "/some/up/path", tmpf, true)) {
                lxc_error("%s\n", "lxc.net.0.script.up");
                goto non_test_error;
@@ -857,15 +877,13 @@ int main(int argc, char *argv[])
                goto non_test_error;
        }
 
-       ret = set_get_compare_clear_save_load(c, "lxc.hook.version", "2", tmpf, true);
-       if (ret == 0) {
-               lxc_error("%s\n", "lxc.hook.version");
+       if (c->set_config_item(c, "lxc.hook.version", "2")) {
+               lxc_error("%s\n", "Managed to set to set invalid config item \"lxc.hook.version\" to \"2\"");
                goto non_test_error;
        }
 
-       ret = set_get_compare_clear_save_load(c, "lxc.monitor.signal.pdeath", "SIGKILL", tmpf, true);
-       if (ret == 0) {
-               lxc_error("%s\n", "lxc.hook.version");
+       if (!c->set_config_item(c, "lxc.monitor.signal.pdeath", "SIGKILL")) {
+               lxc_error("%s\n", "Failed to set to set invalid config item \"lxc.monitor.signal.pdeath\" to \"SIGKILL\"");
                goto non_test_error;
        }
 
@@ -879,6 +897,16 @@ int main(int argc, char *argv[])
                return -1;
        }
 
+       if (c->set_config_item(c, "lxc.log.file=", "./")) {
+               lxc_error("%s\n", "Managed to set to set invalid config item \"lxc.log.file\" to \"./\"");
+               return -1;
+       }
+
+       if (c->set_config_item(c, "lxc.hook.versionasdfsadfsadf", "1")) {
+               lxc_error("%s\n", "Managed to set to set invalid config item \"lxc.hook.versionasdfsadfsadf\" to \"2\"");
+               goto non_test_error;
+       }
+
        fret = EXIT_SUCCESS;
 
 non_test_error: