Skip to content

Commit

Permalink
Add --read-only argument to mount_tree
Browse files Browse the repository at this point in the history
Make it more obvious when the tree is mounted as read-only.
No functional change.
  • Loading branch information
dmnks authored and pmatilai committed Oct 11, 2023
1 parent 70cc93c commit cea7e09
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/mktree.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -170,7 +174,7 @@ case $CMD in
;;
atshell)
set -a
mount_tree $SANDBOX_DIR
mount_tree

export CACHE_DIR
export BASE_DIR=$RPMTEST
Expand All @@ -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 "$@"
;;
Expand Down

0 comments on commit cea7e09

Please sign in to comment.