Switch StaticSystemView values to pointers, to support updating

This commit is contained in:
Jeff Mitchell
2015-09-01 08:56:31 -04:00
parent b86f252c77
commit 6e0cee3ef4
3 changed files with 16 additions and 12 deletions

View File

@@ -23,11 +23,13 @@ var (
// Performs basic tests on CA functionality
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: time.Hour * 24,
MaxLeaseTTLVal: time.Hour * 24 * 30,
DefaultLeaseTTLVal: &defaultLeaseTTLVal,
MaxLeaseTTLVal: &maxLeaseTTLVal,
},
})
if err != nil {
@@ -49,11 +51,13 @@ func TestBackend_basic(t *testing.T) {
// Generates and tests steps that walk through the various possibilities
// of role flags to ensure that they are properly restricted
func TestBackend_roles(t *testing.T) {
defaultLeaseTTLVal := time.Hour * 24
maxLeaseTTLVal := time.Hour * 24 * 30
b, err := Factory(&logical.BackendConfig{
Logger: nil,
System: &logical.StaticSystemView{
DefaultLeaseTTLVal: time.Hour * 24,
MaxLeaseTTLVal: time.Hour * 24 * 30,
DefaultLeaseTTLVal: &defaultLeaseTTLVal,
MaxLeaseTTLVal: &maxLeaseTTLVal,
},
})
if err != nil {