From 2bc57d15f4c76a907484d8713503e480ccf8e973 Mon Sep 17 00:00:00 2001 From: Michal Domonkos Date: Tue, 10 Oct 2023 09:13:38 +0200 Subject: [PATCH] Add --read-only argument to mount_tree Make it more obvious when the tree is mounted as read-only. No functional change. --- tests/mktree.fedora | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 "$@" ;;