Commit Graph

844 Commits

Author SHA1 Message Date
113975c3ee Merge pull request #10909 from ahmetalpbalkan/run_test-defer
integration-cli: Better test cleanup with defer
Upstream-commit: b062ef05e59ecfc0c08dccdea3d81c024c491350
Component: engine
2015-02-20 17:28:08 -08:00
7e28069bae Merge pull request #10871 from ahmetalpbalkan/win-cli/TestBuildAddBadLinks-fix
integ-cli: Fix TestBuildAddBadLinks for windows
Upstream-commit: 4ba1128c1857e8c8d3dbbee63b50b600a2d9aed7
Component: engine
2015-02-20 17:27:36 -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
1269363ae7 integ-cli: Fix TestBuildAddBadLinks for windows
TestBuildAddBadLinks used to build a path by
concenating unix-style forward slashes. Fixed that
by providing a windows-equivalent using `runtime.GOOS`.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: d0dc14e5d6fe5f8ef9d4a8a8dc95fa087439a5b4
Component: engine
2015-02-20 13:24:59 -08:00
89b66e14e3 integration-cli: pass platform-compatible paths to os.Symlink
Although this doesn't fix the test (os.Symlink is not yet
implemented for Windows), this prevents unix-style paths
from being passed to os.Symlink. Also makes code cleaner
for linux.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 4581240e585d5188955507fbd1de1affcd2ffc1b
Component: engine
2015-02-20 12:25:10 -08:00
868befad3f Merge pull request #10913 from ahmetalpbalkan/win-cli/UnixSpecific-skip
integ-cli: Skip some unix-specific cli tests
Upstream-commit: 695bf3348f022e12c2d7deb21f8f3a088c079e89
Component: engine
2015-02-20 10:33:28 -08:00
340738a112 Merge pull request #10914 from kargakis/map-commands
Map Commands instead of using them as a slice
Upstream-commit: c5aca86654f9eeb07e533ece53da139aad692b2b
Component: engine
2015-02-20 10:32:04 -08:00
b51836333b Merge pull request #10625 from duglin/FixHelpHomeSlash
Fix for help when $HOME is /
Upstream-commit: fdfa7ee70286c3d08a839e20ea7663185cdbcd78
Component: engine
2015-02-20 10:06:22 -08:00
117a5aaace integ-cli: Typo fix in test_vars_* comments.
Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
Upstream-commit: 5d615dff10f31ea6bf77a1233b1821b0e525e456
Component: engine
2015-02-20 09:51:10 -08:00
105231e146 integ-cli: Skip some unix-specific cli tests
Skipping some of the tests closely tied to running in a
unix environment. Windows does not support chmod/chown
and this causes some tests to fail creating desired
behavior.

- `TestBuildWithInaccessibleFilesInContext`: uses chown/chmod
- `TestBuildDockerfileOutsideContext`: uses os.Symlink, not implemented on
  windows
- `TestCpUnprivilegedUser`: uses chmod, and requires 'unprivilegeduser'
  created by Dockerfile (and thus requires to run inside container)
- `TestBuildChownSingleFile`: uses chown

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 492a58f05fe026653e27ed75d3ad4221f2e615b1
Component: engine
2015-02-20 09:51:10 -08:00
314f2be995 Map Commands instead of using them as a slice
The most obvious use case is when one wants to make sure as fast
as possible that a command is a valid Dockerfile command.

