Commit Graph

68 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
0d1c1d0efa cleanup/fix integration-cli for overlay in overlay
Signed-off-by: Jessica Frazelle <jess@docker.com>
Upstream-commit: 255b84444a86201995d8f688d71b83822f146c3e
Component: engine
2015-04-08 16:59:36 -07:00
ab9a366f0e Remove stripTrailingCharacters from tests
This was just an alias to `strings.TrimSpace`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 475c65319b4663d630711519e18d0b134c42c7f1
Component: engine
2015-04-06 09:21:18 -04: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
1e47557825 Refactor pkg/common, Fixes #11599
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: b80fae735684406d848b16a0f148a746e17ed25f
Component: engine
2015-03-24 18:19:59 +01:00
0221549820 Cleanup redundant else statements find via golint #11602
Signed-off-by: George MacRorie <gmacr31@gmail.com>
Upstream-commit: 664ef0cbe2113e8307135e656cc6db9199f8268e
Component: engine
2015-03-23 20:40:29 +00:00
883ebf04a4 Merge pull request #11320 from estesp/fix-daemon-startup
Fix daemon shutdown on error after rework of daemon startup
Upstream-commit: a5269223a78d963774b12359a1e505b10fa9ac81
Component: engine
2015-03-17 19:04:25 -07:00
26ddd6db93 Fix daemon shutdown on error after rework of daemon startup
Currently the daemon will not stop on error because the serve API job is
blocking the channel wait for daemon init.  A better way is to run the
blocking serve API job as a goroutine and make sure that error
notification gets back to the main daemon thread (using the already
existing channel) so that clean shutdown can occur on error.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 459e58ffc9bff8206a860fb63f973e4f07129756
Component: engine
2015-03-17 14:15:00 -04:00
58d45ba275 Set labels on container create
Signed-off-by: Darren Shepherd <darren@rancher.com>
Upstream-commit: abb5e9a0777469e64fe2c7ecfa66ea01083d2071
Component: engine
2015-03-13 10:02:04 -07:00
182d2d03b5 correct a spelling mistake
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
Upstream-commit: a02256577ab0806f004e41fd94aaaed52d1aff97
Component: engine
2015-03-12 09:22:51 -04: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
76ab368c1d integ-cli: fix clock skew against remote test daemon
This fixes the `docker events`-related tests as they have been
failing due to clock skew between CI machine and test daemon on
some other machine (even 1-2 seconds of diff causes races as
we pass local time to --since/--until).

If we're running in same host, we keep using time.Now(), otherwise
we read the system time of the daemon from `/info` endpoint.

Fixes pretty much all events-related tests on windows CI.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: e424c54d9c4030dc3290701e8e76add372e09e08
Component: engine
2015-03-11 10:28:56 -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
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
de1d7d8288 integ-cli: also preserve SystemRoot env var
Windows CI fails to dial remote test host over tcp in the test cases where
we clear environment variables during `exec(dockerBinary, ...)` in the
absence of `SystemRoot` environment variable (typically points to `c:\windows`).

This fixes tests:
- `TestRunEnvironmentErase`
- `TestRunEnvironmentOverride`

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: d18689dff71ccbc3b955a4416ae04077356fd5c9
Component: engine
2015-03-07 01:09:01 -08:00
a0531c5103 Merge pull request #11005 from ahmetalpbalkan/win-cli/RegistryV2-skip
integ-cli: skip tests launching registry-v2
Upstream-commit: f92213af882761a739fa0d8408e180e437b1a380
Component: engine
2015-03-02 12:41:21 -08:00
b67ac7ee80 when the file that was opened has been read into buffer, the file should be close.
Signed-off-by: Mabin <bin.ma@huawei.com>
Upstream-commit: d5ea4bae4a15cc9f3c16c046389737682277ff0f
Component: engine
2015-02-27 19:09:17 +08:00
8c8a1fb3a0 integ-cli: skip tests launching registry-v2
Some pull/push tests are launching `registry-v2`
binary which is compiled and installed if the tests
are running in-container through `make test-integration-cli`.

However, registry is not supported to run on non-linux
platforms and we can't really spin up any registry-v2
containers in the remote DOCKER_TEST_HOST at this point.

Just skipping those with the new TestRequirement called
`RegistryHosting`.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: e2aa8f0cd984fbb31231240052e5505e1b1e3d2f
Component: engine
2015-02-24 23:19:59 -08:00
5db21189fd readContainerFileWithExec for links tests
Shout out to @estesp for the idea. Some use cases of
`readContainerFile` can be replaced with `docker exec $id cat $file`.
This helper method can eliminate the requirement that
host/cli should be on the same machine.

