54 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
95fac07ccc client/secrets: Wrap results and options
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 23:18:39 +02:00
Sebastiaan van Stijn
2c5e0a008a client: rename ConfigListResult.Configs to ConfigListResult.Items
Also consolidate the options with the method.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-10-21 20:43:38 +02:00
Paweł Gronowski
ee22a50b75 client/config: Use Config instead of Spec as field
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-20 22:29:36 +02:00
Paweł Gronowski
f4b06e66e1 client/config: Wrap results and options
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-10-20 22:29:36 +02:00
Cory Snider
7ea066c8d1 client: add Filters type
Add a new type to use for building filter predicates for API requests,
replacing "./api/types/filters".Args in the client. Remove the now
unused api/types/filters package.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-10-08 12:06:31 -04:00
Sebastiaan van Stijn
082b4e8d77 client: move ExecOptions to client
- move api/types/container.ExecOptions to the client
- rename api/types/container.ExecOptions to ExecCreateRequest

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-15 17:37:47 +02:00
Sebastiaan van Stijn
d3e45f8743 testutil: move back to internal
This package was originally internal, but was moved out when BuildKit
used it for its integration tests. That's no longer the case, so we
can make it internal again.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-08 10:08:30 +02:00
Austin Vazquez
b1260cd493 api/types/swarm: move ConfigListOptions to client
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-26 07:21:05 -05:00
Derek McGowan
f74e5d48b3 Create github.com/moby/moby/v2 module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-31 10:13:29 -07:00
Derek McGowan
1da417980c Move api/stdcopy to api/pkg/stdcopy
Signed-off-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-30 14:22:30 +02:00
Sebastiaan van Stijn
20d594fb79 deprecate pkg/stdcopy, move to api/stdcopy
The stdcopy package is used to produce and read multiplexed streams for
"attach" and "logs". It is used both by the API server (to produce), and
the client (to read / de-multiplex).

Move it to the api package, so that it can be included in the api module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-21 21:41:39 +02:00
Derek McGowan
c47afd41c8 Create github.com/moby/moby/client module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-21 09:30:26 -07:00
Derek McGowan
afd6487b2e Create github.com/moby/moby/api module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-21 09:30:05 -07:00
Matthieu MOREL
e5be7b54b1 fix yodaStyleExpr from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:58 +02:00
Sebastiaan van Stijn
4970333621 integration: remove // import comments
These comments were added to enforce using the correct import path for
our packages ("github.com/docker/docker", not "github.com/moby/moby").
However, when working in go module mode (not GOPATH / vendor), they have
no effect, so their impact is limited.

Remove these imports in preparation of migrating our code to become an
actual go module.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-30 15:59:14 +02:00
Matthieu MOREL
14852fcd82 integration: replace uses of errdefs package
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-28 05:39:50 +00:00
Sebastiaan van Stijn
a411a39be0 api/types: move ConfigCreateResponse, ConfigListOptions to types/swarm
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-19 09:39:23 +02:00
Sebastiaan van Stijn
816f3fa516 integration: remove assertAttachedStream, check both STDERR and STDOUT
This helper was not marked as t.Helper(), and didn't do a great job at
actually asserting the expected output streams. The existing checks
could've been replaced by a io.Readall to do a fuzzy check for the
response, but let's abstract away what it's doing, and properly check
both STDOUT and STDERR.

    make BIND_DIR=. TEST_FILTER='TestTemplated' DOCKER_GRAPHDRIVER=vfs test-integration
    ...
    INFO: Testing against a local daemon
    === RUN   TestTemplatedConfig
    --- PASS: TestTemplatedConfig (11.73s)
    PASS
    INFO: Testing against a local daemon
    === RUN   TestTemplatedSecret
    --- PASS: TestTemplatedSecret (11.04s)
    PASS

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-26 16:12:58 +01:00
Sebastiaan van Stijn
c0de852afa integration/config: remove redundant capturing of loop vars (copyloopvar)
integration/config/config_test.go:111:3: The copy of the 'for' variable "tc" can be deleted (Go 1.22+) (copyloopvar)
            tc := tc
            ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-11-12 14:02:10 +01:00