Signed-off-by: kargakis <kargakis@users.noreply.github.com>
Upstream-commit: 6ecf23861ec7036aa4210fe6d3b7dbfaaedbd6d0
Component: engine
2015-02-20 15:56:21 +01:00
1b9876efb2 integ-cli: fix volume test by passing unix path as volume
This fixes `TestVolumesNoCopyData` for test execution on
windows by passing a unix-style path as volume even though
it's running on windows.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 606283875616bf71af4814fc47ee5c2ca7b729c6
Component: engine
2015-02-20 00:58:44 -08:00
efffe9523d Fix for help when $HOME is /
estesp noticed that when $HOME is / the ~ substitutions messes up
becuase it tries to replace all paths that start with "/" with "~".
This fixes it so that it will only replace it when $HOME isn't "/".

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 116367eb07351125754aef01f7d3da152b018710
Component: engine
2015-02-19 22:21:17 -08:00
c61c12bda0 Merge pull request #10873 from ahmetalpbalkan/win-cli/TestBuildRenamedDockerfile-fix
integration-cli: Fix path problems in TestBuildRenamedDockerfile
Upstream-commit: e22487db370e431016b53b4044e452856ac72d10
Component: engine
2015-02-19 16:40:15 -08:00
2c330e66cf Merge pull request #10856 from coolljt0725/fix_expose
Fix docker run --expose with an invalid port does not error out
Upstream-commit: 140293734736e9b7ab61bf4dbb25bc318d6d1c7f
Component: engine
2015-02-19 16:01:15 -08:00
884ae09296 fix race in events test
Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 27c61c39db414dd717aea04fc9440ee6d02b626d
Component: engine
2015-02-19 15:32:00 -08:00
a1eb08d949 Add a test for expose a invalid port
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 34b7c10e3eed8bd4d71b998d06ca10766ce4c754
Component: engine
2015-02-19 15:18:13 -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
0aa0a22313 integ-cli: Fix path problems in TestBuildRenamedDockerfile
`TestBuildRenamedDockerfile` tests hard-code unix-style
path building. Made use of `path/filepath` to make these
tests work on Windows as well.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 967d85a28fa1e9a8ac4d668960bca8760af2b722
Component: engine
2015-02-19 14:45:26 -08:00
0385663f68 Merge pull request #10818 from estesp/link-add-aliases
Upstream-commit: 356fe89d2431bd54f38b3477aa91ef276f65ffb7
Component: engine
2015-02-19 17:22:53 -05:00
c4aef2a226 Add linked container's name and hostname as aliases to /etc/hosts
Currently when containers are linked the alias name (e.g. from `--link
name:alias`) is added to the parent container's `/etc/hosts` with a
reference to the IP of the linked container.  Some software requires
using the official hostname or node name in operations that need to
match on those values, and it is therefore helpful if the parent
container can refer to the child/link using those same values and still
access the same IP.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 16aa64dc82b6434ec78878fa35eb96e4983b46f8
Component: engine
2015-02-19 14:19:38 -08:00
320f4e4af1 Merge pull request #10852 from Snorch/check-docker-port-is-not-empty
Upstream-commit: ac7bef5e66aa55acc232826ab590149f8e162ad9
Component: engine
2015-02-19 17:18:36 -05:00
1a772e99d8 Merge pull request #10555 from duglin/MoreRenamedDockerfileTests
Add more tests around using -f Dockerfile via the CLI
Upstream-commit: 7829e7b40fafdc6bbe4489cf91a01fbf381c73b9
Component: engine
2015-02-19 13:59:35 -08:00
0846fa52ae Merge pull request #10797 from tianon/strict-test-environment
Upstream-commit: d562f94d473a07c3bee84e66dd9cbf60c04ea7fe
Component: engine
2015-02-19 16:14:05 -05:00
b3d291c64f Merge pull request #10835 from jfrazelle/port-ranges
Upstream-commit: 1875cc2ef42787375055710fc6b359ca3dd85752
Component: engine
2015-02-19 16:11:59 -05:00
7eeecba437 Merge pull request #10619 from bcicen/add-logpath-to-inspect-container
Add logpath to inspect container
Upstream-commit: dc37358d8c9b177a050620731cf3b7f247a26f78
Component: engine
2015-02-19 12:56:45 -08:00
ae2aead6a0 Merge pull request #10819 from jsdir/10815-relative-path-fix
Fixed relative filepath check
Upstream-commit: 08544a89ebdb781234fd559230c5cde30da4503b
Component: engine
2015-02-19 12:54:44 -08:00
3ec6def239 Merge pull request #10750 from tianon/cirros-tar
Update cirros.tar.gz handling to be more agnostic of running within the image
Upstream-commit: eefe6c28318d8917c244906c9ae8e554e74decb9
Component: engine
2015-02-19 12:32:09 -08:00
123b13f7ed Merge pull request #10870 from ahmetalpbalkan/win-cli/TestRunSetMacAddress
integration-cli: remove bash dependency from TestRunSetMacAddress
Upstream-commit: 6c3f089fc724b4cec04913f0a049c97adfe6d625
Component: engine
2015-02-19 11:34:14 -08:00
30320ed3ab Merge pull request #10886 from ahmetalpbalkan/win-cli/TestMainHelpWidth-fix
Shorten printed Windows paths on docker help command
Upstream-commit: e3fa8b36c285e564b8541e1d6e07c32cc351edf0
Component: engine
2015-02-19 11:33:50 -08:00
2ad1bfd726 Merge pull request #10875 from ahmetalpbalkan/win-cli/TestCp
integ-cli: Fix path issues in docker cp tests
Upstream-commit: 5456ad2b427ad4e99371b6eaceaf17ab01d1d14d
Component: engine
2015-02-19 11:33:09 -08:00
c1343f737e Merge pull request #10794 from ahmetalpbalkan/win-cli/TestContainerApi-volume-path-fix
integration-cli: Generate unix-style volume paths for tests
Upstream-commit: 47e9f90be13d901c8fd6dfd0d77ec3f5debecada
Component: engine
2015-02-19 11:28:55 -08:00
a45709a819 Shorten printed Windows paths on docker help cmd
This makes use of `%USERPROFILE%` as a substitute for
`~` on Windows and prints shorter strings for default
cert paths etc.

