test: fix TestAgent_Template_Basic (#8257)

* test: fix TestAgent_Template_Basic

* test: fix TestAgent_Template_ExitCounter
This commit is contained in:
Calvin Leung Huang 2020-01-29 09:31:29 -08:00 committed by GitHub
parent 0b7afcc728
commit d8dfd81e47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -638,6 +638,11 @@ func TestAgent_Template_Basic(t *testing.T) {
vault.TestWaitActive(t, cluster.Cores[0].Core)
serverClient := cluster.Cores[0].Client
// Unset the environment variable so that agent picks up the right test
// cluster address
defer os.Setenv(api.EnvVaultAddress, os.Getenv(api.EnvVaultAddress))
os.Setenv(api.EnvVaultAddress, serverClient.Address())
// Enable the approle auth method
req := serverClient.NewRequest("POST", "/v1/sys/auth/approle")
req.BodyBytes = []byte(`{
@ -912,6 +917,11 @@ func TestAgent_Template_ExitCounter(t *testing.T) {
vault.TestWaitActive(t, cluster.Cores[0].Core)
serverClient := cluster.Cores[0].Client
// Unset the environment variable so that agent picks up the right test
// cluster address
defer os.Setenv(api.EnvVaultAddress, os.Getenv(api.EnvVaultAddress))
os.Setenv(api.EnvVaultAddress, serverClient.Address())
// Enable the approle auth method
req := serverClient.NewRequest("POST", "/v1/sys/auth/approle")
req.BodyBytes = []byte(`{