Sebastiaan van Stijn
cd76e3e7f8 api/types: move ExecConfig to api/types/container
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-10 10:19:46 +02:00
Djordje Lukic
d5425f28ae Don't run tests twice
It's useless

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
2023-09-19 11:37:55 +02:00
Brian Goff
e8dc902781 Wire up tests to support otel tracing
Integration tests will now configure clients to propagate traces as well
as create spans for all tests.

Some extra changes were needed (or desired for trace propagation) in the
test helpers to pass through tracing spans via context.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-09-07 18:38:22 +00:00
Sebastiaan van Stijn
07e6b0ac70 integration: format code with gofumpt
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-08-24 17:55:14 +02:00
Sebastiaan van Stijn
ddec605aef integration: use string-literals for easier grep'ing
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-05 12:27:01 +02:00
Sebastiaan van Stijn
786e6d80ba integration: fix empty-lines (revive)
integration/config/config_test.go:106:31: empty-lines: extra empty line at the end of a block (revive)
    integration/secret/secret_test.go:106:31: empty-lines: extra empty line at the end of a block (revive)
    integration/network/service_test.go:58:50: empty-lines: extra empty line at the end of a block (revive)
    integration/network/service_test.go:401:58: empty-lines: extra empty line at the end of a block (revive)
    integration/system/event_test.go:30:38: empty-lines: extra empty line at the end of a block (revive)
    integration/plugin/logging/read_test.go:19:41: empty-lines: extra empty line at the end of a block (revive)
    integration/service/list_test.go:30:48: empty-lines: extra empty line at the end of a block (revive)
    integration/service/create_test.go:400:46: empty-lines: extra empty line at the start of a block (revive)
    integration/container/logs_test.go:156:42: empty-lines: extra empty line at the end of a block (revive)
    integration/container/daemon_linux_test.go:135:44: empty-lines: extra empty line at the end of a block (revive)
    integration/container/restart_test.go:160:62: empty-lines: extra empty line at the end of a block (revive)
    integration/container/wait_test.go:181:47: empty-lines: extra empty line at the end of a block (revive)
    integration/container/restart_test.go:116:30: empty-lines: extra empty line at the end of a block (revive)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-09-28 01:58:50 +02:00
Rich Horwood
8f80e55111 Add configuration validation option and tests.
Fixes #36911

If config file is invalid we'll exit anyhow, so this just prevents
the daemon from starting if the configuration is fine.

Mainly useful for making config changes and restarting the daemon
iff the config is valid.

Signed-off-by: Rich Horwood <rjhorwood@apple.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
2021-06-23 09:54:55 +00:00
Sebastiaan van Stijn
cdc39fa29c integration/config: add check for removing non-existing config
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-14 18:31:38 +02:00
Sebastiaan van Stijn
632cc7019a integration/config: remove check that was already done in TestConfigInspect
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-14 18:31:34 +02:00
Sebastiaan van Stijn
26f2eddaa3 integration/config: combine TestConfigCreateWithLabels with TestConfigsCreateAndDelete
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-14 18:31:29 +02:00
Sebastiaan van Stijn
18cae89436 integration/config: don't string-match errors
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-14 18:31:24 +02:00
Sebastiaan van Stijn
348f412d85 integration: sync minor changes between config and secret tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-14 18:31:22 +02:00
Sebastiaan van Stijn
25424cf772 integration/config: move functions to be in line with "secret" tests
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-14 18:31:19 +02:00
Sebastiaan van Stijn
dd67b4794e integration/config: TestTemplatedConfig: simplify task code
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-14 18:31:13 +02:00
Sebastiaan van Stijn
ec78112edd integration/config: rename variables that collided with imported package name
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-04-14 18:31:11 +02:00
Sebastiaan van Stijn
9f0b3f5609 bump gotest.tools v3.0.1 for compatibility with Go 1.14
full diff: https://github.com/gotestyourself/gotest.tools/compare/v2.3.0...v3.0.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-11 00:06:42 +01:00
Sam Whited
b37c214e3c testutil: make testing packages public
This was done with something along the lines of:

