diff --git a/src/ui/config/config_test.go b/src/ui/config/config_test.go index 6055ed5ec71..033dbc01b96 100644 --- a/src/ui/config/config_test.go +++ b/src/ui/config/config_test.go @@ -19,6 +19,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/vmware/harbor/src/common/utils/test" + "github.com/vmware/harbor/src/common" ) // test functions under package ui/config @@ -118,9 +119,17 @@ func TestConfig(t *testing.T) { t.Fatalf("failed to get database: %v", err) } - if _, err := ClairDB(); err != nil { + clairDB, err := ClairDB(); + if err != nil { t.Fatalf("failed to get clair DB %v", err) } + adminServerDefaultConfig := test.GetDefaultConfigMap() + assert.Equal(adminServerDefaultConfig[common.ClairDB],clairDB.Database) + assert.Equal(adminServerDefaultConfig[common.ClairDBUsername],clairDB.Username) + assert.Equal(adminServerDefaultConfig[common.ClairDBPassword],clairDB.Password) + assert.Equal(adminServerDefaultConfig[common.ClairDBHost], clairDB.Host) + assert.Equal(adminServerDefaultConfig[common.ClairDBPort], clairDB.Port) + if InternalNotaryEndpoint() != "http://notary-server:4443" { t.Errorf("Unexpected notary endpoint: %s", InternalNotaryEndpoint()) }