From c979c1ee5dbbc40fd3db7fa66310857daaf2cee2 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 11 Jun 2021 15:19:43 +0000 Subject: [PATCH] make sure the test can work if no config file loaded --- src/bunker_test.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bunker_test.go b/src/bunker_test.go index 3f812ac..4ec0264 100644 --- a/src/bunker_test.go +++ b/src/bunker_test.go @@ -97,9 +97,17 @@ func init() { db.store.InitUserApps() var cfg Config cfile := "../databunker.yaml" - readConfFile(&cfg, &cfile) + err = readConfFile(&cfg, &cfile) cfg.SelfService.AppRecordChange = []string{"testapp", "super"} - cfg.Generic.CreateUserWithoutAccessToken = true + if err != nil { + cfg.SelfService.ForgetMe = false + cfg.SelfService.UserRecordChange = true + cfg.Generic.CreateUserWithoutAccessToken = true + cfg.Policy.MaxUserRetentionPeriod = "1m" + cfg.Policy.MaxAuditRetentionPeriod = "12m" + cfg.Policy.MaxSessionRetentionPeriod = "1h" + cfg.Policy.MaxShareableRecordRetentionPeriod = "1m" + } e := mainEnv{db, cfg, make(chan struct{})} rootToken2, err := e.db.getRootXtoken() if err != nil {