openbao-helm/test
Tom Proctor e2711a2002
Prepare for 0.25.0 release (#916)
* Prepare for 0.25.0 release
* Update CSI acceptance test assertion

Starting in 1.4.0, the CSI provider caches Vault tokens locally. The main thing
we want to check is that the Agent cache is being used so that it's doing the
renewal legwork for any leased secrets, so check for the renewal log message instead
because CSI won't auth over and over anymore.
2023-06-26 16:00:04 +01:00
..
acceptance Prepare for 0.25.0 release (#916) 2023-06-26 16:00:04 +01:00
chart Updating GHA and default Vault version (#863) 2023-04-03 16:44:13 -07:00
docker adding SPDX copyright headers (#844) 2023-02-13 08:48:20 -08:00
kind adding SPDX copyright headers (#844) 2023-02-13 08:48:20 -08:00
terraform adding SPDX copyright headers (#844) 2023-02-13 08:48:20 -08:00
unit csi: update affinity and nodeselector schema (#907) 2023-06-06 22:51:14 -07:00
README.md Updating acceptance tests (#624) 2021-10-11 14:12:55 -07:00

Vault Helm Tests

Running Vault Helm Acceptance tests

The Makefile at the top level of this repo contains a few target that should help with running acceptance tests in your own GKE instance or in a kind cluster.

Note that for the Vault Enterprise tests to pass, a VAULT_LICENSE_CI environment variable needs to be set to the contents of a valid Vault Enterprise license.

Running in a GKE cluster

  • Set the GOOGLE_CREDENTIALS and CLOUDSDK_CORE_PROJECT variables at the top of the file. GOOGLE_CREDENTIALS should contain the local path to your Google Cloud Platform account credentials in JSON format. CLOUDSDK_CORE_PROJECT should be set to the ID of your GCP project.
  • Run make test-image to create the docker image (with dependencies installed) that will be re-used in the below steps.
  • Run make test-provision to provision the GKE cluster using terraform.
  • Run make test-acceptance to run the acceptance tests in this already provisioned cluster.
  • You can choose to only run certain tests by setting the ACCEPTANCE_TESTS variable and re-running the above target.
  • Run make test-destroy when you have finished testing and want to tear-down and remove the cluster.

Running in a kind cluster

  • Run make test-acceptance LOCAL_ACCEPTANCE_TESTS=true
  • You can choose to only run certain tests by setting the ACCEPTANCE_TESTS variable and re-running the above target.
  • Run make delete-kind when you have finished testing and want to tear-down and remove the cluster.
  • You can set an alternate kind cluster name by specifying the KIND_CLUSTER_NAME variable for any of the above targets.
  • You can set an alternate K8S version by specifying the KIND_K8S_VERSION variable for any of the above targets.

See kind-quick-start if you don't have kind installed on your system.

Running chart verification tests

If chart-verifier is built and available in your PATH, run:

bats test/chart/verifier.bats

Or if you'd rather use the latest chart-verifier docker container, set USE_DOCKER:

USE_DOCKER=true bats test/chart/verifier.bats

Generating the values json schema

There is a make target for generating values.schema.json:

make values-schema

It relies on the helm schema-gen plugin. Note that some manual editing will be required, since several properties accept multiple data types.

Helm test

Vault Helm also contains a simple helm test under templates/tests/ that may be run against a helm release:

helm test <RELEASE_NAME>