
* Initial commit * Added openshift flag * added self signed certificate for service annotation * added OpenShift flag * Added OpenShift flag * cleanup * Cleanup * Further cleanup * Further cleanup * reverted security context on injector * Extra corrections * cleanup * Removed Raft config for OpenShift, removed generated certs for ha and standby services * Add openshift flag to global block, route disabled by default, condition for injector in network policy * Added Unit tests for OpenShift * Fixed unit test for HA statefulset for OpenShift * Removed debug log level from stateful set * Added port 8201 to networkpolicy * Updated injector image * Add openshift beta support * Add openshift beta support * Remove comments from configs * Remove vault-k8s note from values * Change route to use active service when HA Co-authored-by: Radu Domnu <radu.domnu@sixdx.com> Co-authored-by: Radu Domnu <radu.domnu@gmail.com>
64 lines
1.9 KiB
Bash
64 lines
1.9 KiB
Bash
#!/usr/bin/env bats
|
|
|
|
load _helpers
|
|
|
|
@test "server/dev: testing deployment" {
|
|
cd `chart_dir`
|
|
kubectl delete namespace acceptance --ignore-not-found=true
|
|
kubectl create namespace acceptance
|
|
kubectl config set-context --current --namespace=acceptance
|
|
|
|
helm install "$(name_prefix)" --set='server.dev.enabled=true' .
|
|
wait_for_running $(name_prefix)-0
|
|
|
|
# Replicas
|
|
local replicas=$(kubectl get statefulset "$(name_prefix)" --output json |
|
|
jq -r '.spec.replicas')
|
|
[ "${replicas}" == "1" ]
|
|
|
|
# Volume Mounts
|
|
local volumeCount=$(kubectl get statefulset "$(name_prefix)" --output json |
|
|
jq -r '.spec.template.spec.containers[0].volumeMounts | length')
|
|
[ "${volumeCount}" == "1" ]
|
|
|
|
# Service
|
|
local service=$(kubectl get service "$(name_prefix)" --output json |
|
|
jq -r '.spec.clusterIP')
|
|
[ "${service}" != "None" ]
|
|
|
|
local service=$(kubectl get service "$(name_prefix)" --output json |
|
|
jq -r '.spec.type')
|
|
[ "${service}" == "ClusterIP" ]
|
|
|
|
local ports=$(kubectl get service "$(name_prefix)" --output json |
|
|
jq -r '.spec.ports | length')
|
|
[ "${ports}" == "2" ]
|
|
|
|
local ports=$(kubectl get service "$(name_prefix)" --output json |
|
|
jq -r '.spec.ports[0].port')
|
|
[ "${ports}" == "8200" ]
|
|
|
|
local ports=$(kubectl get service "$(name_prefix)" --output json |
|
|
jq -r '.spec.ports[1].port')
|
|
[ "${ports}" == "8201" ]
|
|
|
|
# Sealed, not initialized
|
|
local sealed_status=$(kubectl exec "$(name_prefix)-0" -- vault status -format=json |
|
|
jq -r '.sealed' )
|
|
[ "${sealed_status}" == "false" ]
|
|
|
|
local init_status=$(kubectl exec "$(name_prefix)-0" -- vault status -format=json |
|
|
jq -r '.initialized')
|
|
[ "${init_status}" == "true" ]
|
|
}
|
|
|
|
# Clean up
|
|
teardown() {
|
|
if [[ ${CLEANUP:-true} == "true" ]]
|
|
then
|
|
echo "helm/pvc teardown"
|
|
helm delete vault
|
|
kubectl delete --all pvc
|
|
kubectl delete namespace acceptance --ignore-not-found=true
|
|
fi
|
|
}
|