Skip to content

Commit

Permalink
Reset sleep time to original
Browse files Browse the repository at this point in the history
  • Loading branch information
dargudear-google committed Oct 17, 2024
1 parent 8954731 commit 64a471f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions test/bats/e2e-provider.bats
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export VALIDATE_TOKENS_AUDIENCE=$(get_token_requests_audience)

envsubst < $BATS_TESTS_DIR/deployment-synck8s-e2e-provider.yaml | kubectl apply -n test-ns -f -

kubectl wait --for=condition=Ready --timeout=180s pod -l app=busybox -n test-ns
kubectl wait --for=condition=Ready --timeout=60s pod -l app=busybox -n test-ns
}

@test "Test Namespaced scope SecretProviderClass - Sync with K8s secrets - read secret from pod, read K8s secret, read env var, check secret ownerReferences" {
Expand Down Expand Up @@ -340,7 +340,7 @@ export VALIDATE_TOKENS_AUDIENCE=$(get_token_requests_audience)
@test "deploy pod with multiple secret provider class" {
envsubst < $BATS_TESTS_DIR/pod-e2e-provider-inline-volume-multiple-spc.yaml | kubectl apply -f -

kubectl wait --for=condition=Ready --timeout=180s pod/secrets-store-inline-multiple-crd
kubectl wait --for=condition=Ready --timeout=60s pod/secrets-store-inline-multiple-crd

run kubectl get pod/secrets-store-inline-multiple-crd
assert_success
Expand Down Expand Up @@ -386,7 +386,7 @@ export VALIDATE_TOKENS_AUDIENCE=$(get_token_requests_audience)
envsubst < $BATS_TESTS_DIR/rotation/e2e_provider_synck8s_v1_secretproviderclass.yaml | kubectl apply -n rotation -f -
envsubst < $BATS_TESTS_DIR/rotation/pod-synck8s-e2e-provider.yaml | kubectl apply -n rotation -f -

kubectl wait -n rotation --for=condition=Ready --timeout=180s pod/secrets-store-inline-rotation
kubectl wait -n rotation --for=condition=Ready --timeout=60s pod/secrets-store-inline-rotation

run kubectl get pod/secrets-store-inline-rotation -n rotation
assert_success
Expand All @@ -402,7 +402,7 @@ export VALIDATE_TOKENS_AUDIENCE=$(get_token_requests_audience)
# enable rotation response in mock server
local curl_pod_name=curl-$(openssl rand -hex 5)
kubectl run ${curl_pod_name} -n rotation --image=curlimages/curl:7.75.0 --labels="test=rotation" -- tail -f /dev/null
kubectl wait -n rotation --for=condition=Ready --timeout=180s pod ${curl_pod_name}
kubectl wait -n rotation --for=condition=Ready --timeout=60s pod ${curl_pod_name}
local pod_ip=$(kubectl get pod -n kube-system -l app=csi-secrets-store-e2e-provider -o jsonpath="{.items[0].status.podIP}")
run kubectl exec ${curl_pod_name} -n rotation -- curl http://${pod_ip}:8080/rotation?rotated=true

Expand All @@ -426,7 +426,7 @@ export VALIDATE_TOKENS_AUDIENCE=$(get_token_requests_audience)
kubectl create ns metrics
local curl_pod_name=curl-$(openssl rand -hex 5)
kubectl run ${curl_pod_name} -n metrics --image=curlimages/curl:7.75.0 --labels="test=metrics" -- tail -f /dev/null
kubectl wait -n metrics --for=condition=Ready --timeout=120s pod ${curl_pod_name}
kubectl wait -n metrics --for=condition=Ready --timeout=60s pod ${curl_pod_name}
for pod_ip in $(kubectl get pod -n kube-system -l app=secrets-store-csi-driver -o jsonpath="{.items[0].status.podIP}")
do
run kubectl exec ${curl_pod_name} -n metrics -- curl http://${pod_ip}:8095/metrics
Expand Down
7 changes: 3 additions & 4 deletions test/bats/vault.bats
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,11 @@ EOF

# deploy pod
kubectl apply -f $BATS_TESTS_DIR/pod-vault-rotation.yaml
kubectl wait --for=condition=Ready --timeout=180s pod/secrets-store-rotation
kubectl wait --for=condition=Ready --timeout=60s pod/secrets-store-rotation

run kubectl get pod/secrets-store-rotation
assert_success

sleep 120
# verify starting value
result=$(kubectl exec secrets-store-rotation -- cat /mnt/secrets-store/foo)
[[ "$result" == "start" ]]
Expand Down Expand Up @@ -212,7 +211,7 @@ EOF

kubectl apply -n test-ns -f $BATS_TESTS_DIR/deployment-synck8s.yaml

kubectl wait --for=condition=Ready --timeout=180s pod -l app=busybox -n test-ns
kubectl wait --for=condition=Ready --timeout=90s pod -l app=busybox -n test-ns
}

@test "Test Namespaced scope SecretProviderClass - Sync with K8s secrets - read secret from pod, read K8s secret, read env var, check secret ownerReferences" {
Expand Down Expand Up @@ -272,7 +271,7 @@ EOF

@test "deploy pod with multiple secret provider class" {
kubectl apply -f $BATS_TESTS_DIR/pod-vault-inline-volume-multiple-spc.yaml
kubectl wait --for=condition=Ready --timeout=180s pod/secrets-store-inline-multiple-crd
kubectl wait --for=condition=Ready --timeout=90s pod/secrets-store-inline-multiple-crd

run kubectl get pod/secrets-store-inline-multiple-crd
assert_success
Expand Down

0 comments on commit 64a471f

Please sign in to comment.