forked from Mirrors/flatpak-builder
tests: skip running flatpak at build time if bwrap doesn't work
Distribution autobuilders are often more locked-down than the environment in which the distribution binaries actually run. Signed-off-by: Simon McVittie <smcv@debian.org>tingping/wmclass
parent
d6b1c9ff3c
commit
d4738cca16
|
@ -192,6 +192,17 @@ run_sh () {
|
|||
${CMD_PREFIX} flatpak run --command=bash ${ARGS-} org.test.Hello -c "$*"
|
||||
}
|
||||
|
||||
skip_without_bwrap () {
|
||||
if [ -z "${FLATPAK_BWRAP:-}" ]; then
|
||||
# running installed-tests: assume we know what we're doing
|
||||
:
|
||||
elif ! "$FLATPAK_BWRAP" --ro-bind / / /bin/true > bwrap-result 2>&1; then
|
||||
sed -e 's/^/# /' < bwrap-result
|
||||
echo "1..0 # SKIP Cannot run bwrap"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
sed s#@testdir@#${test_builddir}# ${test_srcdir}/session.conf.in > session.conf
|
||||
eval `dbus-launch --config-file=session.conf --sh-syntax`
|
||||
|
||||
|
|
|
@ -21,6 +21,8 @@ set -euo pipefail
|
|||
|
||||
. $(dirname $0)/libtest.sh
|
||||
|
||||
skip_without_bwrap
|
||||
|
||||
echo "1..3"
|
||||
|
||||
setup_repo
|
||||
|
|
|
@ -21,6 +21,8 @@ set -euo pipefail
|
|||
|
||||
. $(dirname $0)/libtest.sh
|
||||
|
||||
skip_without_bwrap
|
||||
|
||||
echo "1..7"
|
||||
|
||||
setup_repo
|
||||
|
|
Loading…
Reference in New Issue