From f1839ccbc362e885fa80bc79e5a25c38b10c469f Mon Sep 17 00:00:00 2001 From: jregan Date: Tue, 15 May 2018 17:15:48 -0700 Subject: [PATCH 1/2] 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 From 2b48624e9c959a6b3076e2ec3719644bad53722c Mon Sep 17 00:00:00 2001 From: jregan Date: Tue, 15 May 2018 17:47:31 -0700 Subject: [PATCH 2/2] tweak integration test script --- demos/integration_tests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/integration_tests.sh b/demos/integration_tests.sh index 0f37c115c..450124234 100755 --- a/demos/integration_tests.sh +++ b/demos/integration_tests.sh @@ -37,14 +37,14 @@ export PATH=$GOPATH/bin:$PATH function runTest { local script=$1 shift - local args=$@ + local args=$@ if [ ! -x "$script" ]; then exit_with "Unable to run $script" fi $script "$args" - if [ $? -ne 0 ]; then + if [ $? -ne 0 ]; then exit_with "Failed: $script $args" fi echo "$script passed."