Commit graph

54 commits

Author SHA1 Message Date
Daniel Nephin
d7022f2b46 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>
2016-08-23 15:11:46 -04:00
Daniel Nephin
fb42e84772 Remove unnecessary json.Unmarshal wrapper.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2016-08-23 15:11:46 -04:00
Vincent Demeester
382c96ee7b Add a getPrefixAndSlashFromDaemonPlatform …
… to limit code duplication in integration tests :P

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-02-03 15:16:00 +01:00
John Howard
e65a7dabb9 Fixes 16556 CI failures
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-24 11:19:00 -07:00
John Howard
5d630abbab TestRandomUnixTmpDirPath platform agnostic
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-24 09:37:07 -07:00
Vincent Demeester
5109071706 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>
2015-09-09 15:36:44 +02:00
Vincent Demeester
799d9605d6 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>
2015-08-18 20:36:08 +02:00
Nathan McCauley
1406cb35fd Add trust tests for Docker create, run, push, and pull
Created date util function

Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
2015-07-24 14:08:20 -07:00
Ben Firshman
6b3c928140 Fix golint warnings for integration-cli
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2015-07-22 14:03:50 +01:00
Phil Estes
f3e56420a3 Merge pull request #13499 from cpuguy83/fix_stats_unsubscribe
Fix unregister stats on when rm running container
2015-05-27 11:10:36 -04:00
Hu Keping
a34cb32186 Remove unused code
As far as I see, it's a dead code.

Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-05-27 22:39:02 +08:00
Brian Goff
b3e8ab3021 Fix unregister stats on when rm running container
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-05-26 22:22:03 -04:00
Hu Keping
35b4ed4d17 Remove dead code of integration-cli/utils.go
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-05-16 16:49:55 +08:00
Doug Davis
dd4693f67c 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>
2015-05-09 05:56:10 -07:00
Tianon Gravi
576985a1dc 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>
2015-05-01 16:01:10 -06:00
Antonio Murdaca
844538142d Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-27 21:50:33 +02:00
Alexander Morozov
dc944ea7e4 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>
2015-04-21 10:28:52 -07:00
Simei He
6e38a53f96 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>
2015-04-17 09:55:02 -07:00
Brian Goff
f7538c77ef Move TestRunDetach to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 20:48:24 -04:00
Antonio Murdaca
d38c90140b Fix TestBuildCancelationKillsSleep to not fail on Windows
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-09 21:03:19 +02:00
Brian Goff
475c65319b Remove stripTrailingCharacters from tests
This was just an alias to `strings.TrimSpace`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-06 09:21:18 -04:00
Doug Davis
9a9d23dbc4 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>
2015-03-26 17:25:50 -07:00
Antonio Murdaca
b80fae7356 Refactor pkg/common, Fixes #11599
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-03-24 18:19:59 +01:00
Jessie Frazelle
45ee402a63 Merge pull request #9774 from pwaller/cancellation
Add basic build cancellation
2015-03-22 19:16:23 -07:00
Peter Waller
671c12204c 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>
2015-03-22 11:31:28 +00:00
Vishnu Kannan
a7639c2e1f Remove debug log line from cgroup-parent feature e2e test.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2015-03-20 23:25:34 +00:00
Jessie Frazelle
a8b699f5d9 Merge pull request #10798 from ahmetalpbalkan/win-cli/TestEventsUntag-fix
integration-cli: Remove timeout dependency on TestEventsUntag
2015-03-04 03:54:33 -08:00
Jessie Frazelle
47e9f90be1 Merge pull request #10794 from ahmetalpbalkan/win-cli/TestContainerApi-volume-path-fix
integration-cli: Generate unix-style volume paths for tests
2015-02-19 11:28:55 -08:00
Jessie Frazelle
cd9769c55e Merge pull request #10806 from ahmetalpbalkan/win-cli/TestSave-fix
integration-cli: use pipes for save/load tests
2015-02-18 22:42:06 -08:00
Ahmet Alp Balkan
b81105eaca 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>
2015-02-17 17:09:09 -08:00
Ahmet Alp Balkan
df5334183f 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>
2015-02-17 01:29:23 -08:00
Ahmet Alp Balkan
5dbaea1ca9 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>
2015-02-14 02:17:42 -08:00
Ahmet Alp Balkan
00cd214afe 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>
2015-02-13 23:26:08 -08:00
Alexander Morozov
79d30364c9 Test for restarting count
This test is for #10058
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-01-13 20:28:44 -08:00
Arnaud Porterie
f3ed42286e Enable test-integration-cli for Windows platform
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2014-12-20 16:40:40 -08:00
Jessica Frazelle
fa753e67ae Remove unnessary abstraction deepEqual
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-12-03 17:52:06 -08:00
Jessica Frazelle
02a021119f Remove unnecessary abstraction nLines
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-12-03 17:47:28 -08:00
Jessica Frazelle
7ba9a18ade cleanup: remove startCommand function, only used once, and
unecessary abstraction.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-12-03 17:43:26 -08:00
Tonis Tiigi
417e48e4a0 Generalize consumeSlow and add stop support
Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
2014-10-30 21:11:33 +02:00
Tonis Tiigi
8a81c46272 Move consumeSlow() under test utils
Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
2014-10-30 20:55:08 +02:00
Jessica Frazelle
5af7facf18 Cleanup errorOut remove errorOut functions
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-10-16 15:06:20 -07:00
Jessica Frazelle
de32f48e66 Fix Tag Test for longer tags
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-10-07 19:37:08 -07:00
unclejack
c0e632246d integcli: lint fixes
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-10-06 23:15:17 +03:00
unclejack
c6965e3e45 integcli: add & use dockerCmdWithTimeout & InDir
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-22 21:02:51 +03:00
unclejack
97b50e0f29 integcli: consolidate cmd exit code processing
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-22 20:32:50 +03:00
unclejack
c69896d8a0 integcli: fix race in runCommandWithStdoutStderr
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-22 17:53:12 +03:00
unclejack
be924087eb integcli: run build tests in tmpdir
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-17 20:05:33 +03:00
unclejack
9e5592d6a1 integ-cli: fix TestImportDisplay & add FileServer
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-16 01:54:21 +03:00
unclejack
cc5fb986b0 integ-cli: test correct directory permissions
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-08 20:02:40 +03:00
unclejack
1858746978 clean up context on build completion & add test
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-09-02 17:35:25 +03:00