Commit Graph

808 Commits

Author SHA1 Message Date
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
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
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
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
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
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
afb29d0720 Merge pull request #10615 from coolljt0725/fix_mount
Fix create volume /etc cover /etc/{hosts,resolv.conf,hostname} Fixes # 10604
Upstream-commit: c2effb259d18edb6b82d43e4f0eb22e81ce4658f
Component: engine
2015-02-16 10:53:26 -08:00
20acfabece Merge pull request #10633 from hqhq/hq_fix_memoryswap
fix the problem that memory-swap=-1 is not working for docker command
Upstream-commit: 73665ff5f2b0805bb8b53b2acf7e881ebe97225e
Component: engine
2015-02-16 10:49:01 -08:00
3a93af60b3 integration-cli: remove bash dependency of TestRunSlowStdoutConsumer
This makes this test case run on msys bash on windows or
cmd.exe.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: ae8f1fa712196474da633b4c832ea073e8995edb
Component: engine
2015-02-16 10:18:27 -08:00
d9411855ac integration-cli: use remote daemon in proxy test
TestCliProxyDisableProxyUnixSock runs `docker info` by
clearing env however if the daemon is set up to run in a
different machine (e.g. Windows CI case) it does not make
use of DOCKER_TEST_HOST and tries to connect unix sock.

This fix injects DOCKER_HOST back to the test.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 029ca9829df1d42a67289e0318db416cdbcfaf35
Component: engine
2015-02-16 10:14:54 -08:00
5d57256889 Merge pull request #10793 from ahmetalpbalkan/win-cli/TestExportContainerAndImportImage-fix
integration-cli: use cmd.Stdin instead of cat/tee for TestExportContainerAndImportImage
Upstream-commit: 7e9dd943761508c9302cc55fd8b726cc55467a88
Component: engine
2015-02-16 10:11:47 -08:00
57b0301286 Merge pull request #10795 from ahmetalpbalkan/integration-cli/makeRandomString
integration-cli: Seed rand in makeRandomString
Upstream-commit: 546f48184035374af7c417cc9de95fdd2d02bc89
Component: engine
2015-02-16 10:08:20 -08: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
aeb3d73e62 Merge pull request #10747 from ahmetalpbalkan/win-cli/TestContainersAttachWS-fix
TestGetContainersAttachWebsocket: use DOCKER_TEST_HOST if specified
Upstream-commit: 38ca779dd683c728cbfc1486375816ddd8853bb6
Component: engine
2015-02-16 09:19:54 -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
5172176fa3 integration-cli: fix test to use busybox outside container
Fixes TestRmiForceWithExistingContainers test to make it use
`busybox` image rather than /docker-busybox hardcoded path
and rebuilding image.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 57d34241fdff146eaeae748c959940489335ed2a
Component: engine
2015-02-14 03:00:38 -08:00
0c27972573 integration-cli: seed rand in makeRandomString
Current uses of `makeRandomString` is to create really
long strings. In #10794, I used them to create nearly-unique
unix paths for the daemon. Although collions are harmless and
don't fail the tests, this prevents the same strings from being
created consistently in every run by seeding rand.Random.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 00cd214afe46e79848e0f807bcdd19c20251cd2f
Component: engine
2015-02-13 23:26:08 -08:00
63d3034a03 integration-cli: use cmd.Stdin instead of cat/tee for TestExportContainerAndImportImage
os.Exec("bash", "-c", dockerBinary) ends up making a call like
bash -c c:\...\docker.exe on windows msys shell, which does not work.

This test makes use of exec.Command.Stdin to pass image back to
docker import.

