Skip to content

Commit

Permalink
Make tests compatible with Vault 0.10
Browse files Browse the repository at this point in the history
When starting a new, empty Vault server, the mount at /secret will be
the K/V Version 2 backend by default. The API paths are subtly
different, but the new paths happen to also work with the Version 1
backend, so we can just always use the new paths in the test.
  • Loading branch information
pschultz committed May 17, 2018
1 parent 1fb35b1 commit d1ac0be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cert/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,15 @@ func vaultServer(t *testing.T, addr, rootToken string) (*exec.Cmd, *vaultapi.Cli

policy := `
# Vault < 0.7
path "secret/fabio/cert" {
path "secret/data/fabio/cert" {
capabilities = ["list"]
}
# Vault >= 0.7. Note the trailing slash.
path "secret/fabio/cert/" {
path "secret/data/fabio/cert/" {
capabilities = ["list"]
}
path "secret/fabio/cert/*" {
path "secret/data/fabio/cert/*" {
capabilities = ["read"]
}
Expand Down Expand Up @@ -415,7 +415,7 @@ func TestVaultSource(t *testing.T) {
const (
addr = "127.0.0.1:58421"
rootToken = "token"
certPath = "secret/fabio/cert"
certPath = "secret/data/fabio/cert"
)

// start a vault server
Expand Down

0 comments on commit d1ac0be

Please sign in to comment.