Commit graph

62 commits

Author SHA1 Message Date
Yong Tang
e66d210891 Add config parameter to change per-container stop timeout during daemon shutdown
This fix tries to add a flag `--stop-timeout` to specify the timeout value
(in seconds) for the container to stop before SIGKILL is issued. If stop timeout
is not specified then the default timeout (10s) is used.

Additional test cases have been added to cover the change.

This fix is related to #22471. Another pull request will add `--shutdown-timeout`
to daemon for #22471.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-17 12:28:46 -07:00
cyli
0797af39c2 Fix API incompatibilities between notary v0.3.0 and v0.4.2:
- some function signatures have changed - use the new ones
- re-generate the notary delegation key certs, since notary doesn't allow SHA1
- fix some error message mapping because now if a root rotation fails to validate trusted operations will fail

Signed-off-by: cyli <cyli@twistedmatrix.com>
2016-10-14 17:53:34 -07:00
Darren Stahl
45fe59931a Windows: Enable more create tests
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-10-10 10:34:03 -07:00
John Howard
78aede292b Windows: Enable some create CI tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-30 14:38:19 -07:00
Yong Tang
c8d3ee8093 Allow unset --entrypoint in docker run or docker create
This fix tries to address the issue raised in #23498 to allow unset
`--entrypoint` in `docker run` or `docker create`.

This fix checks the flag `--entrypoint` and, in case `--entrypoint=` (`""`)
is passed, unset the Entrypoint during the container run.

Additional integration tests have been created to cover changes in this fix.

This fix fixes #23498.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-08-05 16:35:20 -07:00
Vincent Demeester
aa00520fc8
Fix create command flags
Any command that expects extra flags after positional args needs to set flags.SetInterspersed(false).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-06-07 14:11:11 +02:00
mYmNeo
ce87de21a7 fix TestCreateShrinkRootfs and TestCreateShrinkRootfs
Signed-off-by: mYmNeo <thomassong@tencent.com>
2016-04-06 12:40:20 -04:00
Shishir Mahajan
b16decfccf CLI flag for docker create(run) to change block device size.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2016-03-28 10:05:18 -04:00
Phil Estes
a1d8441117 Re-enable shared namespace tests for userns CI runs
Allow --net=container and --ipc=container tests to run when user
namespaces are enabled.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2016-03-23 09:39:24 -04:00
Tonis Tiigi
16e4c4e481 Fix docker run for 64 byte hex ID
Fixes #20972

Also makes sure there is no check to registry if
no image is found for the prefixed IDs.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-11 10:02:47 -08:00
Shijiang Wei
068085005e validate log-opt when creating containers AGAIN
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-03-02 20:30:26 +08:00
Shijiang Wei
7285c9a53a validate log-opt when creating containers
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-02-28 01:51:46 +08:00
Riyaz Faizullabhoy
84dc2d9e70 Vendor in notary v0.2.0
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-02-25 13:40:00 -08:00
Vincent Demeester
382c96ee7b Add a getPrefixAndSlashFromDaemonPlatform …
… to limit code duplication in integration tests :P

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-02-03 15:16:00 +01:00
John Howard
5e3fdd3c20 Windows CI: TestCreate* porting
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-02-02 16:00:39 -08:00
Zhang Wei
62a856e912 Assert error in body of function inspectField*
1. Replace raw `docker inspect -f xxx` with `inspectField`, to make code
cleaner and more consistent
2. assert the error in function `inspectField*` so we don't need to
assert the return value of it every time, this will make inspect easier.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-01-29 23:39:07 +08:00
cyli
0617521ba2 Update integration tests with new error messages, and to use different repos per test.
This way we won't encounter any problems with one test using cached data from a different
test.

Signed-off-by: cyli <cyli@twistedmatrix.com>
2016-01-26 18:02:00 -08:00
Riyaz Faizullabhoy
dd7436c832 revendor notary and wrap friendlier error messages
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-01-14 20:35:59 -08:00
David Calavera
a225e39667 Merge pull request #19155 from coolljt0725/create_cwd_on_create
Create the working directory on container creation
2016-01-14 09:13:44 -08:00
Riyaz Faizullabhoy
1c32a66877 update tests and error messages, revendor notary with tag
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-01-08 09:11:33 -08:00
Lei Jitang
cde0ed67a1 Create the working directory on container creation
if create a container with -w to specify the working directory and
the directory does not exist in the container rootfs, the directory
will be created until the container start. It make docker export of
a created container and a running container inconsistent.

Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-01-08 12:11:21 +08:00
Riyaz Faizullabhoy
1c125f50cf Notary delegation integration into docker
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
2016-01-07 19:35:45 -08:00
David Calavera
056e744903 Replace usage of pkg/nat with go-connections/nat.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-22 13:31:46 -05:00
Tonis Tiigi
15d84a3a48 Improve reference parse errors
Fixes #18093

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-12-16 11:58:53 -08:00
Tonis Tiigi
4352da7803 Update daemon and docker core to use new content addressable storage
Add distribution package for managing pulls and pushes. This is based on
the old code in the graph package, with major changes to work with the
new image/layer model.

Add v1 migration code.