TestRunMutableNetworkFiles and TestRunResolvconfUpdater still
need to access the docker host filesystem as they modify
the file directly from there assuming cli and daemon are
on the same machine.

This fixes TestLinksUpdateOnRestart and TestLinksHostsFilesInject
for Windows CI.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 6bbb456138e48c7558cfe5c797c57d136f1a694b
Component: engine
2015-02-20 23:14:38 -08:00
d5362cffa1 Merge pull request #10468 from noironetworks/10457-Pause-and-unpause-accept-multi-containers
Allow docker pause and unpause to accept multiple containers
Upstream-commit: 934535db9c78b20481c8ccabdf174926c6e04d4d
Component: engine
2015-02-19 15:16:05 -08:00
f303319a62 Run tests in stricter environment
Use `env -i` to very explicitly control exactly which environment variables leak into our tests.  This enforces a clean separation of "build environment knobs" versus "test suite knobs".

This also includes a minor tweak to how we handle starting our integration daemon, especially to catch failure to start sooner than failing tests.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: ed345fb18ee9d003f30884b696628b75380a426a
Component: engine
2015-02-18 23:30:43 -07:00
e4b06c20d3 Merge pull request #10800 from ahmetalpbalkan/TestRunEnv-fix
integration-cli: Preserve DOCKER_TEST_HOST in env-clearing tests
Upstream-commit: 9ee8d41ab27181a919da11828c573c030e8a5611
Component: engine
2015-02-16 09:23:42 -08:00
b18c3b3d5b docker_cli_run_test: Preserve DOCKER_TEST_HOST in env-clearing tests
For Windows, we run integration-cli with DOCKER_TEST_HOST env var b/c
daemon is on some remote machine. This keeps the DOCKER_HOST set by
bash scripts in the env.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 4f377fbe9f30ea44be5e10a0c7b9bc3c6eb421b1
Component: engine
2015-02-14 03:26:56 -08:00
b8472e6ec6 docker_api_attach_test: fix WS test to use DOCKER_TEST_HOST if specified
TestGetContainersAttachWebsocket is currently broken on Windows CI tests
b/c it has hardcoded unix://var/run/docker.sock.  This change makes use
of @icecrime's code in docker_utils and generalizes it with sockConn()
to provide a net.Conn by making use of DOCKER_TEST_HOST. Also fixes
the test.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: ac6cb41d52ca229d2b628ab0bb5ef6103bd86ce1
Component: engine
2015-02-12 15:11:19 -08:00
19b7fc9336 Fixes #10457-Pause-and-unpause-accept-multi-containers
Applied multi parameters to pause and unpause.
Created a new test file dedicated for pause commands.
Created a new utility function to get a slice of paused containers.
Updated documentation

Signed-off-by: André Martins <martins@noironetworks.com>
Upstream-commit: 0ce42dcc96d0f3bbfb89b23eb3c255d2ddaa9624
Component: engine
2015-02-07 00:28:49 +00: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
0820460272 Fix race in test registry setup
Wait for the local registry-v2 test instance to become available to
avoid random tests failures.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: de8ea06d7dab7c5278f84728f7e0aa69e3301ad0
Component: engine
2015-01-31 11:31:41 -08:00
30a16b5689 Add some push test coverage
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: dbec2317e503b8a0190102332168f9d0256392b7
Component: engine
2015-01-15 14:05:06 -08:00
7467fc1bd7 Take DOCKER_TEST_HOST into account
Tests no longer make the assumption that the daemon can be accessed
through unix:///var/run/docker.sock.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: e1ef33449f484678d236cb49e80daf5ba1e1899c
Component: engine
2015-01-14 16:14:27 -08:00
8b29f19b21 Fix format calls as suggested by vet
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a75b02fe72f3da73f9788919ff2c22f183978db7
Component: engine
2015-01-14 14:12:03 -08:00
013643a0ba More graceful stop for testing daemon
Fixes problem with TestDaemonAllocatesListeningPort

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 8dc86c0e36da3d3206220fffc75004759dd5d2cb
Component: engine
2014-12-23 13:15:19 -08:00
bb5a33c82a Merge pull request #9356 from cc272309126/fix-exec-paused-container
Fix the issue that when docker exec a paused container, it will always
Upstream-commit: bb24f99d741cd8d6a8b882afc929c15c633c39cb
Component: engine
2014-12-09 11:01:44 -08:00
52bfe6086a Make 'docker build' send non-err output to stdout
Right now 'docker build' will send:
   Sending build context to Docker daemon
