diff --git a/tests/libtest.sh b/tests/libtest.sh index 2a97d78cd..592d16c4f 100644 --- a/tests/libtest.sh +++ b/tests/libtest.sh @@ -631,6 +631,12 @@ skip_without_libsystemd () { fi } +skip_without_seccomp () { + if [ "${HAVE_SECCOMP:-0}" != "1" ]; then + skip "seccomp support disabled" + fi +} + FLATPAK_SYSTEM_CERTS_D=$(pwd)/certs.d export FLATPAK_SYSTEM_CERTS_D diff --git a/tests/meson.build b/tests/meson.build index b5367f490..a0942df37 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -30,6 +30,7 @@ tests_environment = { 'G_TEST_SRCDIR' : meson.current_source_dir(), 'FLATPAK_BWRAP' : env_flatpak_bwrap, 'FLATPAK_DBUSPROXY' : env_flatpak_dbusproxy, + 'HAVE_SECCOMP' : libseccomp_dep.found() ? '1' : '0', } tests_environment_prepend = { diff --git a/tests/test-seccomp.sh b/tests/test-seccomp.sh index be6fb085d..bdd08d70f 100755 --- a/tests/test-seccomp.sh +++ b/tests/test-seccomp.sh @@ -6,6 +6,7 @@ set -euo pipefail . $(dirname $0)/libtest.sh +skip_without_seccomp skip_without_bwrap echo "1..18"