Update registry, api/*, and daemon packages to use the reference
package's types where applicable.

Update daemon package to use image/layer/tag stores instead of the graph
package

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-11-24 09:40:25 -08:00
Zuhayr Elahi
91041884f8 changed if else statements to c.Asserts in docker_cli_create_test.go.
Signed-off-by: Zuhayr Elahi <elahi.zuhayr@gmail.com>
2015-11-10 23:15:32 -08:00
Arnaud Porterie
b0cbc02283 Merge pull request #15503 from ibuildthecloud/revert-label
Revert "Container don't inherit from image labels"
2015-10-12 10:03:18 -07:00
Jessica Frazelle
ea3afdad61 add test-integration-cli specifics for userns
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-10-09 20:50:27 -04:00
David Calavera
3781cde61f Add STOPSIGNAL instruction to dockerfiles.
This way, images creators can set the exit signal their programs use.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-10 19:56:05 -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
Soshi Katsuta
5759b95e7e integration-cli: fix printf verbs of wrong types
Signed-off-by: Soshi Katsuta <katsuta_soshi@cyberagent.co.jp>
2015-08-19 17:47:33 +09:00
Darren Shepherd
8b91b3cf77 Revert "Container don't inherit from image labels"
This reverts commit 79621c7728.

Signed-off-by: Darren Shepherd <darren@rancher.com>
2015-08-11 17:01:57 -07:00
Derek McGowan
bf3c1e6a3a Skip notary tests which update system clock
Currently some notary tests change the system clock to check for expiration.
Skip these tests until the code can be refactored to not rely on updating the system clock.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-29 12:09:40 -07:00
Derek McGowan
259cadb0b1 Rename to flags and environment variables to content trust
Update help line to allow 90 characters instead of 80

The trust flag pushes out the help description column wider, requiring more room to display help messages.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-24 16:31:18 -07:00
Diogo Monica
3e90b12d42 Added tests for expired snapshots and timestamps
Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-24 16:31:18 -07:00
Nathan McCauley
268fa5af47 Add tests simulating an evil server
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-24 16:31:18 -07:00
Derek McGowan
871d2b96ed Add build integration cli tests
Clean up tests to remove duplicate code

Add tests which run pull and create in an isolated configuration directory.
Add build test for untrusted tag

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-07-24 16:31:12 -07:00
Diogo Monica
eeb6d0a71b Add test for incorrect nonroot passphrase
Fix failing tests for create, push, and pull

Signed-off-by: Diogo Monica <diogo@docker.com>
2015-07-24 14:08:20 -07:00
Nathan McCauley
1406cb35fd Add trust tests for Docker create, run, push, and pull
Created date util function

Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-24 14:08:20 -07:00
David Calavera
1c3cb2d31e Expose new mount points structs in inspect.
Keep old hashes around for old api version calls.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-07-21 15:33:05 -07:00
Vincent Demeester
5c295460da Use dockerCmd when possible (#14603)
- integration-cli/docker_cli_attach_test.go
- integration-cli/docker_cli_attach_unix_test.go
- integration-cli/docker_cli_build_test.go
- integration-cli/docker_cli_build_unix_test.go
- integration-cli/docker_cli_by_digest_test.go
- integration-cli/docker_cli_commit_test.go
- integration-cli/docker_cli_config_test.go
- integration-cli/docker_cli_cp_test.go
- integration-cli/docker_cli_create_test.go
- integration-cli/docker_cli_pause_test.go
- integration-cli/docker_cli_port_test.go
- integration-cli/docker_cli_port_unix_test.go
- integration-cli/docker_cli_proxy_test.go
- integration-cli/docker_cli_ps_test.go
- integration-cli/docker_cli_pull_test.go
- integration-cli/docker_cli_push_test.go

- docker_api_attach_test.go
- docker_api_containers_test.go
- docker_api_events_test.go
- docker_api_exec_resize_test.go
- docker_api_exec_test.go
- docker_api_images_test.go
- docker_api_info_test.go

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-07-14 21:52:43 +02:00
Peter Waller
9c2374d196 Move /nat to /pkg/nat
By convention /pkg is safe to use from outside the docker tree, for example
if you're building a docker orchestrator.

/nat currently doesn't have any dependencies outside of /pkg, so it seems
reasonable to move it there.

This rename was performed with:

```
gomvpkg -vcs_mv_cmd="git mv {{.Src}} {{.Dst}}" \
	-from github.com/docker/docker/nat \
        -to   github.com/docker/docker/pkg/nat

```

Signed-off-by: Peter Waller <p@pwaller.net>
2015-06-30 17:43:17 +01:00
Arnaud Porterie
79621c7728 Container don't inherit from image labels
Labels are metadata that apply to a particular resource: image,
container, maybe volumes and networks in the future. We shouldn't have
containers inherit from its image labels: they are not the same obejcts,
and labels cannot be interpreted in the way.

It remains possible to apply metadata to an image using the LABEL
Dockerfile instruction, to query them using `docker inspect <img>`, or
to filter images on them using `docker images --filter <key>=<value>`.

Fixes #13770.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-06-05 11:11:22 -07:00
Qiang Huang
84aae5a226 Don't check running container at create time
We should let user create container even if the container he wants
join is not running, that check should be done at start time.

In this case, the running check is done by getIpcContainer() when
we start container.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-05-23 07:15:14 +08:00
Doug Davis
012e588a74 Add a 'docker create' + 'docker rm' testcase
Per @thaJeztah's comment here: https://github.com/docker/docker/pull/13367#issuecomment-104286651
I couldn't find an existing test that covered this.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-05-21 07:30:51 -07:00
Alexander Morozov
a9688cdca5 Implement teardown removeAllImages
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-24 10:37:21 -07:00
Antonio Murdaca
ee7a7b07e7 Remove deleteAllContainers call in test
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-23 16:32:50 +02: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
bobby abbott
621b601b3c Removed unnecessary error output from dockerCmd
Changed method declaration. Fixed all calls to dockerCmd
method to reflect the change.

resolves #12355

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-04-17 09:11:14 -07:00
Brian Goff
2c24a8a4ea Move TestCreateNumberHostname to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 16:40:48 -04:00