boundary
boundary copied to clipboard
Add vault test to e2e test suite
This PR adds tests that use Vault as a credential store. A new enos scenario was created to spin up a vault instance alongside a boundary cluster. The test then sets up Vault as a credential store, creates a set of credentials, and attaches those credentials to a target.
As a design philosophy, we wanted to minimize the amount of setup done in enos in order to maintain as much flexibility as possible with regards to how the infrastructure gets created.
Some additional refactoring was done to create methods for commonly used boundary operations.
❯ enos scenario run e2e_vault builder:local
Scenario: e2e_vault [builder:local]
Generate: ✅
Init: ✅
Validate: ✅
Plan: ✅
Apply: ✅
Destroy: ✅
❯ go test -v github.com/hashicorp/boundary/testing/internal/e2e/vault
=== RUN TestCreateVaultCredentialStoreCli
vault_test.go:83: Using Vault Address: http://44.204.115.92:8200
vault_test.go:123: Created Vault Credential
vault_test.go:142: Created Vault Cred Store Token: {TOKEN}
vault_test.go:155: Created Org Id: o_hCrwhLCZHp
vault_test.go:160: Created Project Id: p_Ahwlt8eiki
vault_test.go:176: Created Credential Store: csvlt_yKth9KCIHp
vault_test.go:192: Created Credential Library: clvlt_GLuKKgDFhM
vault_test.go:206: Created Host Catalog: hcst_ezcv0DZgCM
vault_test.go:220: Created Host Set: hsst_Hi7NnHWnBQ
vault_test.go:235: Created Host: hst_a3vSteyXw8
vault_test.go:258: Created Target: ttcp_uuUkPwd9et
vault_test.go:293: Successfully retrieved credentials for target
--- PASS: TestCreateVaultCredentialStoreCli (4.32s)
=== RUN TestCreateVaultCredentialStoreApi
--- PASS: TestCreateVaultCredentialStoreApi (0.00s)
PASS
ok github.com/hashicorp/boundary/testing/internal/e2e/vault 4.514s