Commit Graph

45 Commits

Author SHA1 Message Date
e8bff97a66 Update tests to use icmd
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 92427b3a8146e048c4b85e5ece1530da97d8472d
Component: engine
2017-08-25 12:07:30 -04:00
de626e10fb Fix golint errors.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9b47b7b1519c5f2138e2933fb1fc459eb00895c0
Component: engine
2017-08-18 14:23:44 -04:00
d0052ddc0d fix expected output in tests
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: f47a61c42957c0a98944a0723b3807aa4d07ed8e
Component: engine
2017-05-05 12:14:30 -07:00
cb7f296afd Introduce cli.Wait* fuctions
These replace `wait*` functions from `docker_utils_test.go` and work
more or less like other `cli` functions.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: db35c2a5a8d93cfeac9e75a3add60ae7c64a5856
Component: engine
2017-04-14 19:27:33 +02:00
c9b5a51747 Clean some function in docker_utils_test.go
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 10e171cd9463ca0bfda4556b3eb04d9f89d1bbbf
Component: engine
2017-04-12 11:22:32 +02:00
de10a198b8 [test-integration] Migrate some more tests to cli package
Add some required command operators to the `cli` package, and update
some tests to use this package, in order to remove a few functions
from `docker_utils_test.go`

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: eeaa6c96d83575da765dfc626c2c73d8a29dda32
Component: engine
2017-03-28 15:17:31 +02:00
2758f0996d Remove pkg/integration and move it to testutil or integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 33968e6c7df164fff0a882c50ae7f4f7e6190e4b
Component: engine
2016-12-30 18:26:34 +01:00
2f9b83d720 Clean integration-cli/utils.go from most of its content
Most of the code is now on pkg/integration.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: def13fa23c812d367e3c61d9c39bdcee66929c17
Component: engine
2016-12-28 19:05:48 +01:00
25481985f3 Use check in params so we don't ignore errors
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: bcad3d5212641237fe97c9ea2668869805e3bce8
Component: engine
2016-12-08 10:56:29 +01:00
83dc9e6cea Implement Pause Resume support for Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 69985e85d37af827fe2940a35d13e8b20a08fc8c
Component: engine
2016-10-11 16:23:35 -07:00
b2a5cc3911 Using waitExitOrRemoved for docker start
Currently start command will invoke getExitCode - which is based on
Inspect API - to get returned exit code after container exits.
There's two race conditions here:

if container is started with Restart Policy, there's chance that the
container is restarted quickly before it calls getExitCode, under such
circumstance, the exit code is wrong.

if container is started with --rm, it's possible that container is
removed before getExitCode, in this situation, you can't get correct
exit code either.

Replace getExitCode with waitExitOrRemoved can solve this problem.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: b8464c1c9baf6714242cbd9b834344eff2ebfba8
Component: engine
2016-08-26 00:16:49 +08:00
b8c843c318 Fix docker start error with renamed container
This fix tries to fix the issue raised in #23716 where `docker start`
causes an error of `No such container:` if the container has been
renamed before `docker start` returns.

The issue is that `docker start` use container name passed at the
beginning to check for exit code at the end of the `docker start`.

This fix addresses the issue by always use container's `ID` to get
the information during `docker start`.

Additional integration tests have been added to cover this fix.

This fix fixes #23716.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 6e86733b47faf0d7629751987346022544b65cb7
Component: engine
2016-06-18 16:43:30 -07:00
44532d43ae Better logging for errors in some tests
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 42df9edc4a6ccfff6869fd14b2128ca3312e99db
Component: engine
2016-03-25 10:02:52 -04:00
f444846f4e integration-cli: remove not necessary -d again
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: e44689139d2ffd08c147ffe940a15a8e8616786a
Component: engine
2016-02-28 13:48:15 +01:00
ca915e8020 Windows CI: Fix TestStartAttachMultipleContainers
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: ef9f13af3d9293458a03223a030028381da4ae09
Component: engine
2016-02-23 16:24:35 -08:00
40c9bed676 Windows CI: Port docker_cli_start_test.go
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: b47749102d8bfde1ec6f87b2cd291b8f45146b67
Component: engine
2016-02-02 18:23:29 -08:00
8bc92ae008 Assert error in body of function inspectField*
1. Replace raw `docker inspect -f xxx` with `inspectField`, to make code
cleaner and more consistent
2. assert the error in function `inspectField*` so we don't need to
assert the return value of it every time, this will make inspect easier.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 62a856e9129c9d5cf7db9ea6322c9073d68e3ea4
Component: engine
2016-01-29 23:39:07 +08:00
b4b584649d Increase timeouts to fix test on ARM
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
Upstream-commit: 88c1bc10c4c2490789953e4d6065cab6e9b1585b
Component: engine
2015-11-20 23:12:12 +01:00
f66555fbae Change 'docker run' exit codes to distinguish docker/contained errors
The purpose of this PR is for users to distinguish Docker errors from
contained command errors.
This PR modifies 'docker run' exit codes to follow the chroot standard
for exit codes.
Exit status:
125 if 'docker run' itself fails
126 if contained command cannot be invoked
127 if contained command cannot be found
the exit status otherwise

Signed-off-by: Sally O'Malley <somalley@redhat.com>
Upstream-commit: 41de7a18d8f231568977e66bb58a6a02545d49d9
Component: engine
2015-11-04 15:18:50 -05:00
acccf55db2 use of checkers on Integration test
Part of #16756

