diff --git a/tests/mktree.fedora b/tests/mktree.fedora index 98d7d71007..f5932360a4 100755 --- a/tests/mktree.fedora +++ b/tests/mktree.fedora @@ -70,10 +70,14 @@ dnf() mount_tree() { + local dir=$SANDBOX_DIR + if [ "$1" == "--read-only" ]; then + unset dir + fi source ./atlocal RPMTREE=$INST_DIR:$BASE_DIR - RPMTEST=${1:-$SANDBOX_DIR}/tree - snapshot mount $1 + RPMTEST=$SANDBOX_DIR/tree + snapshot mount $dir } clean_up() @@ -170,7 +174,7 @@ case $CMD in ;; atshell) set -a - mount_tree $SANDBOX_DIR + mount_tree export CACHE_DIR export BASE_DIR=$RPMTEST @@ -180,11 +184,11 @@ case $CMD in $SHELL ;; shell) - mount_tree $SANDBOX_DIR + mount_tree snapshot shell "$@" ;; check) - mount_tree + mount_tree --read-only snapshot exec --tmpfs /tmp --bind $PWD $PWD --setenv RPMTREE $RPMTREE \ sh -c 'cd '$PWD' && exec ./rpmtests "$@"' rpmtests "$@" ;;