c8d: test a backend dependent error on pull

moby and containerd have slightly different error messages when someone
tries to pull an image that doesn't contain the current platform,
instead of looking inside the error returned by containerd we match the
errors in the test related to what image backend we are using

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
This commit is contained in:
Djordje Lukic 2023-09-20 14:47:51 +02:00
parent 7cfb81ba04
commit 3936c57294
No known key found for this signature in database

View file

@ -285,5 +285,11 @@ func (s *DockerCLIPullSuite) TestPullLinuxImageFailsOnWindows(c *testing.T) {
func (s *DockerCLIPullSuite) TestPullWindowsImageFailsOnLinux(c *testing.T) {
testRequires(c, DaemonIsLinux, Network)
_, _, err := dockerCmdWithError("pull", "mcr.microsoft.com/windows/servercore:ltsc2022")
assert.ErrorContains(c, err, "no matching manifest for linux")
errorMessage := "no matching manifest for linux"
if testEnv.UsingSnapshotter() {
errorMessage = "no match for platform in manifest"
}
assert.ErrorContains(c, err, errorMessage)
}