Commit Graph

54 Commits

Author SHA1 Message Date
eaa727c6e2 Create a unified RunCommand function with Assert()
Remove some run functions and replace them with the unified run command.
Remove DockerCmdWithStdoutStderr
Remove many duplicate runCommand functions.
Also add dockerCmdWithResult()
Allow Result.Assert() to ignore the error message if an exit status is expected.
Fix race in DockerSuite.TestDockerInspectMultipleNetwork
Fix flaky test DockerSuite.TestRunInteractiveWithRestartPolicy

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: d7022f2b46589cb9d860219e1d8278351ba147c3
Component: engine
2016-08-23 15:11:46 -04:00
2b0a71c4f1 Remove unnecessary json.Unmarshal wrapper.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: fb42e8477208badf0714a9d8ae20946a9b531dba
Component: engine
2016-08-23 15:11:46 -04:00
3e36908d7b Add a getPrefixAndSlashFromDaemonPlatform …
… to limit code duplication in integration tests :P

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 382c96ee7b02f393e7515e4cc4882738398b86a6
Component: engine
2016-02-03 15:16:00 +01:00
60a1c405c1 Fixes 16556 CI failures
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e65a7dabb9632b30df9c67ca5783d6dd55e91a7b
Component: engine
2015-09-24 11:19:00 -07:00
b5fd27f53c TestRandomUnixTmpDirPath platform agnostic
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 5d630abbab734d60cc3078fd1e94862a67e0d8fd
Component: engine
2015-09-24 09:37:07 -07:00
3d19f9af55 Add unit tests for integration cli utils function
- utils_test.go and docker_utils_test.go
- Moved docker related function to docker_utils.go
- add a test for integration-cli/checker

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5109071706cab06257b21172627ce51e5fa3a88c
Component: engine
2015-09-09 15:36:44 +02:00
22da8315f6 Remove/Comment time.Sleep in integration tests
Remove what seems unnecessary time.Sleep (1 second even) and comment the
ones that seemed necessary.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 799d9605d6d37a0f5c559b0325d924ad183ff4ee
Component: engine
2015-08-18 20:36:08 +02:00
be6fe06878 Add trust tests for Docker create, run, push, and pull
Created date util function

Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
Upstream-commit: 1406cb35fd814a987b91f92ed1a4b61a21205736
Component: engine
2015-07-24 14:08:20 -07:00
6aa4de764e Fix golint warnings for integration-cli
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Upstream-commit: 6b3c928140193f911b73f87bb8b07f54bba5a63a
Component: engine
2015-07-22 14:03:50 +01:00
81ebc3c70c Merge pull request #13499 from cpuguy83/fix_stats_unsubscribe
Fix unregister stats on when rm running container
Upstream-commit: f3e56420a311378de030f7e3240fbdf6295c0b7e
Component: engine
2015-05-27 11:10:36 -04:00
0767c7dcb9 Remove unused code
As far as I see, it's a dead code.

Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: a34cb321865c16ac42a12fe32fa3c8c4a5ffd263
Component: engine
2015-05-27 22:39:02 +08:00
49dc08b2f2 Fix unregister stats on when rm running container
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b3e8ab3021d2021202e14b912e7fdbfede4c7c20
Component: engine
2015-05-26 22:22:03 -04:00
349c8c448e Remove dead code of integration-cli/utils.go
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: 35b4ed4d174105bacbd35e3d7a0e506ff2d697b8
Component: engine
2015-05-16 16:49:55 +08:00
104194a4ef Add missing "ok" on "common ok" idiom in test util
w/o this the "ok" we're checking is from the previous type assertion.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: dd4693f67cb0ce5dc14c87ddf2a9a9f6a3406763
Component: engine
2015-05-09 05:56:10 -07:00
7bd38d02c2 Finally remove our copy of "archive/tar" now that Go 1.4 is the minimum!
IT'S ABOUT TIME. 🎉

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 576985a1dcd76a9af2c5c483e6f12035a1f47b96
Component: engine
2015-05-01 16:01:10 -06:00
954f940156 Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 844538142d95c1b7dda1bb2903179510105fe9b5
Component: engine
2015-04-27 21:50:33 +02:00
1884ef3b9b 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>
Upstream-commit: dc944ea7e48d11a2906e751d3e61daf08faee054
Component: engine
2015-04-21 10:28:52 -07:00
0ff275f7b4 remove job from pull and import
Closes #12396

Signed-off-by: Simei He <hesimei@zju.edu.cn>

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 6e38a53f96403b4cbd38e49e6b294128ed054a20
Component: engine
2015-04-17 09:55:02 -07:00
e303a2505f Move TestRunDetach to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: f7538c77efaf47fa5b82ae844b5c01887239ce65
Component: engine
2015-04-13 20:48:24 -04:00
e7731ac431 Fix TestBuildCancelationKillsSleep to not fail on Windows
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: d38c90140b8330bd355c40a0c8d1e9bd2b3664ec
Component: engine
2015-04-09 21:03:19 +02: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
5897cb3c81 Clean up integration-cli tests
My AR couldn't take it any more:
- one logDone per test
- PASSED lines don't wrap

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 9a9d23dbc40c9b650bd1f9f98a421b7ff2312f36
Component: engine
2015-03-26 17:25:50 -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
088f0e2cb3 Merge pull request #9774 from pwaller/cancellation
Add basic build cancellation
Upstream-commit: 45ee402a631a59e2a33df7b2f63a49f6f3f84f09
Component: engine
2015-03-22 19:16:23 -07:00
7c1bfa9093 Implement build cancellation
Add the capability to cancel the build by disconnecting the client.

