Commit Graph

34 Commits

Author SHA1 Message Date
45b389fec8 Replace some checkers and assertions with gotest.tools
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6345208b9b067f19f7792edcc675f59a617a3ca5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9a4d7bb0e25169fa7d48e24777c683587c29c25a
Component: engine
2019-04-17 23:10:05 +02:00
a24b673f22 fix and skip some tests based on API version
Signed-off-by: Anda Xu <anda.xu@docker.com>

Co-authored-by: Anda Xu <anda.xu@docker.com>
Co-authored-by: Tibor Vass <tibor@docker.com>
Upstream-commit: e440831802a500b28ecf16c2627a294dc31dfeb9
Component: engine
2018-05-15 16:05:04 -07:00
a05c5e914a Move integration-cli/request to internal/test/request…
… and change a bit the method signature

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 42f6fdf059807ecbe66cce90676021363a541154
Component: engine
2018-04-17 16:25:59 +02:00
d1c8c580ed Remove deprecated environment.DaemonPlatform()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 18a771a761654e241ae8d1e85aa0c0a6164c5d27
Component: engine
2018-01-15 15:32:06 +01:00
56e5cffbc1 Remove testutil.ReadBody
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4f304e72a2e4451b043ab1a73a6c44894333c5c7
Component: engine
2017-08-22 17:15:26 -04:00
39c495c1d1 Remove config tests, which are now unit tests in docker/cli
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c467a112050d595ca0b48122cd4ce81fcf6cefde
Component: engine
2017-08-18 14:24:52 -04:00
30f1b651e2 Remove string checking in API error handling
Use strongly typed errors to set HTTP status codes.
Error interfaces are defined in the api/errors package and errors
returned from controllers are checked against these interfaces.

Errors can be wraeped in a pkg/errors.Causer, as long as somewhere in the
line of causes one of the interfaces is implemented. The special error
interfaces take precedence over Causer, meaning if both Causer and one
of the new error interfaces are implemented, the Causer is not
traversed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: ebcb7d6b406fe50ea9a237c73004d75884184c33
Component: engine
2017-08-15 16:01:11 -04:00
cdaff4626f Fix TestAPIDockerAPIVersion on windows
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 8c7fdddf480b39b79c688e1d555ca7f18fc5fd70
Component: engine
2017-03-29 10:28:51 +02:00
de10a198b8 [test-integration] Migrate some more tests to cli package
Add some required command operators to the `cli` package, and update
some tests to use this package, in order to remove a few functions
from `docker_utils_test.go`

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: eeaa6c96d83575da765dfc626c2c73d8a29dda32
Component: engine
2017-03-28 15:17:31 +02:00
fea75fa014 Update request.* signature to remove the host
99.9% of use case for request call are using daemonHost. This makes it
default and adds a `request.DoOnHost` function to be able to specify
the host for specific, more complex use cases.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: b11ba1231ef0ac99279ed5dcd76d81413d7d63b5
Component: engine
2017-03-06 16:41:33 +01:00
b8d05e7498 Convert request.SockRequestRaw to appropriate methods
`request.SockRequestRaw` is deprecated, let's use appropriate methods
for those. This is a first pass, `SockRequest` still needs to be removed.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: f85ee17810ca55a3104f8a7d8945bd16ac526dd0
Component: engine
2017-02-28 17:12:30 +01:00
f7b8e381ec Use testEnv methods and remove most of the global variables
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c8016e669f9507480745a441ba4cd735150ebb85
Component: engine
2017-01-17 12:39:08 +01:00
44a6bbe938 Add a new request package in integration-cli
The goal is to remove function from `docker_utils.go` and setup
simple, one-responsability package that can be well tested ; and to
ease writing request.

This moves all the calls to `sockRequest` (and similar methods) to
their counterpart in the `request` package.

This introduce `request.Do` to write easier request (with functional
argument to easily augment the request) with some pre-defined function
for the most used http method (i.e. `request.Get`, `request.Post` and
`request.Delete`).

Few of the `sockRequest` call have been moved to `request.Do` (and
`Get`, etc.) to showcase the usage of the package. There is still a
whole lot to do.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: d69d4799a312dfcae63442e290ae6667afd1a038
Component: engine
2017-01-03 11:49:30 +01:00
2758f0996d Remove pkg/integration and move it to testutil or integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 33968e6c7df164fff0a882c50ae7f4f7e6190e4b
Component: engine
2016-12-30 18:26:34 +01:00
71651385ac Extract daemon to its own package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 48de91a33f097d4c20515088af1f5bcb9a98c5c9
Component: engine
2016-12-09 22:26:42 +01:00
d0ebaa81e8 always add but hide experimental cmds and flags
Signed-off-by: Victor Vieux <vieux@docker.com>

update cobra and use Tags

Signed-off-by: Victor Vieux <vieux@docker.com>

