From 3fb86de485791c8993ace82398147dac6482c55a Mon Sep 17 00:00:00 2001 From: Yi Cai Date: Thu, 8 Jun 2023 15:53:01 -0400 Subject: [PATCH] Fix 014 test --- .../02-check-deployment.yaml | 13 +++++++++---- .../04-check-deployment.yaml | 11 ++++++++--- .../06-check-deployment.yaml | 11 ++++++++--- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/tests/k8s/1-014_validate_parallelism_limit/02-check-deployment.yaml b/tests/k8s/1-014_validate_parallelism_limit/02-check-deployment.yaml index b60954eb0..3eceece64 100644 --- a/tests/k8s/1-014_validate_parallelism_limit/02-check-deployment.yaml +++ b/tests/k8s/1-014_validate_parallelism_limit/02-check-deployment.yaml @@ -4,10 +4,15 @@ commands: - script: sleep 30 - script: | set -e - expected=10 - wlCommand=$(kubectl get -n $NAMESPACE statefulset/argocd-application-controller -o jsonpath='{.spec.template.spec.containers[0].command}'| jq -r '.[]' ) - if ! echo "$wlCommand" | grep -qPz -- "--kubectl-parallelism-limit\\n${expected}(\$|\\n)"; then + expected="10" + wlCommand=$(kubectl get -n $NAMESPACE statefulset/argocd-application-controller -o jsonpath='{.spec.template.spec.containers[0].command}'| jq -r '.[]') + if ! echo "$wlCommand" | grep -Fxq -- "--kubectl-parallelism-limit"; then echo "Incorrect or missing --kubectl-parallelism-limit detected." echo "$wlCommand" exit 1 - fi \ No newline at end of file + fi + if ! echo "$wlCommand" | grep -Fxq -- "$expected"; then + echo "Incorrect value for --kubectl-parallelism-limit detected." + echo "$wlCommand" + exit 1 + fi diff --git a/tests/k8s/1-014_validate_parallelism_limit/04-check-deployment.yaml b/tests/k8s/1-014_validate_parallelism_limit/04-check-deployment.yaml index edbdbe5eb..987657321 100644 --- a/tests/k8s/1-014_validate_parallelism_limit/04-check-deployment.yaml +++ b/tests/k8s/1-014_validate_parallelism_limit/04-check-deployment.yaml @@ -4,10 +4,15 @@ commands: - script: sleep 30 - script: | set -e - expected=20 - wlCommand=$(kubectl get -n $NAMESPACE statefulset/argocd-application-controller -o jsonpath='{.spec.template.spec.containers[0].command}'| jq -r '.[]' ) - if ! echo "$wlCommand" | grep -qPz -- "--kubectl-parallelism-limit\\n${expected}(\$|\\n)"; then + expected="20" + wlCommand=$(kubectl get -n $NAMESPACE statefulset/argocd-application-controller -o jsonpath='{.spec.template.spec.containers[0].command}'| jq -r '.[]') + if ! echo "$wlCommand" | grep -Fxq -- "--kubectl-parallelism-limit"; then echo "Incorrect or missing --kubectl-parallelism-limit detected." echo "$wlCommand" exit 1 + fi + if ! echo "$wlCommand" | grep -Fxq -- "$expected"; then + echo "Incorrect value for --kubectl-parallelism-limit detected." + echo "$wlCommand" + exit 1 fi \ No newline at end of file diff --git a/tests/k8s/1-014_validate_parallelism_limit/06-check-deployment.yaml b/tests/k8s/1-014_validate_parallelism_limit/06-check-deployment.yaml index 753984460..7548a4525 100644 --- a/tests/k8s/1-014_validate_parallelism_limit/06-check-deployment.yaml +++ b/tests/k8s/1-014_validate_parallelism_limit/06-check-deployment.yaml @@ -7,10 +7,15 @@ commands: - script: sleep 30 - script: | set -e - expected=10 - wlCommand=$(kubectl get -n $NAMESPACE statefulset/argocd-application-controller -o jsonpath='{.spec.template.spec.containers[0].command}'| jq -r '.[]' ) - if ! echo "$wlCommand" | grep -qPz -- "--kubectl-parallelism-limit\\n${expected}(\$|\\n)"; then + expected="10" + wlCommand=$(kubectl get -n $NAMESPACE statefulset/argocd-application-controller -o jsonpath='{.spec.template.spec.containers[0].command}'| jq -r '.[]') + if ! echo "$wlCommand" | grep -Fxq -- "--kubectl-parallelism-limit"; then echo "Incorrect or missing --kubectl-parallelism-limit detected." echo "$wlCommand" exit 1 + fi + if ! echo "$wlCommand" | grep -Fxq -- "$expected"; then + echo "Incorrect value for --kubectl-parallelism-limit detected." + echo "$wlCommand" + exit 1 fi \ No newline at end of file