Also removes string escaping/quotes around default
path values printed in `docker help` command as they
are not really necessary and adds double backslashes
(\\) on windows.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 1c9b37cb965be459a93ce07539d7b2a53fbdbc6a
Component: engine
2015-02-18 23:04:56 -08:00
26c37e453e Remove cirros.tar.gz completely
Since `cirros.tar.gz` only existed to test `docker import`'s display and
presence in `docker events`, we can instead just use `docker export`
piped directly to `docker import` to achieve the same goal without
another external dependency besides `busybox` (which we already have).

While I was at it, I updated `TestImportDisplay` to also test that the
imported image actually runs successfully as well (so we're testing the
full import round-trip).

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: c7bec92891180ccffd1536839ba3bcc85d9c96a4
Component: engine
2015-02-18 23:46:25 -07:00
fbfe910172 Merge pull request #10806 from ahmetalpbalkan/win-cli/TestSave-fix
integration-cli: use pipes for save/load tests
Upstream-commit: cd9769c55e3c0c405854b84c2c4bd273be79b23d
Component: engine
2015-02-18 22:42:06 -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
eba1bf9a43 Merge pull request #10785 from ahmetalpbalkan/win-cli/TestLinks-skip
integration-cli: add const to skip daemon-requiring cli tests
Upstream-commit: 306bb28569c6554205d9ff609d66a09d47af5249
Component: engine
2015-02-18 15:13:05 -08:00
0165e20ef7 Add more tests around using -f Dockerfile via the CLI
Mainly to make sure we don't treat the -f value as relative to the
root of the build context, but instead it must be relative to the current
dir.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: c42d2625d1c86aca5a724ec73d16178cae73ae90
Component: engine
2015-02-18 14:06:58 -08:00
cc3ec80739 add logpath to docker inspect.
Signed-off-by: Bradley Cicenas <bradley.cicenas@gmail.com>
Upstream-commit: 06c01b02f5d8149407028324e751df5c0a92fd14
Component: engine
2015-02-18 10:19:52 -05:00
1e667fce86 integ-cli: Fix path issues in docker cp tests
Some of the `docker cp` tests were using `path/filepath` to
craft unix paths. This wouldn't work on Windows since filepath
is platform-dependent.

Moved code to `path` as much as possible and hacked away some
`path/filepath` functionality that doesn't exist in `path` pkg.