to stderr, instead of stdout.  This PR fixes that.

I looked in the rest of api/client/commands.go for other cases
that might do this and only one jumped out at me:
  https://github.com/docker/docker/blob/master/api/client/commands.go#L2202
but I think if I changed that to go to stdout then it'll mess people up
who are expecting just the container ID to be printed to the screen and
there is no --quiet type of flag we can check.

Closes #9404

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 5c91bb93a7e35b2d443090cabc7ec0a2ca59b6ee
Component: engine
2014-12-04 14:06:40 -08:00
2b487e0de2 Fix the issue when docker exec a paused container, it will always hang.
Add the test case of this issue.

Docker-DCO-1.1-Signed-off-by: Chen Chao <cc272309126@gmail.com> (github: cc272309126)
Upstream-commit: 1bb02117db80e75f406f6c63d8d50680c1569019
Component: engine
2014-12-05 03:10:44 +08: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
2d3f0f7b70 Test for updating hosts files via links.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 68bc8de111e4faa2a16583cd45b5c0fd253a3bba
Component: engine
2014-11-25 16:48:36 -08:00
8137d7940d Break some routines out of the mutable files test for future use
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 20575d20bad60172b9d1f40c9fe357b7c069f466
Component: engine
2014-11-25 16:46:09 -08:00
09af87d0eb remove deprecated cmd function in integration-cli
Remove deprecated cmd function in integration-cli
and change cmd to dockerCmd in all test files

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
Upstream-commit: 7fbbd515b1018721e91199960d1933383a8262a1
Component: engine
2014-11-25 00:32:38 +09:00
f428978f5b Fix deleteImages() helper for multiple names
Pass every image name as separate argument.

Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
Upstream-commit: bbb245defe670f4fd9b9159b154e0ba5aa93ec87
Component: engine
2014-11-19 23:42:16 +02:00
40988ed79f Add --log-level support
Next steps, in another PR, would be:
- make all logging go through the logrus stuff
- I'd like to see if we can remove the env var stuff (like DEBUG) but we'll see

Closes #5198

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 2facc0467336a80f48c765dbdbd803055a431aa9
Component: engine
2014-11-15 09:00:48 -08:00
d9b4e1dcc3 Allowing resize tty to only work when container is started
Addresses #8728

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 78a272ce14a43f81a79f1b948d5cfd120405f8c9
Component: engine
2014-10-23 21:31:34 +00:00
13b9038a18 Clean volume paths
Fixes #8659

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 964f9965c75b89f95060c62ba512ed6ceb525992
Component: engine
2014-10-20 19:07:56 -04:00
0fb5fb3bb6 Cleanup errorOut resp in docker_utils.go
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 73eadbc6a1af80dfb1e933644a9a2927004e6d0f
Component: engine
2014-10-16 15:06:16 -07:00
04647d4951 Replace '%s' in test utils
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 949ab477103c93d6d4779b35efbd647541eb1b14
Component: engine
2014-10-14 10:59:38 -07:00
a61100d91a Fixes re-creating volume on (re)start
When a container is restarted all the volume configs are parsed again.
Even if the volume was already handled in a previous start it was still
calling "FindOrCreateVolume" on the volume repo causing a new volume to
be created.

This wasn't being detected because as part of the mount initialization
it checks to see if the the _mount_ was already initialized, but this
happens after the parsing of the configs.
So a check is added during parsing to skip a volume which was already
created for that container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c985302c5c2fb6d922acf29106b550cb36faaab6
Component: engine
2014-10-08 16:25:51 -04:00
2d4da4a816 Allow child to overwrite entrypoint from parent
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 50fa9dffcf023c81f3142f0ddd294db4ac6b8281
Component: engine
2014-10-07 23:45:35 +00:00
16206f937c integcli: lint fixes
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: c0e632246d821f3f70ffcf7244cf7a9b336b0344
Component: engine
2014-10-06 23:15:17 +03:00
ba92a9eabd Rewrite TestBuildWithInaccessibleFilesInContext to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 51a56399f6384decee03a7e1aa56a3f46cb7c63f
Component: engine
2014-09-24 17:09:14 +04:00
3afe5f7408 integcli: add & use dockerCmdWithTimeout & InDir
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: c6965e3e45cc1c46afc885c57e0e6b9a7769722c
Component: engine
2014-09-22 21:02:51 +03:00
cf1e3ce7c5 integcli: add util to fetch container status
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 5d1cb9d0051c5263e23f06ccb431481f8e5b3d57
Component: engine
2014-09-22 20:34:57 +03:00