Increase stop timeout on Windows and split container and CLI exit waits.
Wait for the container to reach `exited` before timing how long the
`docker run -i` process takes to exit with stdin still open.
This keeps the regression check focused on the post-exit CLI behavior
instead of combining it with container startup time. Use a unique
container name to avoid collisions with leftovers from previous runs.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
These tests were skipped because "Windows does not support stats",
which should no longer be the case.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- use math/rand/v2
- change the util to only produce lowercase; some tests only could
use lowercase, and we don't need uppercase here, as long as it's
random.
- drop the Uniqueness test; it was effectively just testing stdlib
functionality (math/rand/v2 to be random).
- rename to RandomAlpha while we had to update call-sites
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The runSleepingContainerInImage (and runSleepingContainer) utils are
expected to return the container's ID (or name). They already assert
the command executed successfully, so let's avoid capturing output
from stderr (which could be warnings or logs).
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Migrate test api images search json content type from integration cli to integration tests
Signed-off-by: Abubacarr Ceesay <abubacarr671@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Move the useful Mounts API create coverage out of integration-cli and
into the container integration tests that own the behavior.
Add volume mount inspect assertions to TestContainerVolumeAnonymous for
destination normalization, read-only named volumes, explicit driver
configuration, and NoCopy mounts.
Add a focused bind mount inspect test for read-only bind mounts and
shared propagation.
Do not port the full integration-cli matrix. Existing integration tests
already cover anonymous volume creation and labeling, anonymous volume
removal with RemoveVolumes, and generic bind propagation handling.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Replace flaky legacy CLI restart-policy tests with container API
integration coverage.
The CLI tests poll inspect output after short-lived detached containers
exit, which can observe transient daemon monitor state while cleanup or
restart-policy handling is still settling.
On Windows this can race a manual restart against an `on-failure:3`
container that has not exhausted its automatic retries.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
TestDaemonRestartWithNames in the DockerDaemonSuite has been broken
since commit 72ec7cd6cc. The test takes
the combined output of a `docker run` command as the ID of the created
container. This works fine so long as the command emits no warnings,
otherwise it will corrupt the ID that the test captures. Modify the test
to read the ID from the command's stdout to make the test robust to
warnings being printed.
Signed-off-by: Cory Snider <csnider@mirantis.com>
The cp integration fixture only needs a stopped container with prepared
filesystem content.
Running the container detached and immediately calling `docker wait`
adds an extra daemon wait request that can race with short-lived fixture
containers and fail before the copy behavior is exercised.
Run the fixture command in the foreground and capture the resulting
container ID with a cidfile so the container remains available for later
cp assertions without the separate wait endpoint.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Implement a `dPath()` utility function that converts paths to Windows paths
(add `c:` drive-letter, and convert to backslashes) if the daemon is running
on Windows.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The test queried `docker events` without `--until` and relied on a 300ms
timeout to collect output.
On slow CI, events may not stream back within that window, resulting in
empty stdout and assertion failures.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Buildkit was enabled for Windows engines when using containerd
snapshotters in commit a9ec07a005.
Buildkit's integration tests are run on Windows in CI, but a handful of
daemon integration tests are still skipped. Change those tests to only
skip on Windows when the daemon under test is not using containerd
snapshotters.
Signed-off-by: Cory Snider <csnider@mirantis.com>
Some false positives from gosec (G602: slice index out of range)
integration-cli/daemon/daemon.go:109:1: deprecatedComment: `Deprecated: ` notices should be in a dedicated paragraph, separated from the rest (gocritic)
// Deprecated: use cli.WaitCmd instead
^
integration-cli/docker_cli_build_test.go:562:3: dupOption: function argument `build.WithFile("test_file3", "test3")` is duplicated (gocritic)
build.WithFile("test_file3", "test3"),
^
integration-cli/docker_utils_test.go:250:1: deprecatedComment: `Deprecated: ` notices should be in a dedicated paragraph, separated from the rest (gocritic)
// Deprecated: use cli.WaitFor
^
daemon/libnetwork/ipams/defaultipam/address_space.go:45:39: G602: slice index out of range (gosec)
if predefined[j].Overlaps(predefined[i].Base) {
^
daemon/libnetwork/ipams/defaultipam/address_space.go:49:29: G602: slice index out of range (gosec)
predefined[j] = predefined[i]
^
daemon/libnetwork/libnetwork_linux_test.go:1492:9: G602: slice index out of range (gosec)
sboxes[thd-1], err = controller.NewSandbox(context.Background(), fmt.Sprintf("%drace", thd))
^
daemon/libnetwork/networkdb/cluster_test.go:111:21: G602: slice index out of range (gosec)
mean, stdev := nf[0], nf[1]
^
daemon/libnetwork/osl/interface_linux.go:586:54: G602: slice index out of range (gosec)
log.G(ctx).WithField("portState", stateFileContent[0]).Debug("waiting for bridge port to be forwarding")
^
daemon/libnetwork/osl/interface_linux.go:594:32: G602: slice index out of range (gosec)
"portState": stateFileContent[0],
^
daemon/libnetwork/portallocator/osallocator_linux_test.go:358:13: G602: slice index out of range (gosec)
if payload[0] != 0x1 {
^
daemon/libnetwork/portallocator/osallocator_linux_test.go:359:68: G602: slice index out of range (gosec)
readCh <- fmt.Errorf("expected payload 0x1, but got %x", payload[0])
^
daemon/logger/gelf/gelf_test.go:197:9: nilness: impossible condition: nil != nil (govet)
if err != nil {
^
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>