(t *testing.T)
| 14 | ) |
| 15 | |
| 16 | func (s *formatSpecificTestSuite) TestContentVerify(t *testing.T) { |
| 17 | env := testenv.NewCLITest(t, s.formatFlags, testenv.NewInProcRunner(t)) |
| 18 | |
| 19 | dir := testutil.TempDirectory(t) |
| 20 | require.NoError(t, os.WriteFile(filepath.Join(dir, "file1.txt"), bytes.Repeat([]byte{1, 2, 3, 4, 5}, 15000), 0o600)) |
| 21 | |
| 22 | env.RunAndExpectSuccess(t, "repo", "create", "filesystem", "--path", env.RepoDir) |
| 23 | env.RunAndExpectSuccess(t, "content", "verify") |
| 24 | env.RunAndExpectSuccess(t, "snapshot", "create", dir) |
| 25 | env.RunAndExpectSuccess(t, "content", "verify", "--download-percent=30") |
| 26 | |
| 27 | // delete one of 'p' blobs. |
| 28 | blobIDToDelete := strings.Split(env.RunAndExpectSuccess(t, "blob", "list", "--prefix=p")[0], " ")[0] |
| 29 | blobList := env.RunAndExpectSuccess(t, "blob", "list") |
| 30 | t.Logf("blob list: %v", strings.Join(blobList, "\n")) |
| 31 | env.RunAndExpectSuccess(t, "blob", "delete", blobIDToDelete) |
| 32 | |
| 33 | _, verifyStderr, err := env.Run(t, true, "content", "verify") |
| 34 | require.Error(t, err) |
| 35 | |
| 36 | // this fails if not found |
| 37 | mustGetLineContaining(t, verifyStderr, "missing blob "+blobIDToDelete) |
| 38 | |
| 39 | env.RunAndExpectFailure(t, "content", "verify", "--full") |
| 40 | } |
nothing calls this directly
no test coverage detected