Commit Graph

25 Commits

Author SHA1 Message Date
cbe9a536c0 add TestContainerApiPause case
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
Upstream-commit: 8636a219911536123decb547dab9bf50ebb2c8f8
Component: engine
2015-04-10 09:14:01 +08:00
3c9c482afa TestVolumesFromHasPriority fix race
Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <hugs@docker.com> (github: jfrazelle)
Upstream-commit: c447fd339a9293ea528ba0c8f4154cf1f953186c
Component: engine
2015-04-01 18:06:28 -07:00
8f2d65bf21 Fix vet warning
Signed-off-by: Paul Mou <ppymou@gmail.com>
Upstream-commit: c5bf2145f172a264d3d8fc63d6717826b95b5ee2
Component: engine
2015-03-25 20:31:02 -07:00
2ae5f5eb68 Merge pull request #10365 from cpuguy83/9981_fix_cannot_overwrite_nonbind_as_bind
Allow path from normal volume existing to overwrite in start Binds
Upstream-commit: 1fe55b2f8bc966c0784527b30f507cbc90325df7
Component: engine
2015-03-23 10:43:02 -07:00
45269e9133 fix panic error when docker stats a stopped container
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 8dc5791f7302aea0734a26dc1f54d96b04771b8f
Component: engine
2015-03-16 19:55:34 +08:00
20b7c132ab Merge pull request #11278 from ahmetalpbalkan/win-cli/fakeGIT
integ-cli: use httpserver container for fakeGIT
Upstream-commit: 52f6da223839a5ac1fc003b259b74f6a02fc2858
Component: engine
2015-03-11 18:19:11 -07:00
546ad5a411 integ-cli: use httpserver container for fakeGIT
This change enables `fakeGIT()` to use the new `fakeStorage`
server which is automatically starting a container on the remote test
daemon machine using the git repo directory (when requested).

Fixes the following tests:

- `TestBuildApiLowerDockerfile`
- `TestBuildApiBuildGitWithF`
- `TestBuildApiDoubleDockerfile` (skipped on windows: NTFS case-insensitive)
- `TestBuildFromGIT` (still needs local server)

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 44ffb199d03f0d63a2c9ad05e9fd03a6a08c594d
Component: engine
2015-03-10 22:48:35 -07:00
4a7bad6471 Fixup a test for -f processing
Thanks to @ahmetalpbalkan for noticing... we had an old check in this
testcase that no longer applied (due to stuff being removing recently).
However, while in there I added a check to make sure that the file referenced
by the query parameter isn't used at all.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: a853f8e4687adb78c0e63019caae32b216cce925
Component: engine
2015-03-10 05:47:12 -07:00
60d13dc8cb integ-cli: Implement remote FakeStorage server for build via URL tests
Implemented a FakeStorage alternative that supports spinning
up a remote container on DOCKER_TEST_HOST to serve files over
an offline-compiled Go static web server image so that tests which
use URLs in Dockerfile can build them over at the daemon side.

`fakeStorage` function now automatically chooses if it should
use a local httptest.Server or a remote container.

This fixes the following tests when running against a remote
daemon:

- `TestBuildCacheADD`
- `TestBuildCopyWildcardNoFind`
- `TestBuildCopyWildcardCache`
- `TestBuildADDRemoteFileWithCache`
- `TestBuildADDRemoteFileWithoutCache`
- `TestBuildADDRemoteFileMTime`
- `TestBuildADDLocalAndRemoteFilesWithCache`
- `TestBuildADDLocalAndRemoteFilesWithoutCache`
- `TestBuildFromURLWithF`
- `TestBuildApiDockerFileRemote`

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 2e95bb5f1a65d90f412568d6df82a9e2cdd3e790
Component: engine
2015-03-09 12:03:55 -07:00
6827e12a3d Merge pull request #10858 from duglin/10807-MixedcaseDockerfile
Support dockerfile and Dockerfile
Upstream-commit: beea697be365631ceeb92761e094f1ffe307ca33
Component: engine
2015-03-04 03:52:49 -08:00
bc3e4a6737 Support dockerfile and Dockerfile
Closes #10807

Adds support for `dockerfile` ONLY when `Dockerfile` can't be found.
If we're building from a Dockerfile via stdin/URL then always download
it a `Dockerfile` and ignore the -f flag.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 15924f238503ffe44e5fcb99415ff753a36e5971
Component: engine
2015-03-03 18:38:50 -08:00
aab969a855 Move stats api types into api/types package
Move the stats structs from the api/stats package into a new package
api/types that will contain all the api structs for docker's api request
and responses.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 7fed7d7eb4d7766d9342821f2667d160c5f958eb
Component: engine
2015-02-24 10:47:47 -08:00
0f72ec16db Better test cleanup with defer
This fixes a few misuses of `deleteAllContainers()` cleanup
method in integration-cli suite by moving call to the
beginning of the method and guaranteeing their execution
(including panics) with `defer`s.

