Skip to content

Commit 3287abc

Browse files
authored
Merge pull request moby#51187 from thaJeztah/bump_test_cli
Dockerfile: update integration-cli CLI to v25.0.5
2 parents d96f505 + 6aea8c2 commit 3287abc

28 files changed

+289
-196
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ARG DOCKERCLI_REPOSITORY="https://github.com/docker/cli.git"
1818

1919
# cli version used for integration-cli tests
2020
ARG DOCKERCLI_INTEGRATION_REPOSITORY="https://github.com/docker/cli.git"
21-
ARG DOCKERCLI_INTEGRATION_VERSION=v18.06.3-ce
21+
ARG DOCKERCLI_INTEGRATION_VERSION=v25.0.5
2222

2323
# BUILDX_VERSION is the version of buildx to install in the dev container.
2424
ARG BUILDX_VERSION=0.29.1

daemon/container_operations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ func validateEndpointSettings(nw *libnetwork.Network, nwName string, epConfig *n
533533
errs = append(errs, cerrdefs.ErrInvalidArgument.WithMessage("user specified IP address is supported on user defined networks only"))
534534
}
535535
if len(epConfig.Aliases) > 0 && !serviceDiscoveryOnDefaultNetwork() {
536-
errs = append(errs, cerrdefs.ErrInvalidArgument.WithMessage("network-scoped alias is supported only for containers in user defined networks"))
536+
errs = append(errs, cerrdefs.ErrInvalidArgument.WithMessage("network-scoped aliases are only supported for user-defined networks"))
537537
}
538538
}
539539

