hashicorp / vault-plugin-auth-kerberos

A plugin for HashiCorp Vault enabling Kerberos authentication.
Mozilla Public License 2.0
17 stars 17 forks source link

test: add bats acceptance test #64

Closed calvn closed 2 years ago

calvn commented 2 years ago

This PR ports and combines the acceptance test setup and execution from scripts/dev_env.sh and the README into BATs-based acceptance test. The current test is done specifically against Vault Enterprise (which requires a license), but this can be updated down the road to include OSS-only test setup and execution as well.

The test can be ran directly with bats $(CURDIR)/test/acceptance/server-enterprise-basic-tests.bats or ran through the make target make test-acceptance which also performs binary compilation.

calvn commented 2 years ago

Updated the PR and broke out the single test into separate ones for clarity. It performs a single setup and teardown per run to minimize overhead.

› bats test/acceptance/server-enterprise-basic-tests.bats
 ✓ auth/kerberos: create namespace
 ✓ auth/kerberos: register plugin
 ✓ auth/kerberos: enable and configure auth method
 ✓ auth/kerberos: setup and authentication within a Vault namespace

4 tests, 0 failures