This fixes the following test cases:
- `TestCpGarbagePath`
- `TestCpRelativePath`
- `TestCpAbsoluteSymlink`
- `TestCpSymlinkComponent`

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: c5b312dcf5efa4f91dee59f4b701ea7a26a6d41e
Component: engine
2015-02-18 02:27:44 -08:00
e5290f478d integration-cli: remove bash dependency from TestRunSetMacAddress
This change enables TestRunSetMacAddress to run on windows
without `bash` dependency. Also `defer`red call of cleanup
method.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: c1a54048e241bd565feabf274b79dfac61c396d4
Component: engine
2015-02-17 23:24:36 -08:00
aa71246181 Use -q param in test using docker images -f
The test case `TestImagesFilterWhiteSpaceTrimmingAndLowerCasingWorking`
fails based on time because it uses full `docker images` output and
value in the `CREATED` column turns from `A minute ago` to `2 minutes ago`
in the middle of execution and output comparison fails.

Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
Upstream-commit: e39ea834a92154574be3dde67ae30acdb25b32f7
Component: engine
2015-02-17 19:29:17 -08:00
6e1d109cda integration-cli: use pipes for save/load tests
This removes `bash` dependency from save/load integration tests.
It used to call `/bin/bash -c 'c:\...\docker.exe'` which is not valid.
Also removed usage of tempdirs and temp files for saving/loading
repos. All are now done using in-memory pipes and buffers.

Created `runCommandPipelineWithOutput` helper to replace the
`/bin/bash -c 'a | b | c'` using pipes and returning output from
last command in the pipeline. This makes the code even shorter
and readable.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: b81105eaca56e7b22c97e24b7314419ee0a4f2a9
Component: engine
2015-02-17 17:09:09 -08:00
1653e2237b integration-cli: check that docker port command output is not empty
Or else we can violate array range boundaries in:
	out = strings.Split(out, ":")[1]
and get runtime error.

We got this runtime error when run TestRunPortFromDockerRangeInUse
Somehow docker goes silently if it cannot publish port because
of no bridge.

Signed-off-by: Pavel Tikhomirov <ptikhomirov@parallels.com>
Upstream-commit: cad770f992ee5837273a02edb28f73624898bee1
Component: engine
2015-02-17 16:01:34 +03: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
3d483b4bef integration-cli: add mechanism to skip tests
If DOCKER_CLIENTONLY is set for test-integration-cli, we don't set
the 'daemon' build tag. 'isRemoteDaemon' will help us skip such
tests without a need to move them to a separate file and accidentally
lose track of them.

Added `testRequires` function to skip tests based on predefined
conditions evaluated in runtime. This way we can easily extend test
requirements like:

    testRequires(t, Networking, SameHostDaemon, Linux)

Signed-off-by: Ahmet Alp Balkan <ahmetb@microsoft.com>
Upstream-commit: bc37c036b568f9ae27a7aa457ec73d0c5c6a61cf
Component: engine
2015-02-17 00:43:41 -08:00
05210fc269 Fixed relative filepath check
Signed-off-by: Jason Sommer <jsdirv@gmail.com>
Upstream-commit: 0826ac1581bdb71b889a0cb260422ce985aca317
Component: engine
2015-02-16 20:38:52 -06:00
8e15b333c1 Merge pull request #10796 from ahmetalpbalkan/win-cli/TestCliProxyDisableProxyUnixSock-fix
integration-cli: use remote daemon env var in TestCliProxyDisableProxyUnixSock 
Upstream-commit: 39df8473d6fdfd1afed3dc9361327b39a3804798
Component: engine
2015-02-16 11:59:46 -08:00
7dcc838aea Merge pull request #10804 from ahmetalpbalkan/win-cli/TestRunSlowStdoutConsume-fix
integration-cli: remove bash dependency of TestRunSlowStdoutConsumer
Upstream-commit: 110ce4f6cdf7c5a2409a6075d783f5af76ba190e
Component: engine
2015-02-16 11:58:55 -08:00
e082c90ce2 Merge pull request #10780 from estesp/test-bogus-link
Fix daemon.Get() error handling with --link setup. Add test.
Upstream-commit: 3ddef31793b45b3891f5b9955254b0167ebe7cba
Component: engine
2015-02-16 11:22:21 -08:00