hack/make.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ Try {
513513
if ($Client) {
514514
# Get the Docker channel and version from the environment, or use the defaults.
515515
if (-not ($channel = $env:DOCKERCLI_CHANNEL)) { $channel = "stable" }
516-
if (-not ($version = $env:DOCKERCLI_VERSION)) { $version = "17.06.2-ce" }
516+
if (-not ($version = $env:DOCKERCLI_VERSION)) { $version = "25.0.5" }
517517

518518
# Download the zip file and extract the client executable.
519519
Write-Host "INFO: Downloading docker/cli version $version from $channel..."

integration-cli/docker_cli_build_test.go

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ type DockerCLIBuildSuite struct {
3939
ds *DockerSuite
4040
}
4141

42+
func (s *DockerCLIBuildSuite) SetUpTest(_ context.Context, t *testing.T) {
43+
// This test-suite is for the classic builder.
44+
t.Setenv("DOCKER_BUILDKIT", "0")
45+
}
46+
4247
func (s *DockerCLIBuildSuite) TearDownTest(ctx context.Context, t *testing.T) {
4348
s.ds.TearDownTest(ctx, t)
4449
}
@@ -3402,6 +3407,8 @@ func (s *DockerCLIBuildSuite) TestBuildLabelsCache(c *testing.T) {
34023407

34033408
// FIXME(vdemeester) port to docker/cli e2e tests (api tests should test suppressOutput option though)
34043409
func (s *DockerCLIBuildSuite) TestBuildNotVerboseSuccess(c *testing.T) {
3410+
c.Skip("FIXME: test breaks due to classic builder deprecation message") // FIXME(thaJeztah): test breaks due to classic builder deprecation message in output
3411+
34053412
// This test makes sure that -q works correctly when build is successful:
34063413
// stdout has only the image ID (long image ID) and stderr is empty.
34073414
outRegexp := regexp.MustCompile(`^(sha256:|)[a-z0-9]{64}\n$`)
@@ -3452,6 +3459,8 @@ func (s *DockerCLIBuildSuite) TestBuildNotVerboseSuccess(c *testing.T) {
34523459

34533460
// FIXME(vdemeester) migrate to docker/cli tests
34543461
func (s *DockerCLIBuildSuite) TestBuildNotVerboseFailureWithNonExistImage(c *testing.T) {
3462+
c.Skip("FIXME: test breaks due to classic builder deprecation message") // FIXME(thaJeztah): test breaks due to classic builder deprecation message in output
3463+
34553464
// This test makes sure that -q works correctly when build fails by
34563465
// comparing between the stderr output in quiet mode and in stdout
34573466
// and stderr output in verbose mode
@@ -3473,6 +3482,8 @@ func (s *DockerCLIBuildSuite) TestBuildNotVerboseFailureWithNonExistImage(c *tes
34733482

34743483
// FIXME(vdemeester) migrate to docker/cli tests
34753484
func (s *DockerCLIBuildSuite) TestBuildNotVerboseFailure(c *testing.T) {
3485+
c.Skip("FIXME: test breaks due to classic builder deprecation message") // FIXME(thaJeztah): test breaks due to classic builder deprecation message in output
3486+
34763487
// This test makes sure that -q works correctly when build fails by
34773488
// comparing between the stderr output in quiet mode and in stdout
34783489
// and stderr output in verbose mode
@@ -3501,6 +3512,8 @@ func (s *DockerCLIBuildSuite) TestBuildNotVerboseFailure(c *testing.T) {
35013512

35023513
// FIXME(vdemeester) migrate to docker/cli tests
35033514
func (s *DockerCLIBuildSuite) TestBuildNotVerboseFailureRemote(c *testing.T) {
3515+
c.Skip("FIXME: test breaks due to classic builder deprecation message") // FIXME(thaJeztah): test breaks due to classic builder deprecation message in output
3516+
35043517
// This test ensures that when given a wrong URL, stderr in quiet mode and
35053518
// stderr in verbose mode are identical.
35063519
// TODO(vdemeester) with cobra, stdout has a carriage return too much so this test should not check stdout
@@ -3531,6 +3544,8 @@ func (s *DockerCLIBuildSuite) TestBuildNotVerboseFailureRemote(c *testing.T) {
35313544

35323545
// FIXME(vdemeester) migrate to docker/cli tests
35333546
func (s *DockerCLIBuildSuite) TestBuildStderr(c *testing.T) {
3547+
c.Skip("FIXME: test breaks due to classic builder deprecation message") // FIXME(thaJeztah): test breaks due to classic builder deprecation message in output
3548+
35343549
// This test just makes sure that no non-error output goes
35353550
// to stderr
35363551
const name = "testbuildstderr"
@@ -3700,6 +3715,7 @@ func (s *DockerCLIBuildSuite) TestBuildFromMixedcaseDockerfile(c *testing.T) {
37003715

37013716
// FIXME(vdemeester) should migrate to docker/cli tests
37023717
func (s *DockerCLIBuildSuite) TestBuildFromURLWithF(c *testing.T) {
3718+
c.Skip("FIXME(thaJeztah): test is broken or invalid on current versions") // FIXME(thaJeztah) produces "ambiguous Dockerfile source: both stdin and flag correspond to Dockerfiles"
37033719
server := fakestorage.New(c, "", fakecontext.WithFiles(map[string]string{"baz": `FROM busybox
37043720
RUN echo from baz
37053721
COPY * /tmp/
@@ -3726,7 +3742,9 @@ RUN find /tmp/`}))
37263742

37273743
// FIXME(vdemeester) should migrate to docker/cli tests
37283744
func (s *DockerCLIBuildSuite) TestBuildFromStdinWithF(c *testing.T) {
3729-
testRequires(c, DaemonIsLinux) // TODO Windows: This test is flaky; no idea why
3745+
testRequires(c, DaemonIsLinux) // TODO Windows: This test is flaky; no idea why
3746+
c.Skip("FIXME(thaJeztah): test is broken or invalid on current versions") // FIXME(thaJeztah) produces "ambiguous Dockerfile source: both stdin and flag correspond to Dockerfiles"
3747+
37303748
ctx := fakecontext.New(c, "", fakecontext.WithDockerfile(`FROM busybox
37313749
RUN echo "from Dockerfile"`))
37323750
defer ctx.Close()
@@ -6250,7 +6268,7 @@ func (s *DockerCLIBuildSuite) TestBuildEmitsEvents(t *testing.T) {
62506268
"--since", before.Format(time.RFC3339),
62516269
),
62526270
cli.WithTimeout(time.Millisecond*300),
6253-
cli.WithEnvironmentVariables("DOCKER_API_VERSION=v1.46"), // FIXME(thaJeztah): integration-cli runs docker CLI 18.06; we're "upgrading" the API version to a version it doesn't support here ;)
6271+
cli.WithEnvironmentVariables("DOCKER_API_VERSION=v1.46"), // FIXME(thaJeztah): integration-cli runs docker CLI 25.0; we're "upgrading" the API version to a version it doesn't support here ;)
62546272
)
62556273

62566274
tc.check(t, cmd.Stdout())

integration-cli/docker_cli_build_unix_test.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,18 @@ func (s *DockerCLIBuildSuite) TestBuildResourceConstraintsAreUsed(c *testing.T)
3333
RUN ["/hello"]
3434
`))
3535
cli.Docker(
36-
cli.Args("build", "--no-cache", "--rm=false", "--memory=64m", "--memory-swap=-1", "--cpuset-cpus=0", "--cpuset-mems=0", "--cpu-shares=100", "--cpu-quota=8000", "--ulimit", "nofile=42", "--label="+buildLabel, "-t", name, "."),
36+
cli.Args("build",
37+
"--no-cache",
38+
"--rm=false",
39+
"--memory=64m",
40+
"--memory-swap=-1",
41+
"--cpuset-cpus=0",
42+
"--cpuset-mems=0",
43+
"--cpu-shares=100",
44+
"--cpu-quota=8000",
45+
"--ulimit", "nofile=42",
46+
"--label="+buildLabel,
47+
"-t", name, "."),
3748
cli.InDir(ctx.Dir),
3849
).Assert(c, icmd.Success)
3950

@@ -80,7 +91,7 @@ func (s *DockerCLIBuildSuite) TestBuildResourceConstraintsAreUsed(c *testing.T)
8091
assert.Assert(c, c2.CpusetMems != "0", "resource leaked from build for CpusetMems")
8192
assert.Assert(c, c2.CPUShares != int64(100), "resource leaked from build for CPUShares")
8293
assert.Assert(c, c2.CPUQuota != int64(8000), "resource leaked from build for CPUQuota")
83-
assert.Assert(c, c2.Ulimits == nil, "resource leaked from build for Ulimits")
94+
assert.Assert(c, len(c2.Ulimits) == 0, "resource leaked from build for Ulimits")
8495
}
8596

8697
func (s *DockerCLIBuildSuite) TestBuildAddChangeOwnership(c *testing.T) {

integration-cli/docker_cli_by_digest_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,9 @@ func (s *DockerRegistrySuite) TestPsListContainersFilterAncestorImageByDigest(t
405405
const imageName1 = "images_ps_filter_test"
406406
cli.BuildCmd(t, imageName1, build.WithDockerfile(fmt.Sprintf(
407407
`FROM %s
408-
LABEL match me 1`, imageReference)))
408+
LABEL match me 1`, imageReference)),
409+
build.WithBuildkit(false), // FIXME(thaJeztah): rewrite test to have something more predictable
410+
)
409411

410412
// run a container based on that
411413
cli.DockerCmd(t, "run", "--name=test1", imageReference, "echo", "hello")

integration-cli/docker_cli_daemon_test.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"time"
2525

2626
"github.com/cloudflare/cfssl/helpers"
27+
cerrdefs "github.com/containerd/errdefs"
2728
"github.com/creack/pty"
2829
"github.com/moby/moby/client"
2930
"github.com/moby/moby/v2/daemon/pkg/opts"
@@ -361,9 +362,10 @@ func (s *DockerDaemonSuite) TestDaemonExitOnFailure(c *testing.T) {
361362
}
362363

363364
func (s *DockerDaemonSuite) TestDaemonBridgeNone(c *testing.T) {
365+
ctx := testutil.GetContext(c)
364366
// start with bridge none
365367
d := s.d
366-
d.StartWithBusybox(testutil.GetContext(c), c, "--bridge", "none")
368+
d.StartWithBusybox(ctx, c, "--bridge", "none")
367369
defer d.Restart(c)
368370

369371
// verify docker0 iface is not there
@@ -374,9 +376,9 @@ func (s *DockerDaemonSuite) TestDaemonBridgeNone(c *testing.T) {
374376
})
375377

376378
// verify default "bridge" network is not there
377-
out, err := d.Cmd("network", "inspect", "bridge")
378-
assert.ErrorContains(c, err, "", `"bridge" network should not be present if daemon started with --bridge=none`)
379-
assert.Assert(c, is.Contains(out, "No such network"))
379+
apiClient := d.NewClientT(c)
380+
_, err := apiClient.NetworkInspect(ctx, "bridge", client.NetworkInspectOptions{})
381+
assert.ErrorType(c, err, cerrdefs.IsNotFound, `"bridge" network should not be present if daemon started with --bridge=none`)
380382
}
381383

382384
func createInterface(t *testing.T, ifType string, ifName string, ipNet string) {
@@ -725,9 +727,10 @@ func (s *DockerDaemonSuite) TestHTTPSInfoRogueCert(c *testing.T) {
725727
// > the case if the server rejects the client certificate.
726728
//
727729
// https://github.com/golang/go/blob/go1.25.1/src/crypto/tls/alert.go#L71-L72
728-
alertBadCertificate = "bad certificate" // go1.24 / TLS 1.2
729-
alertHandshakeFailure = "handshake failure" // go1.25 / TLS 1.3
730-
testDaemonHTTPSAddr = "tcp://localhost:4271"
730+
alertBadCertificate = "bad certificate" // go1.24 / TLS 1.2
731+
alertHandshakeFailure = "handshake failure" // go1.25 / TLS 1.3
732+
alertCertificateRequired = "certificate required"
733+
testDaemonHTTPSAddr = "tcp://localhost:4271"
731734
)
732735

733736
s.d.Start(c,
@@ -749,8 +752,8 @@ func (s *DockerDaemonSuite) TestHTTPSInfoRogueCert(c *testing.T) {
749752
if err == nil {
750753
c.Errorf("Expected an error, but got none; output: %s", out)
751754
}
752-
if !strings.Contains(out, alertHandshakeFailure) && !strings.Contains(out, alertBadCertificate) {
753-
c.Errorf("Expected %q or %q; output: %s", alertHandshakeFailure, alertBadCertificate, out)
755+
if !strings.Contains(out, alertHandshakeFailure) && !strings.Contains(out, alertBadCertificate) && !strings.Contains(out, alertCertificateRequired) {
756+
c.Errorf("Expected %q, %q, or %q; output: %s", alertHandshakeFailure, alertBadCertificate, alertCertificateRequired, out)
754757
}
755758
}
756759

@@ -1629,6 +1632,7 @@ func (s *DockerDaemonSuite) TestBuildOnDisabledBridgeNetworkDaemon(c *testing.T)
16291632
FROM busybox
16301633
RUN cat /etc/hosts`),
16311634
build.WithoutCache,
1635+
build.WithBuildkit(false), // FIXME(thaJeztah): doesn't work with BuildKit? 'ERROR: process "/bin/sh -c cat /etc/hosts" did not complete successfully: network bridge not found'
16321636
)
16331637
comment := fmt.Sprintf("Failed to build image. output %s, exitCode %d, err %v", result.Combined(), result.ExitCode, result.Error)
16341638
assert.Assert(c, result.Error == nil, comment)

integration-cli/docker_cli_events_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,6 @@ func (s *DockerRegistrySuite) TestEventsImageFilterPush(c *testing.T) {
553553
}
554554

555555
func (s *DockerCLIEventSuite) TestEventsFilterType(c *testing.T) {
556-
// FIXME(vdemeester) fails on e2e run
557556
testRequires(c, testEnv.IsLocalDaemon)
558557
since := daemonUnixTime(c)
559558
name := "labelfiltertest"
@@ -589,12 +588,12 @@ func (s *DockerCLIEventSuite) TestEventsFilterType(c *testing.T) {
589588
"--since", since,
590589
"--until", daemonUnixTime(c),
591590
"--filter", fmt.Sprintf("label=%s", label),
592-
"--filter", "type=container",
591+
"--filter", "type=build",
593592
).Stdout()
594593
events = strings.Split(strings.TrimSpace(out), "\n")
595594

596-
// Events generated by the container that builds the image
597-
assert.Equal(c, len(events), 2, "Events == %s", events)
595+
// Events generated the build
596+
assert.Equal(c, len(events), 1, "Events == %s", events)
598597

599598
out = cli.DockerCmd(c,
600599
"events",

integration-cli/docker_cli_external_volume_driver_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverList(c *testing.T) {
476476
func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGet(c *testing.T) {
477477
out, _, err := dockerCmdWithError("volume", "inspect", "dummy")
478478
assert.ErrorContains(c, err, "", out)
479-
assert.Assert(c, is.Contains(out, "No such volume"))
479+
assert.Assert(c, is.Contains(out, "no such volume"))
480480
assert.Equal(c, s.ec.gets, 1)
481481

482482
cli.DockerCmd(c, "volume", "create", "test", "-d", volumePluginName)
@@ -514,7 +514,7 @@ func (s *DockerExternalVolumeSuite) TestExternalVolumeDriverGetEmptyResponse(c *
514514

515515
out, err = s.d.Cmd("volume", "inspect", "abc2")
516516
assert.ErrorContains(c, err, "", out)
517-
assert.Assert(c, is.Contains(out, "No such volume"))
517+
assert.Assert(c, is.Contains(out, "no such volume"))
518518
}
519519

520520
// Ensure only cached paths are used in volume list to prevent N+1 calls to `VolumeDriver.Path`

0 commit comments

Comments
 (0)