This adds a `cancelled` channel which is used to signal that a build
should halt. The build is halted by sending a Kill signal and noticing
that the cancellation channel is closed.

This first pass implementation does not allow cancellation during a
pull, but that will come in a subsequent PR.

* Add documentation of cancellation to cli and API

* Protect job cancellation with sync.Once

* Add TestBuildCancelationKillsSleep

* Add test case for build cancellation of RUN statements.

Signed-off-by: Peter Waller <p@pwaller.net>
Upstream-commit: 671c12204cb469d868f646da1474d5bad6541770
Component: engine
2015-03-22 11:31:28 +00:00
bbeee5cd0d Remove debug log line from cgroup-parent feature e2e test.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: a7639c2e1f377b1f5903bb6435473cba4db6522f
Component: engine
2015-03-20 23:25:34 +00:00
2d903c82e5 Merge pull request #10798 from ahmetalpbalkan/win-cli/TestEventsUntag-fix
integration-cli: Remove timeout dependency on TestEventsUntag
Upstream-commit: a8b699f5d9a409702fd85a91f87f05f6bab267ed
Component: engine
2015-03-04 03:54:33 -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
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
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
4cac2d34df integration-cli: remove timeout dependency on TestEventsUntag
TestEventsUntag requires a `timeout` command which does not
exist on OS X or Windows (in fact, windows has a totally different
timeout program and this test was accidentally using it).

- Created runCommandWithOutputForDuration.
  This entirely replaces runDockerCommandWithTimeout and
  removes dependency to `timeout` command.
- Made runDockerCommandWithTimeout reuse runDockerCommandForDuration.

TestEventsUntag works now on Windows.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 5dbaea1ca99ecb51174259f5ebb814101c349edc
Component: engine
2015-02-14 02:17:42 -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
a01afb0b92 Test for restarting count
This test is for #10058
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 79d30364c95f13b9ff2ce3b4df9bb70d2ddd41f0
Component: engine
2015-01-13 20:28:44 -08:00
e61e114873 Enable test-integration-cli for Windows platform
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: f3ed42286e7df3a35ca41a4d19fab2a53a08b382
Component: engine
2014-12-20 16:40:40 -08:00
9442c6a19e Remove unnessary abstraction deepEqual
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: fa753e67ae2bf573c9dfb1da1e1135c5ef5ef415
Component: engine
2014-12-03 17:52:06 -08:00
2a07b18ca1 Remove unnecessary abstraction nLines
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 02a021119fb2b3e051b98817831a8c1a8a9fd464
Component: engine
2014-12-03 17:47:28 -08:00
4cd694cddb cleanup: remove startCommand function, only used once, and
unecessary abstraction.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 7ba9a18ade7393d942d995d34a92d757ef4af0b7
Component: engine
2014-12-03 17:43:26 -08:00
4b66ac1426 Generalize consumeSlow and add stop support
Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
Upstream-commit: 417e48e4a00c891e8fe5614ac6a1ef12de951f72
Component: engine
2014-10-30 21:11:33 +02:00
55acba12a1 Move consumeSlow() under test utils
Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
Upstream-commit: 8a81c462722c7158e481f974f628843e7c172158
Component: engine
2014-10-30 20:55:08 +02:00
bbf89a9e7f Cleanup errorOut remove errorOut functions
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 5af7facf18565100d52fa198a695ab98a9669825
Component: engine
2014-10-16 15:06:20 -07:00
b7f1d56490 Fix Tag Test for longer tags
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: de32f48e6668e9f071272d588cf6acdd7090b9ca
Component: engine
2014-10-07 19:37:08 -07: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
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
5314f1d0ea integcli: consolidate cmd exit code processing
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 97b50e0f292847a8e3f166aa9386f3e51b1c5e95
Component: engine
2014-09-22 20:32:50 +03:00
18f1860b4a integcli: fix race in runCommandWithStdoutStderr
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: c69896d8a013fca05ffee479e08605552715f901
Component: engine
2014-09-22 17:53:12 +03:00
699424477b integcli: run build tests in tmpdir
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: be924087eb5a2ab0ad79c069782e82805dd31d58
Component: engine
2014-09-17 20:05:33 +03:00
86091bac44 integ-cli: fix TestImportDisplay & add FileServer
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 9e5592d6a10ce02fb77244c7de3fff38958e0b89
Component: engine
2014-09-16 01:54:21 +03:00
71e8f9134d integ-cli: test correct directory permissions
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: cc5fb986b03ce28075a9f3aee248d401f3be0c96
Component: engine
2014-09-08 20:02:40 +03:00
9046d6de2c clean up context on build completion & add test
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 18587469789594f7ca26fc942c6d23b971a14dd3
Component: engine
2014-09-02 17:35:25 +03:00