```
mv internal/test testutil
pushd testutil/; grep -IRl "package test" | xargs -I '{}' sed -i -e 's|package test|package testutil|g' {}; popd
mv internal/testutil/*.go testutil/ && rm -rf internal/
grep -IRl "github.com\/docker\/docker\/internal\/test" | xargs -I '{}' sed -i -e 's|github.com/docker/docker/internal/test|github.com/docker/docker/test|g' {}
goimports .
```

I also modified the basic plugin path in testutil/fixtures/plugin.

Signed-off-by: Sam Whited <sam@samwhited.com>
2019-09-11 07:47:23 -05:00
Tibor Vass
f923321aae Add test for keeping same daemon ID on upgrade
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-06-18 01:40:25 +00:00
Yong Tang
68e266ee3a Replace waitAndAssert in config_test.go with poll.WaitOn
This fix replaces waitAndAssert in config_test.go with poll.WaitOn
so that the testing is consistent with all other tests in integration.

Also, config_test.go uses to wait and sleep for 2 * (1 minutes) to get the task
info. This fix combined those two sleep and wait for 1 mins. Think 1 min
is enough for config test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-01-15 03:54:52 +00:00
Sebastiaan van Stijn
8172edf04c GetRunningTasks: pass client instead of daemon
Tests generally already have a client instance, so it
probably makes more sense to just pass it, and make
this utility a bit more flexible to use.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-01-14 02:30:40 +01:00
Vincent Demeester
d3cc071bb9 Windows: Start of enabling tests under integration/
- Add windows CI entrypoint script.

Signed-off-by: John Howard <jhoward@microsoft.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-09-26 12:28:22 -07:00
Arash Deshmeh
0e57ceae0d moved integration tests from docker_cli_config_create_test.go to integration/config
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-07-13 17:29:02 -04:00
Vincent Demeester
3845728524 Update tests to use gotest.tools 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-06-13 09:04:30 +02:00
Sebastiaan van Stijn
f23c00d870 Various code-cleanup
remove unnescessary import aliases, brackets, and so on.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-23 17:50:54 +02:00
Sebastiaan van Stijn
55bebbaecf Replace deprecated testutil.ErrorContains()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-05-21 00:13:04 +02:00
Kir Kolyshkin
7d62e40f7e Switch from x/net/context -> context
Since Go 1.7, context is a standard package. Since Go 1.9, everything
that is provided by "x/net/context" is a couple of type aliases to
types in "context".

Many vendored packages still use x/net/context, so vendor entry remains
for now.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2018-04-23 13:52:44 -07:00
Vincent Demeester
239a8a5189 Small daemon refactoring and add swarm init/join helpers
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-04-16 10:20:10 +02:00
Arash Deshmeh
69481edc07 integration tests under integration/config use unique names when creating resources
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-04-06 06:06:02 -04:00
Daniel Nephin
6be0f70983 Automated migration using
gty-migrate-from-testify --ignore-build-tags

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-03-16 11:03:43 -04:00
Yong Tang
9045406144 Add missing canonical import comment to files in integration tests
The  canonical import comment was added some time ago, though several
newly added files do not have the comment. This fix adds the missing
canonical import comment to files in integration tests

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-03-01 22:51:11 +00:00
Yong Tang
4b99d78207 Migrate config inspect test to api test
This fix migrates config inspect test in integration-cli
to api test.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-02-27 23:25:07 +00:00