File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,30 +79,32 @@ ORIGINAL_SCRIPT_RELATIVE_TO_ROOT=$(realpath --relative-to $reporoot "$original_t
7979echo " ORIGINAL_SCRIPT_RELATIVE_TO_ROOT=[$ORIGINAL_SCRIPT_RELATIVE_TO_ROOT ]"
8080INNER_MOUNT=/prc
8181
82+ : ${DOCKER:= docker}
83+
8284# Start the container.
8385echo image=" [$image ]"
84- CONTAINER=$( docker run -d -v $reporoot :$INNER_MOUNT :ro --rm $image )
86+ CONTAINER=$( $DOCKER run -d -v $reporoot :$INNER_MOUNT :ro --rm $image )
8587
8688# Wait for iRODS and database to start up.
8789TIME0=$( date +%s)
8890while : ; do
8991 [ ` date +%s` -gt $(( TIME0 + 30 )) ] && { echo >&2 " Waited too long for DB and iRODS to start" ; exit 124; }
9092 sleep 1
91- docker exec $CONTAINER grep ' (0)' /tmp/irods_status 2> /dev/null > /dev/null
93+ $DOCKER exec $CONTAINER grep ' (0)' /tmp/irods_status 2> /dev/null > /dev/null
9294 [ $? -ne 0 ] && { echo -n . >&2 ; continue ; }
9395 break
9496done
9597
96- docker exec ${RUN_AS_USER: +" -u$RUN_AS_USER " } \
97- ${WORKDIR: +" -w$WORKDIR " } \
98- -e " ORIGINAL_SCRIPT_RELATIVE_TO_ROOT=$ORIGINAL_SCRIPT_RELATIVE_TO_ROOT " \
99- $CONTAINER \
100- $INNER_MOUNT /$( realpath --relative-to $reporoot " $testscript_abspath " ) \
101- $arglist
98+ $DOCKER exec ${RUN_AS_USER: +" -u$RUN_AS_USER " } \
99+ ${WORKDIR: +" -w$WORKDIR " } \
100+ -e " ORIGINAL_SCRIPT_RELATIVE_TO_ROOT=$ORIGINAL_SCRIPT_RELATIVE_TO_ROOT " \
101+ $CONTAINER \
102+ $INNER_MOUNT /$( realpath --relative-to $reporoot " $testscript_abspath " ) \
103+ $arglist
102104STATUS=$?
103105
104106if [ $(( 0 + KILL_TEST_CONTAINER)) -ne 0 ]; then
105- echo >&2 ' Killed:' $( docker stop --time=0 $CONTAINER )
107+ echo >&2 ' Killed:' $( $DOCKER stop --time=0 $CONTAINER )
106108fi
107109
108110[ -n " $ECHO_CONTAINER " ] && echo $CONTAINER
You can’t perform that action at this time.
0 commit comments