Use c.Assert instead of condition judgement in
integration-cli/docker_cli_start_test.go

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 08944cdef7397752a686ea800e110a8fa14ce719
Component: engine
2015-10-20 23:07:33 +08:00
c03ccb6893 Windows: Get Integration CLI running
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f9a3558a9d75ed6a2f9f1b2d80800226afaa74a5
Component: engine
2015-09-04 12:32:40 -07:00
6e14356132 Don't pass check.C to dockerCmdWithError
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 693ba98cb9118bf15caaabc69ca281c0ce604226
Component: engine
2015-07-27 14:33:32 -04:00
018c7593fb CI: use dockerCmd in integration-cli when possible
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: 012b67c3ea5bff539673deaa7058036126ac1046
Component: engine
2015-07-22 17:55:41 +08:00
89782c55eb Volumes refactor and external plugin implementation.
Signed by all authors:

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Jeff Lindsay <progrium@gmail.com>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Signed-off-by: Luke Marsden <luke@clusterhq.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 81fa9feb0cdc0773eff99d7393c16271e84aac08
Component: engine
2015-05-21 20:34:17 -07:00
9e12a52ca0 Use inspectField to simplify code
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 74f8a4eca4d504867aaea63a35ef1e491d332f74
Component: engine
2015-05-18 10:06:13 +08:00
6982f607b4 c.Fatal won't fail and exit test inside a goroutine, errors should be handled outside with a channel
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 4203230cbbf46238e38099c9073bdcad5f69a63f
Component: engine
2015-04-29 17:02:22 +02:00
ae74d9f34f trivial: typo cleanup
Signed-off-by: David Mackey <tdmackey@booleanhaiku.com>
Upstream-commit: 3941623fbc3fa724d61f53121513ffd87d03b61c
Component: engine
2015-04-27 13:35:08 -07: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
5e15f55a29 Removed unnecessary error output from dockerCmd
Changed method declaration. Fixed all calls to dockerCmd
method to reflect the change.

resolves #12355

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
Upstream-commit: 621b601b3c602aab5ef0f07903fdf413881bb261
Component: engine
2015-04-17 09:11:14 -07:00
6adf3865a5 Rename TestStartSilentAttach to TestStartAttachSilent
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
Upstream-commit: e7a2e2bf7e5adbbed0443cc99ab728d5118b3b7b
Component: engine
2015-04-10 10:45:38 -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
0913f2905d Changed snake case naming to camelCase
Signed-off-by: Peter Choi <phkchoi89@gmail.com>
Upstream-commit: ae907e7af16136225417242ef5d55d3f6062fb3b
Component: engine
2015-03-26 15:05:45 -06:00
a1d0fa6752 Fix hanging up problem when start and attach multiple containers
Signed-off-by: Mabin <bin.ma@huawei.com>
Upstream-commit: 7dc1af146d24c346ac74c9dcb1df98f9ef51339d
Component: engine
2015-03-23 12:10:22 +08:00
d549c28940 Fix docker start muliple containers continue on one failed and
add docker start show error message from daemon when start failed

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 2a5a50dca7dc56d390a70c0258ac1b8df3cd4d94
Component: engine
2015-03-08 13:44:25 +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
11776a4f9e Error should show when trying to start a paused container.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 02246d2d9f9fe8eb040d1eb1ac4b7a84c3f3f059
Component: engine
2015-01-14 16:49:08 -08:00
fee739749d Fix cli echoing container ID on start -a|-i
The cli now doesn't echo the container ID when started using either -a
or -i. Also fixes `TestStartAttachCorrectExitCode` which incorrectly
called start with the result of wait rather than the container ID.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: eeefa2dc8c45a9be4cfb3a52029e6b46570e5ebe
Component: engine
2015-01-06 17:58:30 -08:00
154f28d3d7 Fixes race condition in test. Closes #9389.
Signed-off-by: Emily Maier <emily@emilymaier.net>
Upstream-commit: 9c5e61c24c490ca3e9d52855ee26d4a8e9032fb2
Component: engine
2014-11-28 13:48:50 -05: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
507970cff9 Fix: Failed Start breaks VolumesFrom
Running parseVolumesFromSpec on all VolumesFrom specs before initialize
any mounts endures that we don't leave container.Volumes in an
inconsistent (partially initialized) if one of out mount groups is not
available (e.g. the container we're trying to mount from does not
exist).

Keeping container.Volumes in a consistent state ensures that next time
we Start() the container, it'll run prepareVolumes() again.

The attached test demonstrates that when a container fails to start due
to a missing container specified in VolumesFrom, it "remembers" a Volume
that worked.

Fixes: #8726

Signed-off-by: Thomas Orozco <thomas@orozco.fr>
Upstream-commit: fb62e184412b6d2bf38975a7051738f05b1f413d
Component: engine
2014-11-10 17:32:16 +01:00
98a7bd658b save start error into State.Error
when a container failed to start, saves the error message into State.Error so
that it can be retrieved when calling `docker inspect` instead of having to
look at the log

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Upstream-commit: fb6ee865a949905f678aa7c7066c809664a8a4aa
Component: engine
2014-10-22 22:42:37 -04:00
8b67174f01 Return container exit code with start -a/-i
Addresses #8555

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 65edb07065e9e8a08090a4ac88cf449b7faaff09
Component: engine
2014-10-18 23:00:20 -04:00
a47e9ab2de Fix #7843
When doing `docker start -a` on a container that won't start, terminal
was getting stuck on the attach, even after container removal.

Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
Upstream-commit: 9ae9d7db574083ce6233b33e8b0bbefb219d7fe6
Component: engine
2014-09-26 11:31:02 -04:00
4f5eeb82b1 Remove racy test causing tests to stall
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: a9d6eef2386a3d08840e2a30bd8d6f2ae3679688
Component: engine
2014-04-02 13:22:51 +00:00
3205f2e595 Make sure to set error reguardless of attach or stdin
Fixes #3364
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 51d9a04f17d1c8c6c1a069227c1417b20283dda2
Component: engine
2014-03-31 18:33:14 +00:00