@@ -3533,6 +3533,65 @@ func TestDisableAllowStarChannel(t *testing.T) {
35333533 base .DebugfCtx (t .Context (), base .KeySGTest , "additional logs" )
35343534}
35353535
3536+ // TestECCV validates if the ECCV value of the bucket is returned as a response
3537+ // for _cluster_info endpoint. ECCV value is returned for each bucket, if the
3538+ // bucket does not contain any SGW database, the value will be set to false
3539+ func TestECCV (t * testing.T ) {
3540+ if base .UnitTestUrlIsWalrus () {
3541+ t .Skip ("This test only works against Couchbase Server since it requires a gocb bucket" )
3542+ }
3543+
3544+ tests := []struct {
3545+ name string
3546+ persistentConfig bool
3547+ dbName string
3548+ }{
3549+ {
3550+ name : "PersistentConfig=true" ,
3551+ persistentConfig : true ,
3552+ dbName : "db1" ,
3553+ },
3554+ {
3555+ name : "PersistentConfig=false" ,
3556+ persistentConfig : false ,
3557+ dbName : "db2" ,
3558+ },
3559+ }
3560+
3561+ for _ , tests := range tests {
3562+ t .Run (tests .name , func (t * testing.T ) {
3563+ rt := NewRestTester (t , & RestTesterConfig {
3564+ PersistentConfig : tests .persistentConfig ,
3565+ })
3566+ defer rt .Close ()
3567+
3568+ if tests .persistentConfig {
3569+ dbConfig := rt .NewDbConfig ()
3570+ dbConfig .Name = tests .dbName
3571+
3572+ RequireStatus (t , rt .CreateDatabase (tests .dbName , dbConfig ), http .StatusCreated )
3573+ }
3574+
3575+ resp := rt .SendAdminRequest (http .MethodGet , "/_cluster_info" , "" )
3576+ RequireStatus (t , resp , http .StatusOK )
3577+
3578+ bucketName := rt .GetDatabase ().Bucket .GetName ()
3579+
3580+ type BucketInfoResponse struct {
3581+ EnableCrossClusterVersioning bool `json:"enable_cross_cluster_versioning"`
3582+ }
3583+ type ClusterInfoResponse struct {
3584+ LegacyConfig bool `json:"legacy_config,omitempty"`
3585+ Buckets map [string ]BucketInfoResponse `json:"buckets,omitempty"`
3586+ }
3587+ var clusterInfo ClusterInfoResponse
3588+ err := base .JSONUnmarshal (resp .Body .Bytes (), & clusterInfo )
3589+ require .NoError (t , err )
3590+ assert .True (t , clusterInfo .Buckets [bucketName ].EnableCrossClusterVersioning )
3591+ })
3592+ }
3593+ }
3594+
35363595func TestUnsupportedServerConfigOptions (t * testing.T ) {
35373596 tests := []struct {
35383597 name string
0 commit comments