Merge multiple functions for creating consul containers into one. (#6612)

Merge both functions for creating mongodb containers into one.
Add retries to docker container cleanups.
Require $VAULT_ACC be set to enable AWS tests.
This commit is contained in:
ncabatoff
2019-04-22 12:26:10 -04:00
committed by GitHub
parent e0c71cb282
commit 0f1569b7f5
28 changed files with 295 additions and 441 deletions

View File

@@ -6,11 +6,12 @@ import (
"testing"
log "github.com/hashicorp/go-hclog"
"github.com/hashicorp/vault/helper/testhelpers/docker"
"github.com/hashicorp/vault/sdk/helper/logging"
"github.com/hashicorp/vault/sdk/physical"
"github.com/ory/dockertest"
_ "github.com/lib/pq"
"github.com/ory/dockertest"
)
func TestPostgreSQLBackend(t *testing.T) {
@@ -100,10 +101,7 @@ func prepareTestContainer(t *testing.T, logger log.Logger) (cleanup func(), retC
retConnString = fmt.Sprintf("postgres://postgres@localhost:%v/postgres?sslmode=disable", resource.GetPort("5432/tcp"))
cleanup = func() {
err := pool.Purge(resource)
if err != nil {
t.Fatalf("Failed to cleanup docker Postgres: %s", err)
}
docker.CleanupResource(t, pool, resource)
}
// Provide a test function to the pool to test if docker instance service is up.