From f1839ccbc362e885fa80bc79e5a25c38b10c469f Mon Sep 17 00:00:00 2001 From: jregan Date: Tue, 15 May 2018 17:15:48 -0700 Subject: [PATCH] tweakTestScript --- demos/integration_tests.sh | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/demos/integration_tests.sh b/demos/integration_tests.sh index 08eab7895..0f37c115c 100755 --- a/demos/integration_tests.sh +++ b/demos/integration_tests.sh @@ -34,24 +34,20 @@ go install github.com/kubernetes-sigs/kustomize || \ { exit_with "Failed to install kustomize"; } export PATH=$GOPATH/bin:$PATH -home=`pwd` +function runTest { + local script=$1 + shift + local args=$@ -### LDAP TEST ### -demo_dir="./demos/ldap" -if [ ! -d ${demo_dir} ]; then - exit_with "directory ${demo_dir} doesn't exist" -fi - -test_script="${demo_dir}/integration_test.sh" - -if [ -x "${test_script}" ]; then - ${test_script} ${demo_dir}/base - if [ $? -eq 0 ]; then - echo "testing ${demo_dir} passed." - else - exit_with "testing ${demo_dir} failed." + if [ ! -x "$script" ]; then + exit_with "Unable to run $script" fi -else - exit_with "Unable to run ${test_script}" -fi -################# + + $script "$args" + if [ $? -ne 0 ]; then + exit_with "Failed: $script $args" + fi + echo "$script passed." +} + +runTest ldap/integration_test.sh ldap/base