#!/bin/bash # depends on: bwrap, expect cd $(dirname "$0") set -x fail() { set +x echo >&2 echo "Test : $testname failed" >&2 echo "Reason: $@" >&2 echo >&2 exit 2 } clean() { if [ -d "bin" ]; then rm -r bin fi if [ -d "work" ]; then rm -r work fi mkdir bin work cp ../git-repo bin } run() { bwrap \ --ro-bind /bin /bin \ --ro-bind /usr /usr \ --ro-bind /etc /etc \ --ro-bind /lib /lib \ --ro-bind /lib64 /lib64 \ --ro-bind /run /run \ --dev /dev \ --proc /proc \ --ro-bind bin /usr/local/bin \ --bind work /git \ $1 } filemode() { stat --format=%a "$@" } ######################## testname=help clean { cat <