Commit Graph

109 Commits

Author SHA1 Message Date
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
8b68d758b1 Merge pull request #32076 from tmp6154/master
Bump up nproc in TestExecUlimits
Upstream-commit: 3fb84ca2f51c6f544797d8a84b11180f829f8e15
Component: engine
2017-04-03 22:30:28 +02:00
291e5291fe Change TestExecUlimits to use nofile instead of nproc
Test used to check whether ulimits applied by docker are in effect by
setting up nproc. However, in some environments (e.g. inside Virtuozzo
Containers), number of processes is higher and testcase fails. Hence, we
instead change testcase to check ulimits by setting nofile limit instead
of nproc.

Signed-off-by: Vitaly Ostrosablin <vostrosablin@virtuozzo.com>
Upstream-commit: d4e132f84da72b5c2f2f63c95a8ca5cddabf8433
Component: engine
2017-04-03 10:43:43 +03:00
9210b1bdbd Introduce a cli package for test-integration
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 50c4475df6304e0cf12ea95217eb00ab5d572e34
Component: engine
2017-03-23 18:35:22 +01:00
ee2890e0a1 Avoid TestExecWindowsOpenHandles timing out
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f8821202c649a19cbec063399174f03c3f66527c
Component: engine
2017-03-10 18:46:01 -08:00
5c89c83d5a Merge pull request #30537 from DiSiqueira/asserting_error
Underscoring an unused var in tests
Upstream-commit: e66717e9f8a8197ae7b25ecd5465b2ef8b47d56c
Component: engine
2017-02-01 16:08:20 +01:00
9601f4ac96 I found out this err var isn't being used, so underscoring it to preserve resources
Signed-off-by: DiSiqueira <dieg0@live.com>
Upstream-commit: 4bd1895241b7ad750f22b0ff18fd9a3eacfdb362
Component: engine
2017-01-31 19:48:15 -02:00
e290b2d1c4 Remove most of the runCommandWithOutput from integration tests
There is 5 calls left, that use StdinPipe that is not yet supported by
icmd.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: ecbb0e62f66da7d698c4f4583f36b927d8cfa811
Component: engine
2017-01-30 10:54:06 +01:00
406aff91c7 fix some ineffectual assignments
to make goreportcard a bit happier
https://goreportcard.com/report/github.com/docker/docker

also found that `TestCpToErrDstParentNotExists()` was
partially broken, because a `runDockerCp()` was inadvertently
removed in f26a31e80cfcc77daba0872ddb14bf03f4398311

`TestDaemonRestartSaveContainerExitCode()` didn't verify
the actual _Error_ message, so added that to the test,
and updated the test to take into account that the
"experimental" CI enables `--init` on containers.

