From 7196cb45b488451952f62f47dec5bfdccb3a1ce4 Mon Sep 17 00:00:00 2001 From: Yi Cai Date: Mon, 10 Jul 2023 16:53:04 -0400 Subject: [PATCH] Added sleep Signed-off-by: Yi Cai --- .../1-020_validate_redis_ha_nonha/02-assert.yaml | 2 +- .../02-check-deployment.yaml | 2 ++ .../04-check-deployment.yaml | 2 ++ .../02-update-notifications-cm.yaml | 1 + .../05-verify-email.yaml | 14 ++++++++++++++ 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/ha/1-020_validate_redis_ha_nonha/02-assert.yaml b/tests/ha/1-020_validate_redis_ha_nonha/02-assert.yaml index 94db47f3f..9b22f46bd 100644 --- a/tests/ha/1-020_validate_redis_ha_nonha/02-assert.yaml +++ b/tests/ha/1-020_validate_redis_ha_nonha/02-assert.yaml @@ -1,6 +1,6 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert -timeout: 720 +timeout: 780 --- apiVersion: v1 kind: Service 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 d2b23a0bb..b456f333e 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 @@ -3,6 +3,8 @@ kind: TestStep commands: - script: | set -e + sleep 30 + 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 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 8c710be9b..d5fa4cefd 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 @@ -3,6 +3,8 @@ kind: TestStep commands: - script: | set -e + sleep 30 + 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 diff --git a/tests/k8s/1-022_validate_notifications/02-update-notifications-cm.yaml b/tests/k8s/1-022_validate_notifications/02-update-notifications-cm.yaml index 47b2083af..1a32ce0ea 100644 --- a/tests/k8s/1-022_validate_notifications/02-update-notifications-cm.yaml +++ b/tests/k8s/1-022_validate_notifications/02-update-notifications-cm.yaml @@ -4,4 +4,5 @@ commands: - script: | set -e + sleep 15 kubectl patch cm argocd-notifications-cm -n $NAMESPACE --type merge -p '{"data": {"service.email.gmail": "{host: smtp4dev, port: 2525, from: fake@email.com}" }}' \ No newline at end of file diff --git a/tests/k8s/1-022_validate_notifications/05-verify-email.yaml b/tests/k8s/1-022_validate_notifications/05-verify-email.yaml index 0fa47de29..0263c1b1a 100644 --- a/tests/k8s/1-022_validate_notifications/05-verify-email.yaml +++ b/tests/k8s/1-022_validate_notifications/05-verify-email.yaml @@ -4,7 +4,21 @@ commands: - script: | set -e smtp4dev_pod=$(kubectl get pod -l=app=smtp4dev -o jsonpath='{.items[0].metadata.name}' -n $NAMESPACE) + if [ $? -eq 0 ]; then + echo "Successfully fetched smtp4dev_pod: ${smtp4dev_pod}" + else + echo "Failed to fetch smtp4dev_pod" + exit 1 + fi + output=$(kubectl -n $NAMESPACE exec -i "${smtp4dev_pod}" -- /bin/bash -c 'grep -rnw /tmp -e "Subject: Application my-app-3 has been created."') + if [ $? -eq 0 ]; then + echo "Successfully executed command in smtp4dev_pod" + else + echo "Failed to execute command in smtp4dev_pod" + exit 1 + fi + if [ -n "$output" ]; then echo "Email notification received: Application my-app-3 has been created." exit 0