]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tests: fix config file tests 3969/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 13 Sep 2021 12:11:05 +0000 (14:11 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 13 Sep 2021 12:11:05 +0000 (14:11 +0200)
Link: https://bugs.launchpad.net/bugs/1943441
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/tests/get_item.c
src/tests/parse_config_file.c

index 11db5f6738fb294bbf14fb7005467aa26eb4015f..a30c99a8181da8274985a88b73bed3e671fb8bf0 100644 (file)
@@ -402,6 +402,7 @@ int main(int argc, char *argv[])
        }
        printf("lxc.proc returned %d %s\n", ret, v3);
 
+#if HAVE_APPARMOR
        if (!c->set_config_item(c, "lxc.apparmor.profile", "unconfined")) {
                fprintf(stderr, "%d: failed to set aa_profile\n", __LINE__);
                goto out;
@@ -413,6 +414,7 @@ int main(int argc, char *argv[])
                goto out;
        }
        printf("lxc.aa_profile returned %d %s\n", ret, v2);
+#endif
 
        lxc_container_put(c);
 
index 7671f49bd8e0c8bb24eff9363038cb72c268dd9c..8e7731fe30cec7efdc776ca751eeea93511f40c1 100644 (file)
@@ -368,6 +368,7 @@ int main(int argc, char *argv[])
                goto non_test_error;
        }
 
+#if HAVE_APPARMOR
        if (set_get_compare_clear_save_load(c, "lxc.apparmor.profile", "unconfined", tmpf, true) < 0) {
                lxc_error("%s\n", "lxc.apparmor.profile");
                goto non_test_error;
@@ -377,11 +378,14 @@ int main(int argc, char *argv[])
                lxc_error("%s\n", "lxc.apparmor.allow_incomplete");
                goto non_test_error;
        }
+#endif
 
+#if HAVE_SELINUX
        if (set_get_compare_clear_save_load(c, "lxc.selinux.context", "system_u:system_r:lxc_t:s0:c22", tmpf, true) < 0) {
                lxc_error("%s\n", "lxc.selinux.context");
                goto non_test_error;
        }
+#endif
 
        if (set_get_compare_clear_save_load(c, "lxc.cgroup.cpuset.cpus",
                                            "1-100", tmpf, false) < 0) {