Also added some forgotten cleanup calls while I'm at it.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 70407ce40ca98d763da8472e7ee94b6e8d66912d
Component: engine
2015-02-20 14:04:36 -08:00
451dc60394 integration-cli: generate unix-style volume paths
Some tests in `docker_api_containers_test.go` assume the
docker daemon is running at the same machine as the cli
and uses `ioutil.TempDir` to create temp dirs and use them
in the test.

On windows ioutil.TempDir and os.TempDir would create win-style
paths and pass them to daemon. Instead, I hardcoded `/tmp/` and
generate some random path manually and allow daemon to create
the directory.

Fixes tests:
- TestContainerApiStartVolumeBinds
- TestContainerApiStartDupVolumeBinds
- TestVolumesFromHasPriority

Downside:
- Does not clean the temp dirs generated on the remote daemon
  machine unless delete container deletes them.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: df5334183fd681812f0d2cb03600d3eb0f3ef513
Component: engine
2015-02-17 01:29:23 -08:00
a17ad5db90 Allow normal volume to overwrite in start Binds
Fixes #9981
Allows a volume which was created by docker (ie, in
/var/lib/docker/vfs/dir) to be used as a Bind argument via the container
start API and overwrite an existing volume.

For example:

```bash
docker create -v /foo --name one
docker create -v /foo --name two
```

This allows the volume from `one` to be passed into the container start
API as a bind to `two`, and it will overwrite it.

This was possible before 7107898d5cf0f86dc1c6dab29e9dbdad3edc9411

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 49e1ad49c8fe0a6fbb7cba67cc030ef73125dcc7
Component: engine
2015-02-10 20:46:37 -05:00
123e8eff11 Clean up dup. volume test and add API test for the same
Handles missed comments in PR#10622 and adds an API test to validate
error returned properly for duplicate bind mounts for the same
container target path.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 35d48258384a07affac6f49b89a70dd7ffa60428
Component: engine
2015-02-09 12:33:58 -05:00
3ba1373e01 builder: prevent Dockerfile to leave build context
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 73d5baf585e3ef55864abeef43d45fe0b3a1c2bc
Component: engine
2015-02-02 23:40:24 -08:00
56a2a654e8 Add an API test for docker build -f Dockerfile
I noticed that while we have tests to make sure that people don't
specify a Dockerfile (via -f) that's outside of the build context
when using the docker cli, we don't check on the server side to make
sure that API users have the same check done. This would be a security
risk.

While in there I had to add a new util func for the tests to allow us to
send content to the server that isn't json encoded - in this case a tarball

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 198ff76de59a600ce900497fd4a6131ee4448c48
Component: engine
2015-02-02 23:40:20 -08:00
9381b90c95 Improve robustness of /stats api test
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 4d7707e183e8dcb8e0ab1415e401cb530df17c92
Component: engine
2015-01-21 16:00:15 -08:00
b793c28c03 Remove publisher if no one is listening
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 217a2bd1b62788e53fd38810b30672db58a4efc5
Component: engine
2015-01-20 20:21:47 -08:00
a77fb96f4c Add documentation for stats feature
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 76141a00779880368b15ef2a5ffd28a80e4637df
Component: engine
2015-01-20 20:21:47 -08:00
ecd4852381 Fix volumes-from/bind-mounts passed in on start
Fixes #9628
Slightly reverts #8683, HostConfig on start is _not_ deprecated.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d44c9f91472eb3df4c38c669134df04b2ccf9953
Component: engine
2014-12-15 16:51:15 -05:00
67d69faf00 Check for no Cmd on exec create endpoint
Fixes #9414

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c8a3d31332074ddc226086ff1f0c042b6e120232
Component: engine
2014-12-01 17:54:15 -05:00
2446634ffa Fix racy integration tests
Do not run containers in the background in the integration tests if you
depend on the run completing.  It is better especially if you just want
to ensure that the run has completed with a `true` to just run in
foreground and use a known name for the container to query it after it
has stopped.

The failures can be reproduced on most machines by giving your dind
container one core and a cpushare.

docker run -c 200 --cpuset 0 -ti --rm --privileged -e
DOCKER_GRAPHDRIVER=vfs docker hack/make.sh binary test-integration-cli

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: ba5370c116e3879c88736d3456586ec5703f581b
Component: engine
2014-10-21 22:51:09 +00:00
05209c9141 Migrate container GET API tests from integration to integration-cli
An initial start to migration of the API tests from integration to
the integration-cli model.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
(github: estesp)
Upstream-commit: d8cd8165a94dc60d1f7a1053bb789fd302252279
Component: engine
2014-10-16 17:34:28 -04:00