Skip to content

Commit

Permalink
fix acceptance tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Martens <[email protected]>
  • Loading branch information
JanMa committed Sep 4, 2024
1 parent 603aef0 commit 498e119
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 133 deletions.
6 changes: 3 additions & 3 deletions test/acceptance/csi.bats
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ load _helpers
kubectl --namespace=acceptance wait --for=condition=Ready --timeout=5m pod -l app.kubernetes.io/name=openbao-csi-provider

# Set up k8s auth and a kv secret.
cat ./test/acceptance/csi-test/openbao-policy.hcl | kubectl --namespace=acceptance exec -i openbao-0 -- openbao policy write kv-policy -
cat ../../test/acceptance/csi-test/openbao-policy.hcl | kubectl --namespace=acceptance exec -i openbao-0 -- bao policy write kv-policy -
kubectl --namespace=acceptance exec openbao-0 -- bao auth enable kubernetes
kubectl --namespace=acceptance exec openbao-0 -- sh -c 'bao write auth/kubernetes/config \
kubernetes_host="https://$KUBERNETES_PORT_443_TCP_ADDR:443"'
Expand All @@ -46,8 +46,8 @@ load _helpers
ttl=20m
kubectl --namespace=acceptance exec openbao-0 -- bao kv put secret/kv1 bar1=hello1

kubectl --namespace=acceptance apply -f ./test/acceptance/csi-test/openbao-kv-secretproviderclass.yaml
kubectl --namespace=acceptance apply -f ./test/acceptance/csi-test/nginx.yaml
kubectl --namespace=acceptance apply -f ../../test/acceptance/csi-test/openbao-kv-secretproviderclass.yaml
kubectl --namespace=acceptance apply -f ../../test/acceptance/csi-test/nginx.yaml
kubectl --namespace=acceptance wait --for=condition=Ready --timeout=5m pod nginx

result=$(kubectl --namespace=acceptance exec nginx -- cat /mnt/secrets-store/bar)
Expand Down
6 changes: 3 additions & 3 deletions test/acceptance/injector-leader-elector.bats
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ load _helpers
--wait \
--timeout=5m \
--set="injector.replicas=3" .
kubectl wait --for condition=Ready pod -l app.kubernetes.io/name=vault-agent-injector --timeout=5m
kubectl wait --for condition=Ready pod -l app.kubernetes.io/name=openbao-agent-injector --timeout=5m

pods=($(kubectl get pods -l app.kubernetes.io/name=vault-agent-injector -o json | jq -r '.items[] | .metadata.name'))
pods=($(kubectl get pods -l app.kubernetes.io/name=openbao-agent-injector -o json | jq -r '.items[] | .metadata.name'))
[ "${#pods[@]}" == 3 ]

leader=''
Expand Down Expand Up @@ -49,4 +49,4 @@ teardown() {
kubectl delete --all pvc
kubectl delete namespace acceptance
fi
}
}
8 changes: 4 additions & 4 deletions test/acceptance/injector.bats
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ load _helpers
kubectl create namespace acceptance
kubectl config set-context --current --namespace=acceptance

kubectl create -f ./test/acceptance/injector-test/pg-deployment.yaml
kubectl create -f ../../test/acceptance/injector-test/pg-deployment.yaml
sleep 5
wait_for_ready $(kubectl get pod -l app=postgres -o jsonpath="{.items[0].metadata.name}")

kubectl create secret generic test \
--from-file ./test/acceptance/injector-test/pgdump-policy.hcl \
--from-file ./test/acceptance/injector-test/bootstrap.sh
--from-file ../../test/acceptance/injector-test/pgdump-policy.hcl \
--from-file ../../test/acceptance/injector-test/bootstrap.sh

kubectl label secret test app=openbao-agent-demo

Expand All @@ -39,7 +39,7 @@ load _helpers
[ "${init_status}" == "true" ]


kubectl create -f ./test/acceptance/injector-test/job.yaml
kubectl create -f ../../test/acceptance/injector-test/job.yaml
wait_for_complete_job "pgdump"
}

Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/server-annotations.bats
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ load _helpers
kubectl create namespace acceptance
kubectl config set-context --current --namespace=acceptance

helm install "$(name_prefix)" -f ./test/acceptance/server-test/annotations-overrides.yaml .
helm install "$(name_prefix)" -f ../../test/acceptance/server-test/annotations-overrides.yaml .
wait_for_running $(name_prefix)-0

# service annotations
Expand Down
121 changes: 0 additions & 121 deletions test/acceptance/server-ha.bats

This file was deleted.

2 changes: 1 addition & 1 deletion test/acceptance/server-telemetry.bats
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ load _helpers

helm install \
--wait \
--values ./test/acceptance/server-test/telemetry.yaml \
--values ../../test/acceptance/server-test/telemetry.yaml \
"$(name_prefix)" .

wait_for_running $(name_prefix)-0
Expand Down

0 comments on commit 498e119

Please sign in to comment.