Minor test fixes necessary for eventually upgrading ci runners and engine version

Signed-off-by: Christopher Petito <chrisjpetito@gmail.com>
This commit is contained in:
Christopher Petito 2024-02-09 13:55:03 +00:00
parent 34797d1678
commit 30dd7c1319
2 changed files with 14 additions and 7 deletions

View File

@ -146,6 +146,6 @@ func TestRunWithCgroupNamespace(t *testing.T) {
environment.SkipIfCgroupNamespacesNotSupported(t) environment.SkipIfCgroupNamespacesNotSupported(t)
result := icmd.RunCommand("docker", "run", "--cgroupns=private", "--rm", fixtures.AlpineImage, result := icmd.RunCommand("docker", "run", "--cgroupns=private", "--rm", fixtures.AlpineImage,
"/bin/grep", "-q", "':memory:/$'", "/proc/1/cgroup") "cat", "/sys/fs/cgroup/cgroup.controllers")
result.Assert(t, icmd.Success) result.Assert(t, icmd.Success)
} }

View File

@ -48,7 +48,14 @@ func TestBuildFromContextDirectoryWithTag(t *testing.T) {
3: output.Suffix("Step 2/4 : COPY run /usr/bin/run"), 3: output.Suffix("Step 2/4 : COPY run /usr/bin/run"),
5: output.Suffix("Step 3/4 : RUN run"), 5: output.Suffix("Step 3/4 : RUN run"),
7: output.Suffix("running"), 7: output.Suffix("running"),
8: output.Contains("Removing intermediate container"), // TODO(krissetto): ugly, remove when no longer testing against moby 24. see https://github.com/moby/moby/pull/46270
8: func(s string) error {
err := output.Contains("Removed intermediate container")(s) // moby >= v25
if err == nil {
return nil
}
return output.Contains("Removing intermediate container")(s) // moby < v25
},
10: output.Suffix("Step 4/4 : COPY data /data"), 10: output.Suffix("Step 4/4 : COPY data /data"),
12: output.Contains("Successfully built "), 12: output.Contains("Successfully built "),
13: output.Suffix("Successfully tagged myimage:latest"), 13: output.Suffix("Successfully tagged myimage:latest"),