vault test uses function from topgun/exec.go
@@ -4,7 +4,6 @@ import (
"fmt"
"io/ioutil"
"os"
- "os/exec"
"regexp"
"strings"
"sync"
@@ -13,8 +12,8 @@ import (
"github.com/onsi/gomega/gbytes"
"github.com/onsi/gomega/gexec"
- . "github.com/concourse/concourse/topgun/common"
. "github.com/concourse/concourse/topgun"
+ . "github.com/concourse/concourse/topgun/common"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
@@ -268,23 +267,19 @@ func (v *vault) URI() string {
}
func (v *vault) Run(command string, args ...string) *gexec.Session {
- cmd := exec.Command("vault", append([]string{command}, args...)...)
- cmd.Env = append(
+ env := append(
os.Environ(),
"VAULT_ADDR="+v.URI(),
"VAULT_TOKEN="+v.token,
)
-
if v.caCert != "" {
- cmd.Env = append(
- cmd.Env,
+ env = append(
+ env,
"VAULT_CACERT="+v.caCert,
"VAULT_SKIP_VERIFY=true",
)
}
-
- session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
- Expect(err).ToNot(HaveOccurred())
+ session := Start(env, "vault", append([]string{command}, args...)...)
Wait(session)
return session
}
