Commit graph

110 commits

Author SHA1 Message Date
Vincent Demeester
71d60ec0eb
Move cli.Configdir away (in flags).
This makes integration not depend anymore of `cli` and thus not
require `cobra` and other packages to compile.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-05-29 16:22:33 -07:00
Arnaud Porterie (icecrime)
32915b1d0a Remove cmd/docker and other directories in cli/ in accordance with the new Moby project scope
Starting with this commit, integration tests should no longer rely on
the docker cli, they should be API tests instead. For the existing tests
the scripts will use a frozen version of the docker cli with a
DOCKER_API_VERSION frozen to 1.30, which should ensure that the CI remains
green at all times.

To help contributors develop and test manually with a modified docker
cli, this commit also adds a DOCKER_CLI_PATH environment variable to the
Makefile. This allows to set the path of a custom cli that will be
available inside the development container and used to run the
integration tests.

Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
2017-05-05 12:14:29 -07:00
Vincent Demeester
56fb4653e8
Move FakeContext to integration-cli/cli/build/context package…
… and continue emptying `docker_utils_test.go` from build related function.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-04-11 18:25:49 +02:00
Vincent Demeester
50c4475df6
Introduce a cli package for test-integration
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-03-23 18:35:22 +01:00
Vincent Demeester
1858656925
Move TearDownTest cleaning to environment package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-03-01 21:04:11 +01:00
Vincent Demeester
c8016e669f
Use testEnv methods and remove most of the global variables
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-17 12:39:08 +01:00
Tonis Tiigi
e533685d13 Print daemon stacktrace when trust test times out
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-01-11 15:14:36 -08:00
Vincent Demeester
4300e5e881
Add a registry package with registry v1/v2 code
This extract what was in registry_test.go and
registry_mock_test.go. This also move `RegistryHosting`
requirement to `registry.Hosting`

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-01-02 11:03:53 +01:00
Vincent Demeester
433e2e8a1e
Introduce a environment package in integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-29 11:00:50 +01:00
Vincent Demeester
ce964a607a
Move package cliconfig to cli/config
I felt it made more sence 👼

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-25 20:31:52 +01:00
Aaron Lehmann
62cd3b39f9 integration-cli: Add integration tests for swarm services + content trust
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-12-14 10:50:23 -08:00
Vincent Demeester
e857785df4
Fixing win2lin builds by adding a testRequires to DockerDaemonSuite
The success of the win2lin CI before was really "by chance" on the
DockerDaemonSuite : the DockerDaemonSuite was panicking when starting
the daemon on the first non-skipped test.The suite panicked but as
the error returned from `StartWithBusybox` was nil, the test kept
going and was OK because the client had all the correct environment
variables set up to discuss with the remote daemon.

Then, as the suite panicked, no more test attached on the
DockerDaemonSuite ran (that's why on win2lin, `DockerDaemonSuite` was
only composed by 5 tests !). The really bad thing is, we didn't get
any report of the panic on the suite (go-check hiding something
somewhere).

As DockerDaemonSuite needs to run test on the same host as it's
running, this adds a `SameHostDaemon` requirement to the Suite.

This changes also make sure `TestRestartContainerWithRestartPolicy`
does left weirdies behind it.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-13 12:04:53 +01:00
Vincent Demeester
c502fb49dc Use *check.C in StartWithBusybox, Start, Stop and Restart…
… to make sure it doesn't fail. It also introduce StartWithError,
StopWithError and RestartWithError in case we care about the
error (and want the error to happen).

This removes the need to check for error and make the intent more
clear : I want a deamon with busybox loaded on it — if an error occur
it should fail the test, but it's not the test code that has the
responsability to check that.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-12 09:46:47 +01:00
Vincent Demeester
48de91a33f Extract daemon to its own package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-09 22:26:42 +01:00
Vincent Demeester
bcad3d5212
Use check in params so we don't ignore errors
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-08 10:56:29 +01:00
Anusha Ragunathan
5890091cc0 Check for valid daemon in TearDownTest.
SetupTest could fail creating a Daemon object (eg, out of space when
creating daemon root dir). In such a case, TearDownTest fails when
accessing the daemon object. This commit adds the required nil check.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-11-21 13:29:13 -08:00
Anusha Ragunathan
3e85271a64 Add plugin cleanup as part of standard TearDownTest.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-11-01 11:17:33 -07:00
Kenfe-Mickael Laventure
7781a1bf0f Make experimental a runtime flag
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2016-10-24 15:20:01 -07:00
Madhu Venugopal
af185a3806 IT for e2e network-plugin support for swarmkit & services
As of https://github.com/docker/swarmkit/pull/1607, swarmkit honors
global network plugins while allocating network resources.

