MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / TestCreateDBWithXattrsDisabled

Function TestCreateDBWithXattrsDisabled

rest/api_test.go:2964–2991  ·  view source on GitHub ↗

TestCreateDBWithXattrsDisabled: - Test that you cannot create a database with xattrs disabled - Test that an existing database cannot be loaded with xattrs disabled after upgrade - Assert error code is returned and response contains error string

(t *testing.T)

Source from the content-addressed store, hash-verified

2962// - Test that an existing database cannot be loaded with xattrs disabled after upgrade
2963// - Assert error code is returned and response contains error string
2964func TestCreateDBWithXattrsDisabled(t *testing.T) {
2965 rt := NewRestTester(t, &RestTesterConfig{
2966 PersistentConfig: true,
2967 })
2968 defer rt.Close()
2969 const (
2970 dbName = "db1"
2971 errResp = "sync gateway requires enable_shared_bucket_access=true"
2972 )
2973
2974 dbConfig := rt.NewDbConfig()
2975 dbConfig.EnableXattrs = base.Ptr(false)
2976
2977 resp := rt.CreateDatabase(dbName, dbConfig)
2978 RequireStatus(t, resp, http.StatusInternalServerError)
2979 assert.Contains(t, resp.Body.String(), errResp)
2980
2981 dbConfig = rt.NewDbConfig()
2982 resp = rt.CreateDatabase(dbName, dbConfig)
2983 RequireStatus(t, resp, http.StatusCreated)
2984
2985 rt.updatePersistedConfig(dbName, func(config *DatabaseConfig) {
2986 config.EnableXattrs = base.Ptr(false)
2987 })
2988
2989 _, err := rt.RestTesterServerContext.ReloadDatabase(t.Context(), dbName, false)
2990 assert.Error(t, err, errResp)
2991}
2992
2993// TestPvDeltaReadAndWrite:
2994// - Write a doc from another hlv aware peer to the bucket

Callers

nothing calls this directly

Calls 12

CloseMethod · 0.95
NewDbConfigMethod · 0.95
CreateDatabaseMethod · 0.95
updatePersistedConfigMethod · 0.95
PtrFunction · 0.92
NewRestTesterFunction · 0.85
RequireStatusFunction · 0.85
ReloadDatabaseMethod · 0.80
ContainsMethod · 0.65
StringMethod · 0.65
ContextMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected