Commit graph

110 commits

Author SHA1 Message Date
Vincent Demeester
a899aa6796
[integration] make runSleepingContainer use cli package
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-04-16 23:39:30 +02:00
Vincent Demeester
db35c2a5a8 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>
2017-04-14 19:27:33 +02:00
Vincent Demeester
10e171cd94 Clean some function in docker_utils_test.go
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-04-12 11:22:32 +02:00
Vincent Demeester
3fb84ca2f5 Merge pull request #32076 from tmp6154/master
Bump up nproc in TestExecUlimits
2017-04-03 22:30:28 +02:00
Vitaly Ostrosablin
d4e132f84d 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>
2017-04-03 10:43:43 +03:00
Vincent Demeester
50c4475df6
Introduce a cli package for test-integration
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2017-03-23 18:35:22 +01:00
John Howard
f8821202c6 Avoid TestExecWindowsOpenHandles timing out
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-03-10 18:46:01 -08:00
Vincent Demeester
e66717e9f8 Merge pull request #30537 from DiSiqueira/asserting_error
Underscoring an unused var in tests
2017-02-01 16:08:20 +01:00
DiSiqueira
4bd1895241 I found out this err var isn't being used, so underscoring it to preserve resources
Signed-off-by: DiSiqueira <dieg0@live.com>
2017-01-31 19:48:15 -02:00
Vincent Demeester
ecbb0e62f6 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>
2017-01-30 10:54:06 +01:00
Sebastiaan van Stijn
ba0afd70e8 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 f26a31e80c

`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>
2017-01-24 11:16:19 +01:00
Sebastiaan van Stijn
de0328560b Merge pull request #30165 from xulike666/fix-typo-6/36
[combined] fix typo
2017-01-19 17:21:22 +01:00
Aaron.L.Xu
40af569164 fix typo
fix typo I found AMAP in integration-cli/*

fix typo mentioned by Allencloud

Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
2017-01-19 15:52:28 +08:00
Vincent Demeester
c10f6ef43f
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>
2017-01-17 15:42:38 +01:00
Vincent Demeester
d69d4799a3
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>
2017-01-03 11:49:30 +01:00
Vincent Demeester
33968e6c7d
Remove pkg/integration and move it to testutil or integration-cli
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-30 18:26:34 +01:00
Vincent Demeester
def13fa23c
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>
2016-12-28 19:05:48 +01:00
Vincent Demeester
c502fb49dc 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>
2016-12-12 09:46:47 +01:00
Vincent Demeester
bcad3d5212
Use check in params so we don't ignore errors
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-12-08 10:56:29 +01:00
Darren Stahl
07cd19655b Stop holding container lock while waiting on streams
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-10-28 12:19:22 -07:00
Jonh Wendell
e03bf1221e 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>
2016-10-19 12:39:25 -02:00
Darren Stahl
69985e85d3 Implement Pause Resume support for Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
2016-10-11 16:23:35 -07:00
Tonis Tiigi
e981459609 Fix missing hostname and links in exec env
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-09-29 13:46:10 -07:00
John Howard
e880bbc48b Windows: Don't set PATH/TERM on exec
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-09-28 13:42:27 -07:00
John Howard
ea42182722 Windows: Enable a couple of exec tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-08-30 15:03:18 -07:00
Daniel Nephin
243885808f 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>
2016-08-23 15:12:36 -04:00
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
Akihiro Suda
9d9dff3d0d Migrate exec command to cobra
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-07-29 02:10:36 +00:00
John Howard
f7541b00b0 Better error on attach no tty
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-05-25 13:32:48 -07:00
Tonis Tiigi
8891afd838 Add ulimit support to libcontainerd addprocess
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-23 19:54:32 -07:00
Tonis Tiigi
9c4570a958 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>
2016-03-18 13:38:32 -07:00
Alexander Morozov
8dd8ec137e make TestExecInspectIDs less racy
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-03-08 09:51:39 -08:00
Arnaud Porterie
0a7755ab4e 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>
2016-02-23 09:51:09 -08:00
Michael Crosby
46e41dc2f8 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>
2016-02-16 17:50:50 -08:00
Phil Estes
77590d4dae 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)
2016-02-04 10:13:31 -05:00
Vincent Demeester
5cdc0dfce3 Merge pull request #19822 from Microsoft/jjh/testexeccli
Windows CI: Initial porting CLI TestExec*
2016-02-02 08:32:28 +01:00
John Howard
a9379b4af2 Windows CI: Initial porting CLI TestExec*
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-02-01 10:19:21 -08:00
Zhang Wei
62a856e912 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>
2016-01-29 23:39:07 +08:00
Zhang Wei
e151ad936a 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>
2016-01-24 16:32:52 +08:00
Brian Goff
2266462f72 Merge pull request #17373 from Microsoft/10662-volumetests
Windows: Volume integration tests
2015-10-27 19:52:11 -04:00
Vincent Demeester
f3f63c6044 Merge pull request #17257 from echo33/docker_cli_exec_test
use of checkers on docker_cli_exec_test.go
2015-10-26 23:14:38 +01:00
John Howard
2af5034ce8 Windows: Volume integration tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-10-26 14:33:28 -07:00
weiyan
9120a1fc3e use of checkers on docker_cli_exec_test.go
Signed-off-by: weiyan <weiyan3@huawei.com>
2015-10-26 10:01:48 +08:00
Vincent Demeester
c71e97fc12 Merge pull request #17332 from askb/17225_flakytest_TestExecEnv
Fix for the issue #17225 flaky test DockerSuite.TestExecEnv test case.
2015-10-25 21:17:50 +01:00
Anil Belur
2a5f04dcc9 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>
2015-10-25 21:43:31 +05:30
Anil Belur
6d974ec19d 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>
2015-10-24 22:54:24 +05:30
Jessica Frazelle
ea3afdad61 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>
2015-10-09 20:50:27 -04:00
Brian Goff
d9f5f1954c 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>
2015-10-08 17:07:00 -04:00
Vincent Demeester
dc204b8786 While #16738 is "fixed", skip TestExecStartFails
… on windows

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-10-04 18:38:21 +02:00
Brian Goff
9077c89689 Make sure test container is running before exec
Fixes race in TestExecStartFails

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-09-29 10:06:51 -04:00