Skip to content

Commit

Permalink
Allow tests to work with couchbases:// (#6470)
Browse files Browse the repository at this point in the history
  • Loading branch information
torcolvin authored Sep 26, 2023
1 parent 1a2b934 commit f7b2ac8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion base/bootstrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestBootstrapRefCounting(t *testing.T) {
x509KeyPath := ""
caCertPath := ""
forcePerBucketAuth := false
tlsSkipVerify := BoolPtr(false)
tlsSkipVerify := BoolPtr(TestTLSSkipVerify())
var perBucketCredentialsConfig map[string]*CredentialsConfig
ctx := TestCtx(t)
cluster, err := NewCouchbaseCluster(ctx, UnitTestUrl(), TestClusterUsername(), TestClusterPassword(), x509CertPath, x509KeyPath, caCertPath, forcePerBucketAuth, perBucketCredentialsConfig, tlsSkipVerify, BoolPtr(TestUseXattrs()), CachedClusterConnections)
Expand Down
3 changes: 2 additions & 1 deletion rest/config_legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ func TestLegacyConfigPrinciplesMigration(t *testing.T) {
// Config to migrate to persistent config on bucket
config := `
{
"server_tls_skip_verify": %t,
"databases": {
"db": {
"server": "%s",
Expand All @@ -424,7 +425,7 @@ func TestLegacyConfigPrinciplesMigration(t *testing.T) {
}
}
}`
config = fmt.Sprintf(config, base.UnitTestUrl(), base.TestClusterUsername(), base.TestClusterPassword(), rt.Bucket().GetName())
config = fmt.Sprintf(config, base.TestTLSSkipVerify(), base.UnitTestUrl(), base.TestClusterUsername(), base.TestClusterPassword(), rt.Bucket().GetName())

tmpDir := t.TempDir()

Expand Down
10 changes: 8 additions & 2 deletions rest/server_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,14 @@ func TestDisableScopesInLegacyConfig(t *testing.T) {
t.Run(fmt.Sprintf("persistent_config=%t", persistentConfig), func(t *testing.T) {

ctx := base.TestCtx(t)
serverConfig := &StartupConfig{}
serverContext := NewServerContext(ctx, serverConfig, persistentConfig)
startupConfig := &StartupConfig{
Bootstrap: BootstrapConfig{
UseTLSServer: base.BoolPtr(base.ServerIsTLS(base.UnitTestUrl())),
ServerTLSSkipVerify: base.BoolPtr(base.TestTLSSkipVerify()),
},
}

serverContext := NewServerContext(ctx, startupConfig, persistentConfig)
defer serverContext.Close(ctx)

dbConfig := DbConfig{
Expand Down

0 comments on commit f7b2ac8

Please sign in to comment.