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

View file

@ -638,6 +638,11 @@ func TestAgent_Template_Basic(t *testing.T) {
vault.TestWaitActive(t, cluster.Cores[0].Core) vault.TestWaitActive(t, cluster.Cores[0].Core)
serverClient := cluster.Cores[0].Client 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 // Enable the approle auth method
req := serverClient.NewRequest("POST", "/v1/sys/auth/approle") req := serverClient.NewRequest("POST", "/v1/sys/auth/approle")
req.BodyBytes = []byte(`{ req.BodyBytes = []byte(`{
@ -912,6 +917,11 @@ func TestAgent_Template_ExitCounter(t *testing.T) {
vault.TestWaitActive(t, cluster.Cores[0].Core) vault.TestWaitActive(t, cluster.Cores[0].Core)
serverClient := cluster.Cores[0].Client 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 // Enable the approle auth method
req := serverClient.NewRequest("POST", "/v1/sys/auth/approle") req := serverClient.NewRequest("POST", "/v1/sys/auth/approle")
req.BodyBytes = []byte(`{ req.BodyBytes = []byte(`{