mirror of
https://github.com/hashicorp/vault.git
synced 2025-11-29 06:31:10 +01:00
Add a static system view to github credential backend to fix acceptance tests
This commit is contained in:
parent
7a5a06f980
commit
59a3f6b5d2
@ -3,15 +3,29 @@ package github
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/vault/logical"
|
"github.com/hashicorp/vault/logical"
|
||||||
logicaltest "github.com/hashicorp/vault/logical/testing"
|
logicaltest "github.com/hashicorp/vault/logical/testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestBackend_basic(t *testing.T) {
|
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{
|
logicaltest.Test(t, logicaltest.TestCase{
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Backend: Backend(),
|
Backend: b,
|
||||||
Steps: []logicaltest.TestStep{
|
Steps: []logicaltest.TestStep{
|
||||||
testAccStepConfig(t),
|
testAccStepConfig(t),
|
||||||
testAccMap(t, "default", "root"),
|
testAccMap(t, "default", "root"),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user