Граф коммитов

52 Коммитов

Автор SHA1 Сообщение Дата
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
Doug Davis 72b75cd4e7 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>
2015-07-10 07:27:11 -07:00
Doug Davis 899c85b405 Minor fix to the exec inspect test
Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-07-10 06:19:03 -07:00
David Calavera 0faa4518ed Default process user to container config user.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-06-29 12:52:05 -07:00
Daniel, Dao Quang Minh d898372568 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>
2015-06-11 22:53:55 -04:00
Jessica Frazelle 40b71adee3 Revert "Add docker exec run a command in privileged mode"
This reverts commit 72a500e9e5.

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

Conflicts:
	daemon/execdriver/native/exec.go
	integration-cli/docker_cli_exec_test.go
	runconfig/exec.go
2015-05-26 14:12:16 -07:00
Antonio Murdaca 4203230cbb 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>
2015-04-29 17:02:22 +02:00
Alexander Morozov 57464c32b9 Implement daemon suite for integration-cli
For creating and stopping test daemons automatically.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-27 15:48:29 -07:00
Michael Crosby c26695cf8a Merge pull request #12659 from dqminh/exec-interactive-hang
reuse same code for setting pipes in run/exec
2015-04-23 16:37:49 -07:00
Daniel, Dao Quang Minh ade8146aa8 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>
2015-04-23 21:54:21 +00:00
Srini Brahmaroutu 231d362db7 Allow go template to work properly with inspect
Closes #11641

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-04-23 18:25:18 +00:00
Alexander Morozov dc944ea7e4 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>
2015-04-21 10:28:52 -07:00
bobby abbott 621b601b3c 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>
2015-04-17 09:11:14 -07:00
Thomas Texier 2ea1febd9a Remove unnecessary fmt.Printf
Signed-off-by: Thomas Texier <sharkone@en-mousse.org>
2015-04-14 20:55:32 +00:00
Lei Jitang 72a500e9e5 Add docker exec run a command in privileged mode
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-11 11:26:37 +08:00
Lei Jitang 2cce4791b0 Add `-u|--user` flag to docker exec for running command as a different user
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-04-11 11:04:24 +08:00
Todd Whiteman 42d47c3136 fix #12188 integration-cli: tests using "sleep" can timeout too early - change to "top" instead
Signed-off-by: Todd Whiteman <todd.whiteman@joyent.com>
2015-04-09 10:46:57 -07:00
Brian Goff 475c65319b Remove `stripTrailingCharacters` from tests
This was just an alias to `strings.TrimSpace`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-06 09:21:18 -04:00
Yuan Sun 906974b185 correct some daemon spelling mistakes
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-03-13 05:14:56 -04:00
Alexander Morozov 68ba5f0b69 Execdriver implementation on new libcontainer API
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-06 14:46:58 -08:00
Ahmet Alp Balkan e6f88f091d integ-cli: Skip some exec tests requiring same-host daemon
This skips tests:
- `TestRunExecDir`
- `TestRunMutableNetworkFiles`

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

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-02-24 16:30:22 -08:00
Ahmet Alp Balkan 70407ce40c 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>
2015-02-20 14:04:36 -08:00
Brian Goff 8f5156e584 Fix race detected in TestExecCgroup
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-02-13 12:18:46 -05:00
Jessica Frazelle 6a2c6e971d Move one last exec test :)
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-01-26 17:17:08 -08:00
Jessica Frazelle 43d1c20101 Move links exec test & exec dir test.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-01-23 16:20:46 -08:00
Jessica Frazelle ecdbc1a0af Add build flag to exec test.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-01-23 16:18:39 -08:00
Jessica Frazelle 957cbdbf30 Move InspectExecID test to exec.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-01-23 16:18:39 -08:00
Daniel, Dao Quang Minh 9462dbb242 test that execin cgroups match container cgroups
Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
2015-01-20 13:51:15 -05:00
Michal Minar 1db927113f 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>
2015-01-06 16:48:10 +01:00
Alexandr Morozov eda92e8834 Test for issue #9699
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2014-12-26 20:11:27 -08:00
Jessica Frazelle 7fdbd90f88 Return usage on parseExec error.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2014-12-23 12:49:45 -08:00
Alexander Morozov a7ae7fed73 Fix vet errors about formatting directives
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2014-12-12 10:58:56 -08:00
Arnaud Porterie 67e3ddb75f 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>
2014-12-09 14:30:49 -08:00
Brian Goff 243a640d3e Add test for exec tty stdin close
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2014-12-09 14:30:49 -08:00
cc272309126 1bb02117db 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)
2014-12-05 03:10:44 +08:00
Doug Davis 90928eb114 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>
2014-11-25 17:49:25 -08:00
Daniel, Dao Quang Minh 2bceaae423 test case for preserving env in exec session
Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
2014-11-20 13:05:37 -05:00
Doug Davis 0cef21cfba 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>
2014-11-11 08:44:32 -08:00
Erik Hollensbe 165624062e Close stdin after execution with `docker exec -i`
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-11-05 15:12:24 -08:00