local dockercmd=$3
local opts="$4"
+ # rm not valid here
+ opts=${opts//' --rm'};
+
local image=$(get_image_name $os_type $os_version)
local build=true
if $dockercmd images $image | grep --quiet "^$image " ; then
mkdir -p $HOME/.ccache
ccache="--volume $HOME/.ccache:$HOME/.ccache"
user="--user $USER"
- local cmd="$dockercmd run $opts --rm --name $image --privileged $ccache"
+ local cmd="$dockercmd run $opts --name $image --privileged $ccache"
cmd+=" --volume $downstream:$downstream"
cmd+=" --volume $upstream:$upstream"
if test "$dockercmd" = "podman" ; then
fi
local status=0
if test "$script" = "SHELL" ; then
+ echo Running: $cmd --tty --interactive --workdir $downstream $user $image bash
$cmd --tty --interactive --workdir $downstream $user $image bash
else
+ echo Running: $cmd --workdir $downstream $user $image "$@"
if ! $cmd --workdir $downstream $user $image "$@" ; then
status=1
fi
[--shell] run an interactive shell in the container
[--remove-all] remove the container and the image for the specified types+versions
+ [--no-rm] don't remove the container when finished
- [--opts options] run the contain with 'options'
+ [--opts options] run the container with 'options'
docker-test.sh must be run from a Ceph clone and it will run the
command in a container, using a copy of the clone so that long running
fi
local temp
- temp=$(getopt -o scht:v:o:a:r: --long remove-all,verbose,shell,help,os-type:,os-version:,opts:,all:,ref: -n $0 -- "$@") || return 1
+ temp=$(getopt -o scht:v:o:a:r: --long remove-all,verbose,shell,no-rm,help,os-type:,os-version:,opts:,all:,ref: -n $0 -- "$@") || return 1
eval set -- "$temp"
local shell=false
local opts
local ref=$(git rev-parse HEAD)
+ local no-rm=false
while true ; do
case "$1" in
ref="$2"
shift 2
;;
+ --no-rm)
+ no-rm=true
+ shift
+ ;;
--)
shift
break
declare -A os_type2versions
eval os_type2versions="$all"
+ if ! $no-rm ; then
+ opts+=" --rm"
+ fi
+
for os_type in ${!os_type2versions[@]} ; do
for os_version in ${os_type2versions[$os_type]} ; do
if $remove ; then