summaryrefslogtreecommitdiff
path: root/test/integration/datasources_vault_ec2_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/datasources_vault_ec2_test.go')
-rw-r--r--test/integration/datasources_vault_ec2_test.go35
1 files changed, 1 insertions, 34 deletions
diff --git a/test/integration/datasources_vault_ec2_test.go b/test/integration/datasources_vault_ec2_test.go
index eeeeae8b..cb7d57b5 100644
--- a/test/integration/datasources_vault_ec2_test.go
+++ b/test/integration/datasources_vault_ec2_test.go
@@ -43,7 +43,7 @@ func (s *VaultEc2DatasourcesSuite) SetUpSuite(c *C) {
http.HandleFunc("/ec2/", ec2Handler)
go http.Serve(s.l, nil)
- s.startVault(c)
+ s.pidDir, s.tmpDir, s.vaultAddr, s.vaultResult = startVault(c)
s.v, err = createVaultClient(s.vaultAddr, vaultRootToken)
handle(c, err)
@@ -58,39 +58,6 @@ func (s *VaultEc2DatasourcesSuite) SetUpSuite(c *C) {
handle(c, err)
}
-func (s *VaultEc2DatasourcesSuite) startVault(c *C) {
- s.pidDir = fs.NewDir(c, "gomplate-inttests-vaultpid")
- s.tmpDir = fs.NewDir(c, "gomplate-inttests",
- fs.WithFile("config.json", `{
- "pid_file": "`+s.pidDir.Join("vault.pid")+`"
- }`),
- )
-
- // rename any existing token so it doesn't get overridden
- u, _ := user.Current()
- homeDir := u.HomeDir
- tokenFile := path.Join(homeDir, ".vault-token")
- info, err := os.Stat(tokenFile)
- if err == nil && info.Mode().IsRegular() {
- os.Rename(tokenFile, path.Join(homeDir, ".vault-token.bak"))
- }
-
- _, s.vaultAddr = freeport()
- vault := icmd.Command("vault", "server",
- "-dev",
- "-dev-root-token-id="+vaultRootToken,
- "-log-level=trace",
- "-dev-listen-address="+s.vaultAddr,
- "-config="+s.tmpDir.Join("config.json"),
- )
- s.vaultResult = icmd.StartCmd(vault)
-
- c.Logf("Fired up Vault: %v", vault)
-
- err = waitForURL(c, "http://"+s.vaultAddr+"/v1/sys/health")
- handle(c, err)
-}
-
func (s *VaultEc2DatasourcesSuite) TearDownSuite(c *C) {
s.l.Close()