From acf9d7e4576d33c7a6e05fa89b3137465b480da3 Mon Sep 17 00:00:00 2001 From: Alessio Pragliola Date: Tue, 24 Sep 2024 18:43:13 +0200 Subject: [PATCH] fix(csi): wrong function arguments Signed-off-by: Alessio Pragliola --- csi/test/e2e_test.sh | 6 +++--- csi/test/test_utils.sh | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/csi/test/e2e_test.sh b/csi/test/e2e_test.sh index 9ebee228b..3626684ea 100755 --- a/csi/test/e2e_test.sh +++ b/csi/test/e2e_test.sh @@ -3,8 +3,6 @@ set -e set -o xtrace -source ./${DIR}/test_utils.sh - # This test assumes there is a Kubernetes environment up and running. # It could be either a remote one or a local one (e.g., using KinD or minikube). @@ -18,6 +16,8 @@ wait_for_port() { DIR="$(dirname "$0")" +source ./${DIR}/test_utils.sh + KUBECTL=${KUBECTL:-"kubectl"} # You can provide a local version of the model registry storage initializer @@ -147,7 +147,7 @@ spec: EOF # wait for pod predictor to be initialized -repeat_cmd_until "kubectl get pod -n $KSERVE_TEST_NAMESPACE --selector='component=predictor' | wc -l" 300 +repeat_cmd_until "kubectl get pod -n $KSERVE_TEST_NAMESPACE --selector='component=predictor' | wc -l" "-gt 0" 300 predictor=$(kubectl get pod -n $KSERVE_TEST_NAMESPACE --selector="component=predictor" --output jsonpath='{.items[0].metadata.name}') kubectl wait --for=condition=Ready pod/$predictor -n $KSERVE_TEST_NAMESPACE --timeout=5m diff --git a/csi/test/test_utils.sh b/csi/test/test_utils.sh index 5aaa9de90..dd7a7353e 100644 --- a/csi/test/test_utils.sh +++ b/csi/test/test_utils.sh @@ -5,6 +5,7 @@ set -o xtrace repeat_cmd_until() { local cmd=$1 + local condition=$2 local max_wait_secs=$3 local interval_secs=2 local start_time=$(date +%s) @@ -18,9 +19,9 @@ repeat_cmd_until() { return 1 fi - output=$($cmd) + output=$(eval $cmd) - if [$? -eq 0]; then + if [ $output $condition ]; then break else sleep $interval_secs