This IT covers the e2e integration between libnetwork, swarmkit and
docker engine to support global network-plugins for swarm-mode

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-10-17 09:00:36 -07:00
Michael Crosby
4e2d442901 Merge pull request #26119 from cpuguy83/lazily_load_fixtures
Move some test fixtures to go
2016-09-08 11:16:27 -07:00
Jana Radhakrishnan
99a98ccc14 Add support for docker run in swarm mode overlay
This PR adds support for running regular containers to be connected to
swarm mode multi-host network so that:
    - containers connected to the same network across the cluster can
      discover and connect to each other.
    - Get access to services(and their associated loadbalancers)
      connected to the same network

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-07 21:20:41 -07:00
Brian Goff
ff91276d1f Move some test fixtures to go
moves ensure-frozen-images to go
moves ensure-syscall-test to go
moves ensure-nnp-test to go
moves ensure-httpserver to go

Also makes some of the fixtures load only for the required tests.
This makes sure that fixtures that won't be needed for a test run such as
`make TESTFLAGS='-check.f Swarm' test-integration-cli` (for example)
aren't loaded... like the syscall tests.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-09-07 17:30:35 -04:00
Michael Crosby
91e197d614 Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-07 11:05:58 -07:00
John Howard
3c6f4cd5a6 Merge pull request #25143 from cpuguy83/update_go-check
Add stack dumps from the daemon(s) on test timeout
2016-08-15 22:09:20 -07:00
Tonis Tiigi
34f779dbc3 Clear raft state file after every test
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-08-12 17:30:37 -07:00
Brian Goff
e34244842c Ignore socket rm errors on daemon suite teardown
Errors here are not important and not really related to set success/failure.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-08-10 15:18:35 -04:00
Brian Goff
82dd2c3159 Make test suites dump daemon stack on test timeout
Use `OnTimeout` callback on test timeouts to trigger a stack dump for
running daemons. This will help analyze stuck tests.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-08-10 10:26:30 -04:00
Brian Goff
4804eb700c Use temp dir for integration daemon sockets
Instead of using the bundles dir, which may be mounted in and ultimately
break if using b2d/d4mac/d4win. This makes it much easier to collect
test daemon logs and more natural for use d4mac/d4win users to run tests.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-28 12:53:56 -04:00
Aaron Lehmann
a0ccd0d42f Split advertised address from listen address
There are currently problems with "swarm init" and "swarm join" when an
explicit --listen-addr flag is not provided. swarmkit defaults to
finding the IP address associated with the default route, and in cloud
setups this is often the wrong choice.

Introduce a notion of "advertised address", with the client flag
--advertise-addr, and the daemon flag --swarm-default-advertise-addr to
provide a default. The default listening address is now 0.0.0.0, but a
valid advertised address must be detected or specified.

If no explicit advertised address is specified, error out if there is
more than one usable candidate IP address on the system. This requires a
user to explicitly choose instead of letting swarmkit make the wrong
choice. For the purposes of this autodetection, we ignore certain
interfaces that are unlikely to be relevant (currently docker*).

The user is also required to choose a listen address on swarm init if
they specify an explicit advertise address that is a hostname or an IP
address that's not local to the system. This is a requirement for
overlay networking.

Also support specifying interface names to --listen-addr,
--advertise-addr, and the daemon flag --swarm-default-advertise-addr.
This will fail if the interface has multiple IP addresses (unless it has
a single IPv4 address and a single IPv6 address - then we resolve the
tie in favor of IPv4).

This change also exposes the node's externally-reachable address in
docker info, as requested by #24017.

Make corresponding API and CLI docs changes.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-24 09:23:07 -07:00
Aaron Lehmann
2cc5bd33ee Replace secrets with join tokens
Implement the proposal from
https://github.com/docker/docker/issues/24430#issuecomment-233100121

Removes acceptance policy and secret in favor of an automatically
generated join token that combines the secret, CA hash, and
manager/worker role into a single opaque string.

Adds a docker swarm join-token subcommand to inspect and rotate the
tokens.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-07-21 15:23:03 -07:00
Brian Goff
e5ec575b32 Implement service integration tests
This is done in a hacky way as currently there is no better way.
Uses known implementation details about how tasks are scheduled to be
able to operate on the underlying container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-07-05 21:39:42 -04:00
Lei Jitang
9c1566a1df Add NoArm64 testRequires and skip Schema1RegistrySuite on arm64
schema1 manifests is not working on ARM64, we should skip integration-cli
tests for schema1 manifests on ARM64.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-07-04 10:09:46 +00:00
Alexander Morozov
9162011680 Merge pull request #23789 from tonistiigi/swarm-integration-tests
Update swarm integration tests and shutdown synchronization
2016-06-29 14:09:57 -07:00
Tonis Tiigi
caaf92f7b4 Disable iptables in swarm test daemons
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-24 15:47:37 -07:00
Tonis Tiigi
22b34d6449 Switch node management tests to api types
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-06-24 11:51:43 -07:00
Tonis Tiigi
0d88d5b64b Swarm integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-06-13 22:16:18 -07:00
Riyaz Faizullabhoy
ca57f4e6a8 Add test for targets/releases preference when pulling
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-03-21 10:56:42 -07:00
Antonio Murdaca
1b5c2e1d72 distribution: errors: do not access the errors slice if it's empty
- cherry-pick from 1.10.3 branch: 0186f4d422
- add token service test suite
- add integration test (missing in 1.10.3 branch)

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-03-16 09:00:39 +01:00
Christopher Jones
db700a678d Add notary binary requirement for tests
This PR adds the "notary" binary requirement for tests.

