Add a static system view to github credential backend to fix acceptance tests

This commit is contained in:
Jeff Mitchell
2015-09-29 18:55:59 -07:00
parent 7a5a06f980
commit 59a3f6b5d2

View File

@@ -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"),