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)
| 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 |
| 2964 | func 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 |
nothing calls this directly
no test coverage detected