Previously, NotaryHosting was checking for the "notary-server"
binary under the name notaryBinary. This renames that reference to
notaryServerBinary, so that notaryBinary can rightly refer
to the actual "notary" binary.

Currently only one test actually uses the notary binary, so it's been
updated accordingly.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-03-11 17:36:12 -05:00
Christopher Jones
d800a4e1ba Fix integration-cli suite setup requirements
This PR moves the testRequires check from within setupRegistry
and setupNotary to when the Suite itself starts up.

This fixes a bug where testRequires() in setupRegistry() would
succeed and start registry, but testRequires() in setupNotary()
would fail. This immediately exits the goroutine with registry
still running.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2016-01-29 16:35:20 -05:00
Antonio Murdaca
011b4f01f4 integration-cli: add suite for testing registries with auth
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-01-24 01:02:49 +01:00
Stefan Scherer
acb42c5fab Enable DockerTrustSuite for ARM again
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
2016-01-20 14:58:09 +01:00
Stefan Scherer
4f339570cb Skip failing tests on ARM to get red/green feedback from Jenkins
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
2016-01-18 17:00:15 +01:00
Antonio Murdaca
11a95b9514 integration-cli: check nil before Close'ing
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-01-13 13:36:45 +01:00
Kim Eik
e732f4e649 Added additional container information to "docker info".
Instead of just showing the number of containers this patch will
show the number of running, paused and stopped containers as well.

Signed-off-by: Kim Eik <kim@heldig.org>
(cherry picked from commit a9804ab1cb)
2016-01-11 19:14:44 -05:00
Aaron Lehmann
1fa2e31151 Build a pre-schema2 registry to test schema1 push/pull
Add DockerSchema1RegistrySuite which uses this registry, and make
applicable integration tests run as part of this suite.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-01-08 17:27:31 -08:00
Jessica Frazelle
28ad7c588f update tests
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-10-13 15:52:14 -07:00
Jess Frazelle
4c55464dd3 Merge pull request #13777 from cpuguy83/graphdriver_extpoints
Create extpoint for graphdrivers
2015-10-08 13:46:42 -07:00
Richard Scothern
39f2f15a35 Prevent push and pull to v1 registries by filtering the available endpoints.
Add a daemon flag to control this behaviour.  Add a warning message when pulling
an image from a v1 registry.  The default order of pull is slightly altered
with this changset.

Previously it was:
https v2, https v1, http v2, http v1

now it is:
https v2, http v2, https v1, http v1

Prevent login to v1 registries by explicitly setting the version before ping to
prevent fallback to v1.

Add unit tests for v2 only mode.  Create a mock server that can register
handlers for various endpoints.  Assert no v1 endpoints are hit with legacy
registries disabled for the following commands:  pull, push, build, run and
login.  Assert the opposite when legacy registries are not disabled.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2015-09-25 15:59:42 -07:00
Brian Goff
b78e4216a2 Create extpoint for graphdrivers
Allows people to create out-of-process graphdrivers that can be used
with Docker.

Extensions must be started before Docker otherwise Docker will fail to
start.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-09-09 20:24:35 -04:00
John Howard
f9a3558a9d Windows: Get Integration CLI running
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-04 12:32:40 -07:00
Brian Goff
b3b7eb2723 Add volume API/CLI
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-08-26 13:37:52 -04:00
Zhang Wei
3d6617ffe7 fix golint warnings/errors on package api/types/
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-08-07 09:43:43 +08:00
Derek McGowan
58a1de9b59 Add integration cli trust tests
Added notary server to docker base image.
Created trust suite which runs trust server for running trusted commands.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-24 14:08:20 -07:00
Alexander Morozov
4253a1f87e Remove timer and use -check.v for tests formatting
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-06-18 14:22:40 -07:00
Alexander Morozov
57464c32b9 Implement daemon suite for integration-cli
For creating and stopping test daemons automatically.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-27 15:48:29 -07:00
Alexander Morozov
f696b1071a Implement DockerRegistrySuite in integration-cli
To avoid manually creating and destroying registrys in tests.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-24 14:17:00 -07:00
Alexander Morozov
a9688cdca5 Implement teardown removeAllImages
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-24 10:37:21 -07:00
Doug Davis
ecccfa82aa Validate we're not using the old testing stuff
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-23 10:29:47 -07:00
Alexander Morozov
dc944ea7e4 Use suite for integration-cli
It prints test name and duration for each test.
Also performs deleteAllContainers after each test.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-21 10:28:52 -07:00