MCPcopy
hub / github.com/kopia/kopia / TestMaintenanceSetExtendObjectLocks

Function TestMaintenanceSetExtendObjectLocks

cli/command_maintenance_set_test.go:15–40  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

13)
14
15func TestMaintenanceSetExtendObjectLocks(t *testing.T) {
16 t.Parallel()
17
18 e := testenv.NewCLITest(t, testenv.RepoFormatNotImportant, testenv.NewInProcRunner(t))
19 defer e.RunAndExpectSuccess(t, "repo", "disconnect")
20
21 var mi cli.MaintenanceInfo
22
23 e.RunAndExpectSuccess(t, "repo", "create", "filesystem", "--path", e.RepoDir)
24
25 testutil.MustParseJSONLines(t, e.RunAndExpectSuccess(t, "maintenance", "info", "--json"), &mi)
26
27 require.False(t, mi.ExtendObjectLocks, "ExtendObjectLocks should not default to enabled.")
28
29 e.RunAndExpectSuccess(t, "maintenance", "set", "--extend-object-locks", "true")
30
31 testutil.MustParseJSONLines(t, e.RunAndExpectSuccess(t, "maintenance", "info", "--json"), &mi)
32
33 require.True(t, mi.ExtendObjectLocks, "ExtendObjectLocks should be enabled.")
34
35 e.RunAndExpectSuccess(t, "maintenance", "set", "--extend-object-locks", "false")
36
37 testutil.MustParseJSONLines(t, e.RunAndExpectSuccess(t, "maintenance", "info", "--json"), &mi)
38
39 require.False(t, mi.ExtendObjectLocks, "ExtendObjectLocks should be disabled.")
40}
41
42func TestMaintenanceSetListParallelism(t *testing.T) {
43 t.Parallel()

Callers

nothing calls this directly

Calls 4

RunAndExpectSuccessMethod · 0.95
NewCLITestFunction · 0.92
NewInProcRunnerFunction · 0.92
MustParseJSONLinesFunction · 0.92

Tested by

no test coverage detected