]> git.proxmox.com Git - mirror_lxc.git/commitdiff
tests: fix parse_config_file seccomp test
authorMagali Lemes <magali.lemes@canonical.com>
Mon, 15 May 2023 23:31:37 +0000 (20:31 -0300)
committerMagali Lemes <magali.lemes@canonical.com>
Mon, 15 May 2023 23:31:37 +0000 (20:31 -0300)
Link: https://bugs.launchpad.net/ubuntu-kernel-tests/+bug/1980218
Check if seccomp is enabled before throwing error.

Signed-off-by: Magali Lemes <magali.lemes@canonical.com>
src/tests/parse_config_file.c

index 1444799ca0dd059dacd362c400a8cfdabbd539a2..ac4a9419b782ce0e4dfe75a2aaced591a0e3e3e4 100644 (file)
@@ -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;
        }