Skip to content

Commit

Permalink
Use the core client
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Jul 7, 2017
1 parent 8f97e9b commit 21a17b6
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions api/api_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/hashicorp/vault/logical"
"github.com/hashicorp/vault/vault"

cleanhttp "github.com/hashicorp/go-cleanhttp"
vaulthttp "github.com/hashicorp/vault/http"
logxi "github.com/mgutz/logxi/v1"
dockertest "gopkg.in/ory-am/dockertest.v3"
Expand Down Expand Up @@ -52,17 +51,10 @@ func testVaultServerBackends(t testing.TB, backends map[string]logical.Factory)
core := cores[0].Core
vault.TestWaitActive(t, core)

// Grab the root token
rootToken := cores[0].Root
address := fmt.Sprintf("https://127.0.0.1:%d", cores[1].Listeners[0].Address.Port)

config := api.DefaultConfig()
config.Address = address
config.HttpClient = cleanhttp.DefaultClient()
config.HttpClient.Transport.(*http.Transport).TLSClientConfig = cores[0].TLSConfig
client, err := api.NewClient(config)
if err != nil {
t.Fatalf("error creating vault cluster: %s", err)
}
client := cores[0].Client
client.SetToken(rootToken)

// Sanity check
Expand Down

0 comments on commit 21a17b6

Please sign in to comment.