- Upside: fixes the test on windows
- Downside: cat/tee compatibility is no longer tested in this test case

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 48d8757700f876ffdeb22d76261128238a8f7a17
Component: engine
2015-02-13 22:12:06 -08:00
a7d8fdce1c Fix daemon.Get error handling with --link setup. Add test.
Fixes newly introduced error flow from daemon.Get() in the link setup
code.  Also added more detail to daemon.Get() comments for clarity.
Added test to test the bogus container link codepath.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 6217f2944f7e9aea4a81615102b7c68740db9350
Component: engine
2015-02-13 15:14:38 -05:00
b8d956b4d4 Fix race detected in TestExecCgroup
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 8f5156e584233f3e83cfc889583fa016aabfeea9
Component: engine
2015-02-13 12:18:46 -05:00
01e622e5b7 TestBuildAddTarXz: xz with '-k' due to msys bug
TestBuildAddTarXz/TestBuildAddTarXzGz make exec calls like
'cd %SOME_TEMP_DIR%; xz test.gz' but this fails when called
from integration-cli tests (doesn't fail from msys or cmd shell).

It fails with error: "xz: test.tar: Cannot remove: Permission denied."
Proposing workaround of using the `xz --keep` argument since keeping
test.tar is harmless and it's already in os.TempDir().

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 2f53820ce409ce1afb6513b7799d094b9c53779d
Component: engine
2015-02-12 15:42:27 -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
3799fccfba Merge pull request #10727 from ahmetalpbalkan/win-cli/integration-cli-compile-fix
Create builder/command, cut libcontainer dependency on integration-cli
Upstream-commit: 802802b7812b7c73aefec4e922cad82f8dcddd4c
Component: engine
2015-02-12 17:10:16 -05:00
106678e894 Do not use HTTP_PROXY for unix sock
Makes sure the CLI does not use HTTP_PROXY when connecting to unix
socket.
Also adds some tests to make sure this functionality works as expected.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: f6e697d2ace2ea659c1b3f7e3dcef7493baa481c
Component: engine
2015-02-12 11:38:52 -05:00
b2dfebba9a Create builder/command, cut libcontainer dependency on integration-cli
d1e9d07c introduces a dependency to libcontainer and other daemon
related packages through builder package. The only thing test needs
is set of the Dockerfile commands. Extracting them to a separate
package.

This was causing CI tests to not to compile on non-Linux platforms.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: ccde3a1f73bb4f64845e736d3173eb6f6935971f
Component: engine
2015-02-11 21:44:31 -08:00
b4e1974dec Add tests for create /etc volume
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: f3713010dd6355cc89944cc4185b4c5023fd95c5
Component: engine
2015-02-12 10:39:07 +08:00
b185b43330 Show err msg on empty 'scratch' Dockerfile
If you have a Dockefile with just:
   FROM scratch

An error is generated but its never shown to the CLI. This PR fixes that.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 1654dfdf146df42a1271696c0290027460cce59a
Component: engine
2015-02-10 11:43:45 -08:00
64a4aefa3d Merge pull request #10671 from tiborvass/remove-fail-word-from-tests
Remove word "fail" from tests
Upstream-commit: d14751bf30a70abe7bc6048af61848eed32ca140
Component: engine
2015-02-09 20:53:15 -08:00
1ebda39c1c Merge pull request #10561 from duglin/SupportNoArgCmds
Add support for no-arg commands in Dockerfile
Upstream-commit: 7cc76a7fda2b039a68aa1e1612474e2c4c0c5821
Component: engine
2015-02-09 18:08:14 -08:00
e0ebfad813 Remove word "fail" from tests
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: aadb6289ccd84b9997a43c8b74b2948236f30e76
Component: engine
2015-02-09 18:01:52 -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
bed01ba5bf fix the problem that memory-swap=-1 is not working for docker command
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: aee28e0e87385de153e60e21c314032892b350f2
Component: engine
2015-02-09 10:36:49 +08:00
4413092410 Get list of Dockerfile cmds from builder so we can be smarted in our tests
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: d1e9d07c1b09a145b881a7ee6d58cc2e860167c8
Component: engine
2015-02-08 08:09:02 -08:00
d3182181ac Add support for no-arg commands in Dockerfile
We're hoping to add some new commands that don't have any args so this
PR will enable that by removing all of the hard-coded checks that require
commands to have at least one arg.  It also adds some checks to each
command so we're consistent in the error message we get.  Added a test
for this too.

We actually had this check in at least 3 different places (twice in the
parser and once in most cmds), this removes 2 of them (the parser ones).

Had to remove/modify some testcases because its now legal to have certain
commands w/o args - e.g. RUN. This was actually inconsistent because
we used to allow "RUN []" but not "RUN" even though they would generate
(almost) the same net result.  Now we're consistent.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: e4f02abb51534e560311b0afcfb7b586d9587e67
Component: engine
2015-02-08 03:36:49 -08:00
31dee84599 Merge pull request #10607 from chenhanxiao/enable-upper-proto
nat: enable upper case proto
Upstream-commit: f208201375278e0e572d2a7f5a57e5c8b2ee1e4b
Component: engine
2015-02-07 16:56:35 -08:00
417c803e58 docker_cli_build_test: add testcase of EXPOSE 5678/UDP
test whether we could use upper case proto in EXPOSE

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Upstream-commit: 0552f1a0caf8f8e57736d05c2ed42f82e97df5f6
Component: engine
2015-02-08 07:04:22 +08:00
4f7caf8a2c Fixed one small typo of docker_cli_build_test.go
Signed-off-by: André Martins <martins@noironetworks.com>
Upstream-commit: ab4bc988bcf2aae34c27be7e91d86a4c63a1af8d
Component: engine
2015-02-07 15:37:58 +00:00
ffcc4076f8 Merge pull request #10594 from dmcgowan/v2-registry-tarsum-errors
Update verification message logic
Upstream-commit: c03d6f57b6956f305a9afcbdc530a15bbe729fce
Component: engine
2015-02-06 17:01:34 -08:00
d6536422f4 Merge pull request #10112 from cpuguy83/4393_fix_volume_where_file_exists
Error out if file in container at volume path
Upstream-commit: b0ed2da4418d62d2d7b940b49e0e89bdcd264569
Component: engine
2015-02-06 19:39:48 -05:00
df52d83f51 Merge pull request #10622 from estesp/10618-err-ondup-bind-vols
Don't allow duplicate `-v` specifications for the same target
Upstream-commit: 271a073a04cdffbeda5f83d2d227c5e8c5f8ae86
Component: engine
2015-02-06 15:03:56 -08:00