From 59a3f6b5d2b3299c63e9112c28526c7b8a84961c Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Tue, 29 Sep 2015 18:55:59 -0700 Subject: [PATCH] Add a static system view to github credential backend to fix acceptance tests --- builtin/credential/github/backend_test.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/builtin/credential/github/backend_test.go b/builtin/credential/github/backend_test.go index bb9373a23a..4105bcbb7e 100644 --- a/builtin/credential/github/backend_test.go +++ b/builtin/credential/github/backend_test.go @@ -3,15 +3,29 @@ package github import ( "os" "testing" + "time" "github.com/hashicorp/vault/logical" logicaltest "github.com/hashicorp/vault/logical/testing" ) func TestBackend_basic(t *testing.T) { + defaultLeaseTTLVal := time.Hour * 24 + maxLeaseTTLVal := time.Hour * 24 * 30 + b, err := Factory(&logical.BackendConfig{ + Logger: nil, + System: &logical.StaticSystemView{ + DefaultLeaseTTLVal: defaultLeaseTTLVal, + MaxLeaseTTLVal: maxLeaseTTLVal, + }, + }) + if err != nil { + t.Fatalf("Unable to create backend: %s", err) + } + logicaltest.Test(t, logicaltest.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Backend: Backend(), + Backend: b, Steps: []logicaltest.TestStep{ testAccStepConfig(t), testAccMap(t, "default", "root"),