From a86c1ba264bca2fe13e2d6ecf18c1ce9cb6b6254 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Mon, 29 Feb 2016 14:41:14 -0500 Subject: [PATCH] Only run PKI backend setup functions when TF_ACC is set --- builtin/logical/pki/backend_test.go | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/builtin/logical/pki/backend_test.go b/builtin/logical/pki/backend_test.go index 78091ad3be..34e20f1d4c 100644 --- a/builtin/logical/pki/backend_test.go +++ b/builtin/logical/pki/backend_test.go @@ -36,6 +36,10 @@ var ( // Performs basic tests on CA functionality // Uses the RSA CA key func TestBackend_RSAKey(t *testing.T) { + if os.Getenv("TF_ACC") == "" { + return + } + defaultLeaseTTLVal := time.Hour * 24 maxLeaseTTLVal := time.Hour * 24 * 30 b, err := Factory(&logical.BackendConfig{ @@ -66,6 +70,10 @@ func TestBackend_RSAKey(t *testing.T) { // Performs basic tests on CA functionality // Uses the EC CA key func TestBackend_ECKey(t *testing.T) { + if os.Getenv("TF_ACC") == "" { + return + } + defaultLeaseTTLVal := time.Hour * 24 maxLeaseTTLVal := time.Hour * 24 * 30 b, err := Factory(&logical.BackendConfig{ @@ -94,6 +102,10 @@ func TestBackend_ECKey(t *testing.T) { } func TestBackend_CSRValues(t *testing.T) { + if os.Getenv("TF_ACC") == "" { + return + } + defaultLeaseTTLVal := time.Hour * 24 maxLeaseTTLVal := time.Hour * 24 * 30 b, err := Factory(&logical.BackendConfig{ @@ -122,6 +134,10 @@ func TestBackend_CSRValues(t *testing.T) { } func TestBackend_URLsCRUD(t *testing.T) { + if os.Getenv("TF_ACC") == "" { + return + } + defaultLeaseTTLVal := time.Hour * 24 maxLeaseTTLVal := time.Hour * 24 * 30 b, err := Factory(&logical.BackendConfig{ @@ -153,6 +169,10 @@ func TestBackend_URLsCRUD(t *testing.T) { // of role flags to ensure that they are properly restricted // Uses the RSA CA key func TestBackend_RSARoles(t *testing.T) { + if os.Getenv("TF_ACC") == "" { + return + } + defaultLeaseTTLVal := time.Hour * 24 maxLeaseTTLVal := time.Hour * 24 * 30 b, err := Factory(&logical.BackendConfig{ @@ -195,6 +215,10 @@ func TestBackend_RSARoles(t *testing.T) { // of role flags to ensure that they are properly restricted // Uses the RSA CA key func TestBackend_RSARoles_CSR(t *testing.T) { + if os.Getenv("TF_ACC") == "" { + return + } + defaultLeaseTTLVal := time.Hour * 24 maxLeaseTTLVal := time.Hour * 24 * 30 b, err := Factory(&logical.BackendConfig{ @@ -237,6 +261,10 @@ func TestBackend_RSARoles_CSR(t *testing.T) { // of role flags to ensure that they are properly restricted // Uses the EC CA key func TestBackend_ECRoles(t *testing.T) { + if os.Getenv("TF_ACC") == "" { + return + } + defaultLeaseTTLVal := time.Hour * 24 maxLeaseTTLVal := time.Hour * 24 * 30 b, err := Factory(&logical.BackendConfig{ @@ -279,6 +307,10 @@ func TestBackend_ECRoles(t *testing.T) { // of role flags to ensure that they are properly restricted // Uses the EC CA key func TestBackend_ECRoles_CSR(t *testing.T) { + if os.Getenv("TF_ACC") == "" { + return + } + defaultLeaseTTLVal := time.Hour * 24 maxLeaseTTLVal := time.Hour * 24 * 30 b, err := Factory(&logical.BackendConfig{