Commit Graph

121 Commits

Author SHA1 Message Date
cfd34d85d8 Remove SameHostDaemon, use testEnv.IsLocalDaemon instead
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 43b15e924ffb7790ae087feac7618308a9e4b75e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 3304d91f1e69b53e92240fd3c604d178b0601dd5
Component: engine
2019-04-17 23:09:35 +02:00
f976c75276 Remove use of deprecated client.NewEnvClient()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c8ff5ecc091278520a890ce58ed891ec354bf6d9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: b9102e2a6b4bb79e080e9ce9d46046532df6f152
Component: engine
2019-04-17 23:08:34 +02:00
3736c7fe0e Disable TestExecWindowsOpenHandles on RS5 temporarily
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 15a25f6eb94d0f033045fadc3b8beedcb32e426f
Component: engine
2018-08-20 19:48:20 -07:00
fe821da2fd integration: use %s for check.Commentf()
It is wrong to pass an arbitrary string to a function expecting
%-style formatting. One solution would be to replace any % with %%,
but it's easier to just do what this patch does.

Generated with:

for f in $(git grep -l 'check.Commentf(out)'); do \
	sed -i -e 's/check\.Commentf(out)/check.Commentf("%s", out)/g' $f; \
done

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 83363fb2d4d97d952a0052d079faa8ae39aa20b6
Component: engine
2018-08-14 10:45:39 +03:00
4cadaa03f8 Update tests to use gotest.tools 👼
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 38457285242e57306c5b7ee652c7ccbb9fbd6713
Component: engine
2018-06-13 09:04:30 +02:00
0f96e98e12 Various code-cleanup
remove unnescessary import aliases, brackets, and so on.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f23c00d8701e4bd0f2372a586dacbf66a26f9a51
Component: engine
2018-05-23 17:50:54 +02:00
e3af8e0774 Switch from x/net/context -> context
Since Go 1.7, context is a standard package. Since Go 1.9, everything
that is provided by "x/net/context" is a couple of type aliases to
types in "context".

Many vendored packages still use x/net/context, so vendor entry remains
for now.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 7d62e40f7e4f3c17d229a7687d6fcca5448de813
Component: engine
2018-04-23 13:52:44 -07:00
3242c0b622 Fix tests creating zombie processes
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 617f89b9a357c0176efc2b5b28af8b36f5ebdbcb
Component: engine
2017-10-20 07:11:38 -07:00
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
e48013ec36 Stop using deprecated SockRequest
Signed-off-by: Stanislav Bondarenko <stanislav.bondarenko@gmail.com>
Upstream-commit: 0fd5a654280ef509a6512f84981f28d559869b90
Component: engine
2017-08-23 17:10:04 -04:00
3bffce1905 fix tests after CLI update
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 73e2f55543346b285585f350e53f82ae419f8849
Component: engine
2017-05-10 20:09:50 -04:00
b1bedaaeee [integration] make runSleepingContainer use cli package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: a899aa6796cd671d0e49e7f11edeb0553f11b356
Component: engine
2017-04-16 23:39:30 +02: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
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