Commit graph

91 commits

Author SHA1 Message Date
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
John Howard
f9a3558a9d Windows: Get Integration CLI running
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-04 12:32:40 -07:00
Brian Goff
5929502b4e Merge pull request #15412 from vdemeester/dont-sleep-too-much
time.Sleep in integration tests — comment and waitRun/waitInspect
2015-08-21 20:43:55 -04:00
Shijiang Wei
fcf9daad91 fix a panic when the exec fails to start
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-08-22 00:01:44 +08:00
Soshi Katsuta
5b870d7fa6 integration-cli: modify %s to %d in formatting an int
Signed-off-by: Soshi Katsuta <katsuta_soshi@cyberagent.co.jp>
2015-08-19 12:06:05 +09: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
Tim Dettrick
90326939c8 Updated test to check for exec --privileged side-effects
Also improving documentation for same feature as part of
docker/docker#14113 docs review.

Signed-off-by: Tim Dettrick <t.dettrick@uq.edu.au>
2015-08-13 16:37:20 +10:00
Tim Dettrick
03f65b3d0d Revert "Revert "Add docker exec run a command in privileged mode""
This reverts commit 40b71adee3.

Original commit (for which this is effectively a rebased version) is
72a500e9e5 and was provided by Lei Jitang
<leijitang@huawei.com>.

Signed-off-by: Tim Dettrick <t.dettrick@uq.edu.au>
2015-08-13 16:36:44 +10:00
Doug Davis
fe6a7c8e57 Another try to fix InspectExecID
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-08-04 09:21:41 -07:00
Michael Crosby
bfc51cf660 Don't mount /proc as ro
This caused a regression with LSM labeling.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-07-30 10:57:50 -07:00
Brian Goff
693ba98cb9 Don't pass check.C to dockerCmdWithError
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-07-27 14:33:32 -04:00
Alexander Morozov
4dbdd98b41 Merge pull request #14547 from duglin/ErrDeadExec
Return 404 on exec-inspect when container is dead but exec is still around
2015-07-27 10:46:32 -07:00
Qiang Huang
bcc0968a2c Remove unnecessary container cleanup in integration-cli
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-24 14:48:26 +08:00
Qiang Huang
668e2369cc dockerCmd when possible
Addresses: #14603

integration-cli/docker_cli_daemon_experimental_test.go (hqhq)
integration-cli/docker_cli_daemon_test.go (hqhq)
integration-cli/docker_cli_diff_test.go (hqhq)
integration-cli/docker_cli_events_test.go (hqhq)
integration-cli/docker_cli_events_unix_test.go (hqhq)
integration-cli/docker_cli_exec_test.go (hqhq)
integration-cli/docker_cli_exec_unix_test.go (hqhq)
integration-cli/docker_cli_experimental_test.go (hqhq)
integration-cli/docker_cli_export_import_test.go (hqhq)
integration-cli/docker_cli_help_test.go (hqhq)
integration-cli/docker_cli_history_test.go (hqhq)
integration-cli/docker_cli_images_test.go (hqhq)
integration-cli/docker_cli_import_test.go (hqhq)
integration-cli/docker_cli_info_test.go (hqhq)
integration-cli/docker_cli_inspect_test.go (hqhq)
integration-cli/docker_cli_kill_test.go (hqhq)

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-20 14:55:40 +08:00
Doug Davis
f06620ece3 Move inspect into the loop on InspectExecID test
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-17 17:30:24 -07:00
Jessie Frazelle
465192cb28 Merge pull request #14706 from duglin/FixInspectTest
Fix InspectExecID test
2015-07-17 14:37:23 -07:00
Doug Davis
c5c98c31a1 Fix InspectExecID test
The check for the end of the loop was off by one which is why we saw
errors on the following inpsect() call instead of a timeout

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-17 06:46:37 -07:00
Doug Davis
97c5f64001 Add missing 'err' to Fatalf to help debug an issue
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-16 20:27:14 -07:00
Antonio Murdaca
26ce3f4c90 Add minor vet fixes
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-12 19:16:38 +02:00
Doug Davis
d841b779fd Return 404 on exec-inspect when container is dead but exec is still around
When a container is removed but it had an exec, that still hasn't been
GC'd per PR #14476, and someone tries to inspect the exec we should
return a 404, not a 500+container not running.  Returning "..not running" is
not only misleading because it could lead people to think the container is
actually still around, but after 5 minutes the error will change to a 404
after the GC. This means that we're externalizing our internall soft-deletion/GC
logic which shouldn't be any of the end user's concern. They should get the
same results immediate or after 5 minutes.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-10 20:19:42 -07:00