Commit Graph

47 Commits

Author SHA1 Message Date
0b00c6ae1a 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>
Upstream-commit: 668e2369cc5d57d634d0e559241ea4c4cbde65d8
Component: engine
2015-07-20 14:55:40 +08:00
68f2260858 Move inspect into the loop on InspectExecID test
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: f06620ece3557eb263b221e476cef2955235ba75
Component: engine
2015-07-17 17:30:24 -07:00
a752ea3772 Merge pull request #14706 from duglin/FixInspectTest
Fix InspectExecID test
Upstream-commit: 465192cb2885acfe71509827ff2011042e0c99b9
Component: engine
2015-07-17 14:37:23 -07:00
7744d0b3be 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>
Upstream-commit: c5c98c31a184837c7f5b1f43d8ef18a676a8bf30
Component: engine
2015-07-17 06:46:37 -07:00
d7c4893fc7 Add missing 'err' to Fatalf to help debug an issue
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 97c5f64001af1ac6c9035af672e45051cab55f62
Component: engine
2015-07-16 20:27:14 -07:00
b57d4c713b Add minor vet fixes
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 26ce3f4c90058a2b2f23a2cb36492cfa7963494c
Component: engine
2015-07-12 19:16:38 +02:00
e5af478260 More extensive testing of new GC of execs
This is a follow-on to PR #14520.

PR #14520 is the quick fix to get the testing working again.

This PR makes sure that the list of execs associated with  a container goes
from zero to one (as a new exec is run), then back to zero when the exec is
finished.  However, we should be able to query the exec while the container
is still around, and even though the exec isn't listed in the container's
inspect data.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 72b75cd4e764e25cecd3f0c100597b8868c68120
Component: engine
2015-07-10 07:27:11 -07:00
b0c29eba8b Minor fix to the exec inspect test
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 899c85b40538ff75aa5c8b8f92dff55e3bff0d0b
Component: engine
2015-07-10 06:19:03 -07:00
73973301dc Default process user to container config user.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 0faa4518ed2dad592bb238838b4df2b34d2171c3
Component: engine
2015-06-29 12:52:05 -07:00
4a122abf80 TestExecStopNotHanging: log output as string
When cmd failed, log its ouput as string instead of byte array to prevent test
log like: [49 53 ....] exit status 1

Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
Upstream-commit: d898372568a3e00d4bda0359393d833a9f30fe1d
Component: engine
2015-06-11 22:53:55 -04:00
d89704cf56 Revert "Add docker exec run a command in privileged mode"
This reverts commit 72a500e9e5929b038816d8bd18d462a19e571c99.

Signed-off-by: Jessica Frazelle <princess@docker.com>

Conflicts:
	daemon/execdriver/native/exec.go
	integration-cli/docker_cli_exec_test.go
	runconfig/exec.go
Upstream-commit: 40b71adee390e9c06471b89ed845132b4ec80177
Component: engine
2015-05-26 14:12:16 -07: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
5f37bbe0bd Implement daemon suite for integration-cli
For creating and stopping test daemons automatically.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 57464c32b99b36a2963fb37da86b9870c9a56145
Component: engine
2015-04-27 15:48:29 -07:00
558ffb7c99 Merge pull request #12659 from dqminh/exec-interactive-hang
reuse same code for setting pipes in run/exec
Upstream-commit: c26695cf8a220bf33ba0efe729e2ab4b05089ea8
Component: engine
2015-04-23 16:37:49 -07:00
0bd2f00743 reuse same code for setting pipes in run/exec
This also moves `exec -i` test to _unix_test.go because it seems to need a
pty to reliably reproduce the behavior.

Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
Upstream-commit: ade8146aa82baa88bacdcf2d9c2559e8f47d71e4
Component: engine
2015-04-23 21:54:21 +00:00
12be8c3158 Allow go template to work properly with inspect
Closes #11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 231d362db73310a5243a72dcdb6df2df57c74488
Component: engine
2015-04-23 18:25:18 +00: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
ef2b1dddc8 Remove unnecessary fmt.Printf
Signed-off-by: Thomas Texier <sharkone@en-mousse.org>
Upstream-commit: 2ea1febd9aafd94985a2430c35243e539fa29f53
Component: engine
2015-04-14 20:55:32 +00:00
aaaa676179 Add docker exec run a command in privileged mode
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 72a500e9e5929b038816d8bd18d462a19e571c99
Component: engine
2015-04-11 11:26:37 +08:00
d1f2626097 Add -u|--user flag to docker exec for running command as a different user
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 2cce4791b0e75201cb65daad07d4203d1c4c2996
Component: engine
2015-04-11 11:04:24 +08:00
cb9c496f89 fix #12188 integration-cli: tests using "sleep" can timeout too early - change to "top" instead
Signed-off-by: Todd Whiteman <todd.whiteman@joyent.com>
Upstream-commit: 42d47c31367d288c7a9ae3acff635e995254469c
Component: engine
2015-04-09 10:46:57 -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
e70ef80162 correct some daemon spelling mistakes
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
Upstream-commit: 906974b185b431a8c493479f748677f3c0bc4ca3
Component: engine
2015-03-13 05:14:56 -04:00
3b04936e06 Execdriver implementation on new libcontainer API
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 68ba5f0b69c9f383269fb5bc2c78798b312e98cc
Component: engine
2015-03-06 14:46:58 -08:00
f8b58965ad integ-cli: Skip some exec tests requiring same-host daemon
This skips tests:
- `TestRunExecDir`
- `TestRunMutableNetworkFiles`

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: e6f88f091d59a32f7a1cd9baa18b9d792548f36d
Component: engine
2015-02-24 16:39:42 -08:00
2792d90e6f integ-cli: Skip new tests requiring same-host daemon
This skips tests:
- `TestExecAfterContainerRestart`

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: cfc8372c0a610ab87fed92f6ba6dd4100fef26d8
Component: engine
2015-02-24 16:30:22 -08:00
0f72ec16db Better test cleanup with defer
This fixes a few misuses of `deleteAllContainers()` cleanup
method in integration-cli suite by moving call to the
beginning of the method and guaranteeing their execution
(including panics) with `defer`s.

