#!/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" ] && \ [ "$2" = "--privileged" ] && \ [ "$3" = "--rm" ] && \ [ "$4" = "-e" ] && \ [ "$5" = "UID=501" ] && \ [ "$6" = "-e" ] && \ [ "$7" = "GID=20" ] && \ [ "$8" = "-v" ] && \ [ "${10}" = "-v" ] && \ [ "${12}" = "-v" ] && \ [ "${14}" = "-v" ] && \ [ "${16}" = "-w" ] && \ [ "${18}" = "-v" ] && \ [ "${20}" = "repronim/containers:latest" ] && \ [ "${21}" = "exec" ] && \ [ "${22}" = "-B" ] && \ [ "${24}" = "-B" ] && \ [ "${26}" = "-B" ] && \ [ "${28}" = "-e" ] && \ [ "${29}" = "-B" ] && \ [ "${31}" = "-H" ] && \ [ "${33}" = "--pwd" ] && \ [ "${36}" = "/singularity" ] && \ [ "${37}" = "foo bar" ] && \ [ "${38}" = "blah" ] && \ [ "${39}" = "45.5" ] && \ [ "${40}" = "/dir" ] && \ [ "${41}" = "bar;" ] && \ [ "${42}" = "foo&" ] && \ [ "${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