Skip to content

Commit

Permalink
refactor(csi): move wait_for_port in test_utils
Browse files Browse the repository at this point in the history
Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>
  • Loading branch information
Al-Pragliola committed Sep 25, 2024
1 parent fe3edfd commit 791d832
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 0 additions & 8 deletions csi/test/e2e_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ set -o xtrace
# 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).

# Function to check if the port is ready
wait_for_port() {
local port=$1
while ! nc -z localhost $port; do
sleep 0.1
done
}

DIR="$(dirname "$0")"

source ./${DIR}/test_utils.sh
Expand Down
9 changes: 9 additions & 0 deletions csi/test/test_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
set -e
set -o xtrace

# Function to check if the port is ready
wait_for_port() {
local port=$1
while ! nc -z localhost $port; do
sleep 0.1
done
}


repeat_cmd_until() {
local cmd=$1
local condition=$2
Expand Down

0 comments on commit 791d832

Please sign in to comment.