c8d/TestPullByDigestNoFallback: Adjust error message

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2023-09-28 14:00:07 +02:00
parent a1d966c492
commit 4001241ccf
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A

View file

@ -115,7 +115,13 @@ func testPullByDigestNoFallback(c *testing.T) {
imageReference := fmt.Sprintf("%s@sha256:ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", repoName)
out, _, err := dockerCmdWithError("pull", imageReference)
assert.Assert(c, err != nil, "expected non-zero exit status and correct error message when pulling non-existing image")
assert.Assert(c, strings.Contains(out, fmt.Sprintf("manifest for %s not found", imageReference)), "expected non-zero exit status and correct error message when pulling non-existing image")
expectedMsg := fmt.Sprintf("manifest for %s not found", imageReference)
if testEnv.UsingSnapshotter() {
expectedMsg = fmt.Sprintf("%s: not found", imageReference)
}
assert.Check(c, is.Contains(out, expectedMsg), "expected non-zero exit status and correct error message when pulling non-existing image")
}
func (s *DockerRegistrySuite) TestPullByDigestNoFallback(c *testing.T) {