From: Magali Lemes Date: Mon, 15 May 2023 23:31:37 +0000 (-0300) Subject: tests: fix parse_config_file seccomp test X-Git-Tag: v6.0.0~55^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=8575ffeb7fc04b96e1d7bc736afb46670c5f7631;hp=70e42b0f93ae69239b520c1b1eca55be0e1a2a5d;p=mirror_lxc.git tests: fix parse_config_file seccomp test Link: https://bugs.launchpad.net/ubuntu-kernel-tests/+bug/1980218 Check if seccomp is enabled before throwing error. Signed-off-by: Magali Lemes --- diff --git a/src/tests/parse_config_file.c b/src/tests/parse_config_file.c index 1444799ca..ac4a9419b 100644 --- a/src/tests/parse_config_file.c +++ b/src/tests/parse_config_file.c @@ -576,7 +576,14 @@ int main(int argc, char *argv[]) goto non_test_error; } - if (set_get_compare_clear_save_load(c, "lxc.seccomp.profile", "/some/seccomp/file", tmpf, true) < 0) { + ret = set_get_compare_clear_save_load(c, "lxc.seccomp.profile", "/some/seccomp/file", tmpf, true); + +#if HAVE_SECCOMP + if (ret < 0) +#else + if (ret == 0) +#endif + { lxc_error("%s\n", "lxc.seccomp.profile"); goto non_test_error; }