diff options
author | Jhon Honce <jhonce@redhat.com> | 2018-06-05 12:40:35 -0700 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-06-05 21:23:54 +0000 |
commit | 93c1722caab372f873765041d2bd2b710de3c5c4 (patch) | |
tree | 3c2b5020db1e68092bbd25888a90f6ef145d0d00 /contrib/python/test/test_runner.sh | |
parent | 3901ecc7b6b08b7555ccf0e8a05b278b05a9629c (diff) | |
download | podman-93c1722caab372f873765041d2bd2b710de3c5c4.tar.gz podman-93c1722caab372f873765041d2bd2b710de3c5c4.tar.bz2 podman-93c1722caab372f873765041d2bd2b710de3c5c4.zip |
Add support for BuildImage
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Closes: #908
Approved by: baude
Diffstat (limited to 'contrib/python/test/test_runner.sh')
-rwxr-xr-x | contrib/python/test/test_runner.sh | 50 |
1 files changed, 33 insertions, 17 deletions
diff --git a/contrib/python/test/test_runner.sh b/contrib/python/test/test_runner.sh index 1cccbe1f5..4e5844831 100755 --- a/contrib/python/test/test_runner.sh +++ b/contrib/python/test/test_runner.sh @@ -6,6 +6,13 @@ if [[ $(id -u) != 0 ]]; then exit 2 fi +# setup path to find new binaries _NOT_ system binaries +if [[ ! -x ../../bin/podman ]]; then + echo 1>&2 Cannot find podman binary from libpod root directory. Run \"make binaries\" + exit 1 +fi +export PATH=../../bin:$PATH + while getopts "vh" arg; do case $arg in v ) VERBOSE='-v' ;; @@ -14,8 +21,16 @@ while getopts "vh" arg; do done shift $((OPTIND-1)) +function cleanup { + # aggressive cleanup as tests may crash leaving crap around + umount '^(shm|nsfs)' + umount '\/run\/netns' + rm -r "$1" +} + # Create temporary directory for storage export TMPDIR=`mktemp -d /tmp/podman.XXXXXXXXXX` +trap "cleanup $TMPDIR" EXIT function umount { # xargs -r always ran once, so write any mount points to file first @@ -25,26 +40,16 @@ function umount { fi } -function cleanup { - umount '^(shm|nsfs)' - umount '\/run\/netns' - rm -fr ${TMPDIR} -} -trap cleanup EXIT - -# setup path to find new binaries _NOT_ system binaries -if [[ ! -x ../../bin/podman ]]; then - echo 1>&2 Cannot find podman binary from libpod root directory, Or, run \"make binaries\" - exit 1 -fi -export PATH=../../bin:$PATH - function showlog { - [ -s "$1" ] && (echo $1 =====; cat "$1"; echo) + [[ -s $1 ]] && cat <<-EOT +$1 ===== +$(cat "$1") + +EOT } -# Need a location to store the podman socket -mkdir -p ${TMPDIR}/{podman,crio,crio-run,cni/net.d} +# Need locations to store stuff +mkdir -p ${TMPDIR}/{podman,crio,crio-run,cni/net.d,ctnr} # Cannot be done in python unittest fixtures. EnvVar not picked up. export REGISTRIES_CONFIG_PATH=${TMPDIR}/registry.conf @@ -85,6 +90,17 @@ cat >$CNI_CONFIG_PATH/87-podman-bridge.conflist <<-EOT } EOT +cat >$TMPDIR/ctnr/hello.sh <<-EOT +echo 'Hello, World' +EOT + +cat >$TMPDIR/ctnr/Dockerfile <<-EOT +FROM alpine:latest +COPY ./hello.sh /tmp/hello.sh +RUN chmod 755 /tmp/hello.sh +ENTRYPOINT ["/tmp/hello.sh"] +EOT + export PODMAN_HOST="unix:${TMPDIR}/podman/io.projectatomic.podman" PODMAN_ARGS="--storage-driver=vfs\ --root=${TMPDIR}/crio\ |