From: Christian Brauner Date: Mon, 13 Sep 2021 12:11:05 +0000 (+0200) Subject: tests: fix config file tests X-Git-Tag: lxc-4.0.11~235^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3969%2Fhead;p=thirdparty%2Flxc.git tests: fix config file tests Link: https://bugs.launchpad.net/bugs/1943441 Signed-off-by: Christian Brauner --- diff --git a/src/tests/get_item.c b/src/tests/get_item.c index 11db5f673..a30c99a81 100644 --- a/src/tests/get_item.c +++ b/src/tests/get_item.c @@ -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); diff --git a/src/tests/parse_config_file.c b/src/tests/parse_config_file.c index 7671f49bd..8e7731fe3 100644 --- a/src/tests/parse_config_file.c +++ b/src/tests/parse_config_file.c @@ -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) {