Commit Graph

22 Commits

Author SHA1 Message Date
Vincent Demeester d69d4799a3
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>
2017-01-03 11:49:30 +01:00
Vincent Demeester 33968e6c7d
Remove pkg/integration and move it to testutil or integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-30 18:26:34 +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
Victor Vieux e98e4a7111 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>
2016-11-08 04:55:27 -08:00
John Howard 29d21388d5 Fix TestAPIClientVersionOldNotSupported
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-02 09:43:29 -07:00
John Howard f811d5b128 Windows: Require REST 1.25 or later
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-31 14:33:59 -07:00
Akihiro Suda 7fb7a477d7 [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>
2016-09-30 01:21:05 +00:00
Daniel Nephin 243885808f 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>
2016-08-23 15:12:36 -04:00
Daniel Nephin d7022f2b46 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>
2016-08-23 15:11:46 -04: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
Ben Firshman 322e2a7d05 Return remote API errors as JSON
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2016-06-07 18:45:27 -07:00
Vincent Demeester 7534f17261
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>
2016-04-19 16:56:54 +02:00
Tibor Vass f4a1e3db99 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>
2016-02-25 14:12:17 -05:00
Antonio Murdaca fe6b88e3fa integration-cli: fix minimum and default api version test
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-02-04 13:58:08 +01:00
Aditi Rajagopal 278e75800c pkg/version.Version: use the new String() method
Resolves #18750

Signed-off-by: Aditi Rajagopal <arajagopal@us.ibm.com>
2015-12-18 15:29:32 -05:00
Doug Davis 6287ec9095 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>
2015-12-14 12:45:34 -08:00
Hu Keping 710817a71b Use checker on integration test when possible
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-10-22 15:53:17 +08:00
Antonio Murdaca 18faf6f94e Ensure body is closed after error is checked
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-23 14:34:38 +02:00
Antonio Murdaca 910322a893 Error out if client API version is too old
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-06-18 11:03:07 +02:00
John Howard 543cf79ffb Add GOOS in User-Agent
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-04 13:37:41 -07:00
Doug Davis 7fcf849749 Make version check return 400 instead of 404
Closes: #13321

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