From a067d3e7cc0557b91950705c7132e107028568f7 Mon Sep 17 00:00:00 2001 From: absolutelightning Date: Fri, 30 Jun 2023 11:53:22 +0530 Subject: [PATCH] fix assert config entry status command not found --- .../connect/envoy/helpers.windows.bash | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/integration/connect/envoy/helpers.windows.bash b/test/integration/connect/envoy/helpers.windows.bash index a9c8d9cbe0..3adcd21cc5 100644 --- a/test/integration/connect/envoy/helpers.windows.bash +++ b/test/integration/connect/envoy/helpers.windows.bash @@ -804,6 +804,21 @@ function wait_for_config_entry { retry_default read_config_entry "$@" } +function assert_config_entry_status { + local TYPE="$1" + local STATUS="$2" + local REASON="$3" + local DC="$4" + local KIND="$5" + local NAME="$6" + local NS=${7:-} + local AP=${8:-} + local PEER=${9:-} + + status=$(curl -s -f "consul-${DC}-client:8500/v1/config/${KIND}/${NAME}?passing&ns=${NS}&partition=${AP}&peer=${PEER}" | jq ".Status.Conditions[] | select(.Type == \"$TYPE\" and .Status == \"$STATUS\" and .Reason == \"$REASON\")") + [ -n "$status" ] +} + function delete_config_entry { local KIND=$1 local NAME=$2