#!/bin/bash # Dummy docker command for OSX testing. We handle the command lines that # the tests use (and give the output the tests expect). # If the script is running under BATS, FD 3 is open (for output that isn't # caught by BATS and passes right through to the output). If not, we need # to open it. if ! ( echo >&3 ) 2> /dev/null then exec 3>&2 fi if [ "$*" = "pull repronim/containers:latest" ] then cat << EOF latest: Pulling from repronim/containers Digest: sha256:e906fda34b081178b0fbf89818da3509f958fcb7e6d36bd69204665fb7675d5d Status: Image is up to date for repronim/containers:latest docker.io/repronim/containers:latest EOF elif [ "$1" = "run" -a \ "$2" = "--privileged" -a \ "$3" = "--rm" -a \ "$4" = "-e" -a \ "$5" = "UID=501" -a \ "$6" = "-e" -a \ "$7" = "GID=20" -a \ "$8" = "-v" -a \ "${10}" = "-v" -a \ "${12}" = "-v" -a \ "${14}" = "-v" -a \ "${16}" = "-w" -a \ "${18}" = "-v" -a \ "${20}" = "repronim/containers:latest" -a \ "${21}" = "exec" -a \ "${22}" = "-B" -a \ "${24}" = "-B" -a \ "${26}" = "-B" -a \ "${28}" = "-e" -a \ "${29}" = "-B" -a \ "${31}" = "-H" -a \ "${33}" = "--pwd" -a \ "${36}" = "/singularity" -a \ "${37}" = "foo bar" -a \ "${38}" = "blah" -a \ "${39}" = "45.5" -a \ "${40}" = "/dir" -a \ "${41}" = "bar;" -a \ "${42}" = "foo&" -a \ "${43}" = "\${foo}" ] then cat << EOF arg #1= arg #2= arg #3=<45.5> arg #4= arg #5= arg #6= arg #7=<\${foo}> EOF else echo "$0: unhandled command line:" >&3 i=1 for arg in "$@" do echo " \$${i} = <$arg>" >&3 i=$(($i+1)) done exit 1 fi exit 0