`TestVolumeCLICreateOptionConflict()` only checked
for an error to occur, but didn't validate if the
error was due to conflicting options.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: ba0afd70e89562aa3c668c87fb9191ed9edb7260
Component: engine
2017-01-24 11:16:19 +01:00
d24367c4ff Merge pull request #30165 from xulike666/fix-typo-6/36
[combined] fix typo 
Upstream-commit: de0328560b818e86fd3eadc973f90341e5c33498
Component: engine
2017-01-19 17:21:22 +01:00
2db1bd6f28 fix typo
fix typo I found AMAP in integration-cli/*

fix typo mentioned by Allencloud

Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: 40af5691648c5b9d07b1231e3ed3be29fd66521a
Component: engine
2017-01-19 15:52:28 +08:00
bdb483e4e4 Clean more build utils in integration cli
- Remove deprecated buildImage* functions
- Rename buildImageNew to buildImage
- Use *check.C in fakeContext* setup and in getIdByName

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c10f6ef43f884306eb3ef60b2d19fdc931cf34cc
Component: engine
2017-01-17 15:42:38 +01:00
44a6bbe938 Add a new request package in integration-cli
The goal is to remove function from `docker_utils.go` and setup
simple, one-responsability package that can be well tested ; and to
ease writing request.

This moves all the calls to `sockRequest` (and similar methods) to
their counterpart in the `request` package.

This introduce `request.Do` to write easier request (with functional
argument to easily augment the request) with some pre-defined function
for the most used http method (i.e. `request.Get`, `request.Post` and
`request.Delete`).

Few of the `sockRequest` call have been moved to `request.Do` (and
`Get`, etc.) to showcase the usage of the package. There is still a
whole lot to do.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: d69d4799a312dfcae63442e290ae6667afd1a038
Component: engine
2017-01-03 11:49:30 +01: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
94e0a7d0c7 Use *check.C in StartWithBusybox, Start, Stop and Restart…
… to make sure it doesn't fail. It also introduce StartWithError,
StopWithError and RestartWithError in case we care about the
error (and want the error to happen).

This removes the need to check for error and make the intent more
clear : I want a deamon with busybox loaded on it — if an error occur
it should fail the test, but it's not the test code that has the
responsability to check that.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c502fb49dc7af89adfb2a9686354aa78c2c46002
Component: engine
2016-12-12 09:46:47 +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
3a4a35c4f7 Stop holding container lock while waiting on streams
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 07cd19655b37006c55c487e89b8e7f5269aefbf8
Component: engine
2016-10-28 12:19:22 -07:00
bf1e1cd730 Exec: Add ability to set environment variables
Keeping the current behavior for exec, i.e., inheriting
variables from main process. New variables will be added
to current ones. If there's already a variable with that
name it will be overwritten.

Example of usage: docker exec -it -e TERM=vt100 <container> top

Closes #24355.

Signed-off-by: Jonh Wendell <jonh.wendell@redhat.com>
Upstream-commit: e03bf1221ee2c863f25a57af4d415e2d8ff4f26c
Component: engine
2016-10-19 12:39:25 -02: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
3616bb2973 Fix missing hostname and links in exec env
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: e98145960988a2259074ae911b6478b7a940748b
Component: engine
2016-09-29 13:46:10 -07:00
c01ac0b550 Windows: Don't set PATH/TERM on exec
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e880bbc48bd94762489a9948814d3edea39fdcfa
Component: engine
2016-09-28 13:42:27 -07:00
7ff0928110 Windows: Enable a couple of exec tests
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: ea42182722be246b2048497908862a31cf903118
Component: engine
2016-08-30 15:03:18 -07:00
0d4234bb46 Change to use c.Assert() instead of result.Assert()
Fix delete containers and make sure it prints errors correctly.
Rename Result.Fails to Result.Assert()
Create a constant for the default expected.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 243885808f5c69143679d094d964d333c47e69bf
Component: engine
2016-08-23 15:12:36 -04:00
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
d22f93678b Migrate exec command to cobra
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: 9d9dff3d0d9e92adf7c2e59f94c63766659d1d47
Component: engine
2016-07-29 02:10:36 +00:00
c1a0ccd035 Better error on attach no tty
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f7541b00b0f68a52195ed9bac967f8f08d96aa51
Component: engine
2016-05-25 13:32:48 -07:00
e716bd46e9 Add ulimit support to libcontainerd addprocess
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 8891afd8385aeb490f8b7d9db8c3828bc7d24dc1
Component: engine
2016-03-23 19:54:32 -07:00
8ba16d91c8 Replace execdrivers with containerd implementation
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 9c4570a958df42d1ad19364b1a8da55b891d850a
Component: engine
2016-03-18 13:38:32 -07:00
0cf2a141a6 make TestExecInspectIDs less racy
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 8dd8ec137eb02519091d9361af566d7f9cd9a11f
Component: engine
2016-03-08 09:51:39 -08:00
c1d2fd21f7 Fix flaky TestExec
The container started with `-d` as part of the test requires a `waitRun`
to ensure it is actually running before attempting any other operation.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 0a7755ab4e2fc8df1992813d5364fe0f201ab913
Component: engine
2016-02-23 09:51:09 -08:00
8107240b18 Require linux for TestExecAfterContainerRestart
All the other exec tests require linux except this one and it is
causing failures in the TP4 test runs.

ref:
https://jenkins.dockerproject.org/job/Docker-PRs-WoW-TP4/1076/console

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 46e41dc2f86e27ef502c2b1a679ab95d0426c8c3
Component: engine
2016-02-16 17:50:50 -08:00
25898f320a Remove stray printf
This came in with the Windows CI work and I assume was meant for local
debug, but adds a bare printf line to the test output.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 77590d4dae9223ccd8edf9b153c669f631747f24
Component: engine
2016-02-04 10:13:31 -05:00
fc2f331561 Merge pull request #19822 from Microsoft/jjh/testexeccli
Windows CI: Initial porting CLI TestExec*
Upstream-commit: 5cdc0dfce3b058874566721b1f111baaa19df18b
Component: engine
2016-02-02 08:32:28 +01:00
cb0539b747 Windows CI: Initial porting CLI TestExec*
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: a9379b4af227f1966b71ee255fc8bcf272ffe43c
Component: engine
2016-02-01 10:19:21 -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
48b99fc11d Make test case name consistent
Replace `Tty` with `TTY` in all test case names so that we can run
a bundle of `TTY` related test cases with TESTFLAGS like
`-check.f TestExecTTY*`

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: e151ad936abecce944e3f7c285fa788c2dc1bba1
Component: engine
2016-01-24 16:32:52 +08:00
1cfc0cf7f6 Merge pull request #17373 from Microsoft/10662-volumetests
Windows: Volume integration tests
Upstream-commit: 2266462f724492d3802d7043723347adeb18024e
Component: engine
2015-10-27 19:52:11 -04:00
744e201d80 Merge pull request #17257 from echo33/docker_cli_exec_test
use of checkers on docker_cli_exec_test.go
Upstream-commit: f3f63c6044057637f3eadf78c2c939ef60556db7
Component: engine
2015-10-26 23:14:38 +01:00
14116a686a Windows: Volume integration tests
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 2af5034ce8faa1f93d81864aa25ec64527fac76b
Component: engine
2015-10-26 14:33:28 -07:00
2e3f8e6b23 use of checkers on docker_cli_exec_test.go
Signed-off-by: weiyan <weiyan3@huawei.com>
Upstream-commit: 9120a1fc3ef929b18200b4f315bb7147889a0c36
Component: engine
2015-10-26 10:01:48 +08:00
e999854115 Merge pull request #17332 from askb/17225_flakytest_TestExecEnv
Fix for the issue #17225 flaky test DockerSuite.TestExecEnv test case.
Upstream-commit: c71e97fc122d82c4bd99e47b38000d216bf360f2
Component: engine
2015-10-25 21:17:50 +01:00
b01426a7bc Fix for #17243 DockerSuite.TestExecAfterContainerRestart.
Added waitRun(containerID) statement after docker run -d and docker restart
to ensure the container is restarted before issuing a exec cmd.

Signed-off-by: Anil Belur <askb23@gmail.com>
Upstream-commit: 2a5f04dcc900888ff706e36e6360d0b51d82bed1
Component: engine
2015-10-25 21:43:31 +05:30
082dcadcb4 Fix for the issue #17225 flaky test DockerSuite.TestExecEnv test case.
This is done by calling waitRun() followed by the docker run, which ensures the container is loaded
before calling docker exec to obtain the env variable set previously.

Incorporated the change as suggeted by duglin.

Signed-off-by: Anil Belur <askb23@gmail.com>
Upstream-commit: 6d974ec19d2f484586ec57c2e2455a6de927cddf
Component: engine
2015-10-24 22:54:24 +05:30
29fa44dc8c add test-integration-cli specifics for userns
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: ea3afdad612448fc6eefcc4bdd63563be8f16946
Component: engine
2015-10-09 20:50:27 -04:00
59099af0ea Bump runc
Fixes a race when starting a container when there is an error, the stdio
streams are not always written.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: d9f5f1954cf3ba9c1f9644d7997033d5d62ab34b
Component: engine
2015-10-08 17:07:00 -04:00
ec3df7c39d While #16738 is "fixed", skip TestExecStartFails
… on windows

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: dc204b87864a06d37f9515b57bd6f76dac24a016
Component: engine
2015-10-04 18:38:21 +02:00
5c97861d03 Make sure test container is running before exec
Fixes race in TestExecStartFails

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 9077c8968950133fdfac9898a20f9887f8df78f2
Component: engine
2015-09-29 10:06:51 -04: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