allow client to talk to an older server

Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: e98e4a71110fd33852bb755a9b8b4ebc9df904db
Component: engine
2016-11-08 04:55:27 -08:00
73b83984cb Fix TestAPIClientVersionOldNotSupported
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 29d21388d5119d12a7433a32914bf96d916afdf5
Component: engine
2016-11-02 09:43:29 -07:00
b55dfc1ac1 Windows: Require REST 1.25 or later
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f811d5b1288583b4bb4b978e58ca0466236a9a30
Component: engine
2016-10-31 14:33:59 -07:00
ed910442b7 [nit] integration-cli: obey Go's naming convention
No substantial code change.

 - Api         --> API
 - Cli         --> CLI
 - Http, Https --> HTTP, HTTPS
 - Id          --> ID
 - Uid,Gid,Pid --> UID,PID,PID
 - Ipam        --> IPAM
 - Tls         --> TLS (TestDaemonNoTlsCliTlsVerifyWithEnv --> TestDaemonTLSVerifyIssue13964)

Didn't touch in this commit:
 - Git: because it is officially "Git": https://git-scm.com/
 - Tar: because it is officially "Tar": https://www.gnu.org/software/tar/
 - Cpu, Nat, Mac, Ipc, Shm: for keeping a consistency with existing production code (not changable, for compatibility)

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 7fb7a477d79c67ab53c432977780662ccbfeec57
Component: engine
2016-09-30 01:21:05 +00:00
0d4234bb46 Change to use c.Assert() instead of result.Assert()
Fix delete containers and make sure it prints errors correctly.
Rename Result.Fails to Result.Assert()
Create a constant for the default expected.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 243885808f5c69143679d094d964d333c47e69bf
Component: engine
2016-08-23 15:12:36 -04:00
eaa727c6e2 Create a unified RunCommand function with Assert()
Remove some run functions and replace them with the unified run command.
Remove DockerCmdWithStdoutStderr
Remove many duplicate runCommand functions.
Also add dockerCmdWithResult()
Allow Result.Assert() to ignore the error message if an exit status is expected.
Fix race in DockerSuite.TestDockerInspectMultipleNetwork
Fix flaky test DockerSuite.TestRunInteractiveWithRestartPolicy

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d7022f2b46589cb9d860219e1d8278351ba147c3
Component: engine
2016-08-23 15:11:46 -04:00
7a33d63cb2 Swarm integration tests
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 0d88d5b64b69a451d374e322b2abe64140a6cd1c
Component: engine
2016-06-13 22:16:18 -07:00
ecda48bde7 Return remote API errors as JSON
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Upstream-commit: 322e2a7d059a81617b593cf6ece2cfd9f6d4ea03
Component: engine
2016-06-07 18:45:27 -07:00
03d17b8c5f Update code for latest engine-api
- Update CopyToContainer uses
- Use engine-api/types/versions instead of pkg/version

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 7534f17261d0bb74557ca2f7cd893d5b7b531d49
Component: engine
2016-04-19 16:56:54 +02:00
cfd2e7e48d Support TLS remote test daemon
This will allow us to have a windows-to-linux CI, where the linux host
can be anywhere, connecting with TLS.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: f4a1e3db998816e5fcb0df56c29519c488890464
Component: engine
2016-02-25 14:12:17 -05:00
83fc309845 integration-cli: fix minimum and default api version test
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: fe6b88e3fa12810b2eaad45c613742c1eeb7290e
Component: engine
2016-02-04 13:58:08 +01:00
76f3bf50c1 pkg/version.Version: use the new String() method
Resolves #18750

Signed-off-by: Aditi Rajagopal <arajagopal@us.ibm.com>
Upstream-commit: 278e75800c7be10ca43ffb11de25cd342da106fe
Component: engine
2015-12-18 15:29:32 -05:00
6a842265ad Add a DOCKER_API_VERSION env var
Closes: #11486

Just for @ahmetalpbalkan  :-)

Fixed some comment formatting too while in there.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 6287ec9095f380449f0b4f1a06d4e5df43fc4449
Component: engine
2015-12-14 12:45:34 -08:00
04eb439359 Use checker on integration test when possible
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: 710817a71b40287acc546fe2e08367b2a02dae54
Component: engine
2015-10-22 15:53:17 +08:00
6fd5a9b231 Ensure body is closed after error is checked
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 18faf6f94e0995ac3fab703d22ca82baf4a65676
Component: engine
2015-07-23 14:34:38 +02:00
f3684edb38 Error out if client API version is too old
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 910322a8935a45b6b69255edd3e06c8fef97feda
Component: engine
2015-06-18 11:03:07 +02:00
475fb0945f Add GOOS in User-Agent
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 543cf79ffba276fe90ff9eb3a85adb4a53e31366
Component: engine
2015-06-04 13:37:41 -07:00
bca5faa4ca Make version check return 400 instead of 404
Closes: #13321

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 7fcf849749322b3e02ae0305f40e505e83b54e9a
Component: engine
2015-05-19 11:21:05 -07:00
0ec0dcde9e Remove integration tests and port them to integration-cli
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: f7e417ea5e26f11ec43dba64ee153765d2276f40
Component: engine
2015-04-30 01:35:16 +02:00