Also added some forgotten cleanup calls while I'm at it.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 70407ce40ca98d763da8472e7ee94b6e8d66912d
Component: engine
2015-02-20 14:04:36 -08:00
b8d956b4d4 Fix race detected in TestExecCgroup
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 8f5156e584233f3e83cfc889583fa016aabfeea9
Component: engine
2015-02-13 12:18:46 -05:00
e7f0104567 Move one last exec test :)
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 6a2c6e971d8b760931402e15513e91c71cba4b72
Component: engine
2015-01-26 17:17:08 -08:00
36ea1c732a Move links exec test & exec dir test.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 43d1c2010125e3c1ef1013ee2e8b4d9371d70d77
Component: engine
2015-01-23 16:20:46 -08:00
34351a6734 Add build flag to exec test.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: ecdbc1a0aff40fa28389d1971528641e2824e5a9
Component: engine
2015-01-23 16:18:39 -08:00
3e848a2a63 Move InspectExecID test to exec.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 957cbdbf302750f3fb3467237bebf29d87234208
Component: engine
2015-01-23 16:18:39 -08:00
8d334a8cc4 test that execin cgroups match container cgroups
Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
Upstream-commit: 9462dbb242449b126ff473d081cec04afaa936d2
Component: engine
2015-01-20 13:51:15 -05:00
eb6b6775f6 Amended TestExecParseError test
Usage string isn't printed anymore. User is adviced to see help instead
- according to coreutils standard.

Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 1db927113f3e7af83fac548c0e2da05bccbd8d56
Component: engine
2015-01-06 16:48:10 +01:00
81d2519112 Test for issue #9699
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: eda92e8834f0438ab4ec29fa26c66547279413e5
Component: engine
2014-12-26 20:11:27 -08:00
301d5a4920 Return usage on parseExec error.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 7fdbd90f8805736aa78156faf7e6f8fdd2384af7
Component: engine
2014-12-23 12:49:45 -08:00
bebcb13002 Fix vet errors about formatting directives
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a7ae7fed7311551975d2bccb7417c328be3ea478
Component: engine
2014-12-12 10:58:56 -08:00
1d39a69298 Forbid client piping to tty enabled container
Forbid `docker run -t` with a redirected stdin (such as `echo test |
docker run -ti busybox cat`). Forbid `docker exec -t` with a redirected
stdin. Forbid `docker attach` with a redirect stdin toward a tty enabled
container.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 67e3ddb75ff27b8de0022e330413b4308ec5b010
Component: engine
2014-12-09 14:30:49 -08:00
b4787aa54e Add test for exec tty stdin close
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 243a640d3e593ee11e31ac55a4df8c887c2b09c9
Component: engine
2014-12-09 14:30:49 -08:00
2b487e0de2 Fix the issue when docker exec a paused container, it will always hang.
Add the test case of this issue.

Docker-DCO-1.1-Signed-off-by: Chen Chao <cc272309126@gmail.com> (github: cc272309126)
Upstream-commit: 1bb02117db80e75f406f6c63d8d50680c1569019
Component: engine
2014-12-05 03:10:44 +08:00
c28ef478d3 Add support for docker exec to return cmd exitStatus
Note - only support the non-detached mode of exec right now.
Another PR will add -d support.

Closes #8703

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 90928eb1140fc0394e2a79d5e9a91dbc0f02484c
Component: engine
2014-11-25 17:49:25 -08:00
9a648e0fc7 test case for preserving env in exec session
Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Upstream-commit: 2bceaae42399ce33e8c724d1ac435eca6759637b
Component: engine
2014-11-20 13:05:37 -05:00
0bfbaf6019 Cleanup some integration-cli output
I noticed a few things that were bugging me in the output
of the integration-cli tests.
- one of the tests used println to stdout so we had garage sent to the screen
- some of the test, in their final log message, didn't include the name of
  the group/file e.g.  daemon - run,iptables   was just   run,iptables

And yes, I noticed this because I'm anal :-)  but also because we should keep
the output of the tests as clean as possible so its easy to spot it when
things go bad.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 0cef21cfba5b06ce7bd5d6b68865a9df0aca95fc
Component: engine
2014-11-11 08:44:32 -08:00
12147a008d Close stdin after execution with docker exec -i
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 165624062e1ac105b6e45beba51cec6439918f11
Component: engine
2014-11-05 15:12:24 -08:00
a8a998eeed Cleanup errorOut resp exec tests
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 6f1c8ff4c4fd1f001917c3af89907731561642a6
Component: engine
2014-10-16 15:06:20 -07:00
5770448fc1 test for panic on daemon restart
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 42dafe4bd84842532361a2d704493d124f438ab1
Component: engine
2014-09-18 21:54:42 +00:00