From a1eb535bee3433c868c3660806c96832b440bee2 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Mon, 6 Jul 2020 18:48:06 -0400 Subject: [PATCH] Switch to entrypoint to allow running one-off tests easily. Fix and expand cli options --- Dockerfile.itest | 2 +- itest.sh | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Dockerfile.itest b/Dockerfile.itest index ad86434..56820b7 100644 --- a/Dockerfile.itest +++ b/Dockerfile.itest @@ -30,4 +30,4 @@ ADD itest.sh /itest.sh ADD bin/gh-ost /usr/local/bin/gh-ost ADD localtests /localtests -CMD ["/itest.sh"] +ENTRYPOINT ["/itest.sh", "-b", "/usr/local/bin/gh-ost"] diff --git a/itest.sh b/itest.sh index 01c8a0d..7372e42 100755 --- a/itest.sh +++ b/itest.sh @@ -4,6 +4,7 @@ #/ #/ Options: #/ --gh-ost-binary | -b path to gh-ost binary. defaults to /tmp/gh-ost-test +#/ --test-dir path to test directories. defaults to /localtests usage() { code="$1" @@ -13,15 +14,19 @@ usage() { exit "$code" } -GHOST_BINARY= +GHOST_BINARY=/tmp/gh-ost-test +TEST_DIR=/localtests + while [ "$#" -gt 0 ]; do case "$1" in --gh-ost-binary|-b) GHOST_BINARY="$2"; shift 2;; --gh-ost-binary=*) GHOST_BINARY="$(echo "$1" | cut -d"=" -f"2-")"; shift;; + --test-dir) TEST_DIR="$2"; shift 2;; + --test-dir=*) TEST_DIR="$(echo "$1" | cut -d"=" -f"2-")"; shift;; --help|-h) usage 0;; -*) usage 1;; - *) ;; + *) break ;; esac done