Skip to content

Commit 205753e

Browse files
pschultzmagiconair
authored andcommitted
Make tests work with vault 0.7.x (#313)
Starting with Vault 0.7 list operations always use paths with a trailing slash, so the policy used in testing has to allow that path in addition to the one without a trailing slash.
1 parent e5f6a43 commit 205753e

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ before_script:
1212
- mkdir -p $GOPATH/bin
1313
- wget --version
1414
- wget https://releases.hashicorp.com/consul/0.8.3/consul_0.8.3_linux_amd64.zip
15-
- wget https://releases.hashicorp.com/vault/0.6.5/vault_0.6.5_linux_amd64.zip
15+
- wget https://releases.hashicorp.com/vault/0.7.3/vault_0.7.3_linux_amd64.zip
1616
- unzip -d $GOPATH/bin consul_0.8.3_linux_amd64.zip
17-
- unzip -d $GOPATH/bin vault_0.6.5_linux_amd64.zip
17+
- unzip -d $GOPATH/bin vault_0.7.3_linux_amd64.zip
1818
- vault --version
1919
- consul --version

cert/source_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,14 @@ func vaultServer(t *testing.T, addr, rootToken string) (*exec.Cmd, *vaultapi.Cli
325325
}
326326

327327
policy := `
328+
# Vault < 0.7
328329
path "secret/fabio/cert" {
329330
capabilities = ["list"]
330331
}
332+
# Vault >= 0.7. Note the trailing slash.
333+
path "secret/fabio/cert/" {
334+
capabilities = ["list"]
335+
}
331336
332337
path "secret/fabio/cert/*" {
333338
capabilities = ["read"]

0 commit comments

Comments
 (0)