(t *testing.T)
| 71 | } |
| 72 | |
| 73 | func TestLogsMaintenance(t *testing.T) { |
| 74 | t.Parallel() |
| 75 | |
| 76 | runner := testenv.NewInProcRunner(t) |
| 77 | e := testenv.NewCLITest(t, testenv.RepoFormatNotImportant, runner) |
| 78 | |
| 79 | e.RunAndExpectSuccess(t, "repo", "create", "filesystem", "--path", e.RepoDir) |
| 80 | defer e.RunAndExpectSuccess(t, "repo", "disconnect") |
| 81 | |
| 82 | time.Sleep(time.Second) |
| 83 | e.RunAndExpectSuccess(t, "snapshot", "create", testutil.TempDirectory(t)) |
| 84 | time.Sleep(time.Second) |
| 85 | e.RunAndExpectSuccess(t, "snapshot", "create", testutil.TempDirectory(t)) |
| 86 | time.Sleep(time.Second) |
| 87 | e.RunAndExpectSuccess(t, "snapshot", "create", testutil.TempDirectory(t)) |
| 88 | e.RunAndVerifyOutputLineCount(t, 4, "logs", "list") |
| 89 | |
| 90 | e.RunAndExpectSuccess(t, "maintenance", "set", "--max-retained-log-count=2") |
| 91 | e.RunAndVerifyOutputLineCount(t, 5, "logs", "list") |
| 92 | |
| 93 | e.RunAndExpectSuccess(t, "maintenance", "run", "--full") |
| 94 | |
| 95 | // maintenance run will create a new log and keep previous 2 logs |
| 96 | e.RunAndVerifyOutputLineCount(t, 3, "logs", "list") |
| 97 | |
| 98 | e.RunAndExpectSuccess(t, "maintenance", "set", "--max-retained-log-age=1ms") |
| 99 | |
| 100 | // maintenance does not run here |
| 101 | e.RunAndVerifyOutputLineCount(t, 4, "logs", "list") |
| 102 | |
| 103 | e.RunAndExpectSuccess(t, "maintenance", "run", "--full") |
| 104 | |
| 105 | // maintenance run will create a new log and delete all previous logs |
| 106 | e.RunAndVerifyOutputLineCount(t, 1, "logs", "list") |
| 107 | } |
| 108 | |
| 109 | func TestLogsMaintenanceSet(t *testing.T) { |
| 110 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…