Commit graph

214 commits

Author SHA1 Message Date
Zhang Wei
83ad006d47 Add detach event
If we attach to a running container and stream is closed afterwards, we
can never be sure if the container is stopped or detached. Adding a new
type of `detach` event can explicitly notify client that container is
detached, so client will know that there's no need to wait for its exit
code and it can move forward to next step now.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-06-03 11:59:11 +08:00
Shijiang Wei
f80bfdf85c make the error message in TestRunSeccompDefaultProfile more precise
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-05-28 09:06:25 +08:00
Justin Cormack
cfca3255a8 Split the Seccomp tests into two
The Seccomp tests ran 11 tests in parallel and this appears to be
hitting some sort of bug on CI. Splitting into two tests means that
I can no longer repeoduce the failure on the slow laptop where I could
reproduce the failures before.

Obviously this does not fix the underlying issue, which I will
continue to investigate, but not having the tests failing a lot
before the freeze for 1.12 would be rather helpful.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-27 15:38:29 -07:00
Yong Tang
397a6fefad Inconsistent --tmpfs behavior
This fix tries to address the issue raised in #22420. When
`--tmpfs` is specified with `/tmp`, the default value is
`rw,nosuid,nodev,noexec,relatime,size=65536k`. When `--tmpfs`
is specified with `/tmp:rw`, then the value changed to
`rw,nosuid,nodev,noexec,relatime`.

The reason for such an inconsistency is because docker tries
to add `size=65536k` option only when user provides no option.

This fix tries to address this issue by always pre-progating
`size=65536k` along with `rw,nosuid,nodev,noexec,relatime`.
If user provides a different value (e.g., `size=8192k`), it
will override the `size=65536k` anyway since the combined
options will be parsed and merged to remove any duplicates.

Additional test cases have been added to cover the changes
in this fix.

This fix fixes #22420.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-05-26 19:28:18 -07:00
David Calavera
60abc96acf Merge pull request #22943 from vdemeester/21769-fix-detach-keys
Fix escape-keys by preserving input if invalid
2016-05-25 09:53:53 -07:00
Justin Cormack
75385dc216 Do not run the seccomp tests that use default.json on non x86 architectures
The generated profile that we check in is for amd64 and i386 architectures
and does not work correctly on arm as it is missing required syscalls,
and also specifies the architectures that are supported. It works on
ppc64le at the moment but better to skip the test as it is likely to
break in future.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-24 17:47:30 -07:00
Vincent Demeester
0fb6190243
Fix escape-keys by preserving input if invalid
Currently, using a custom detach key with an invalid sequence, eats a
part of the sequence, making it weird and difficult to enter some key
sequence.

This fixes by keeping the input read when trying to see if it's the key
sequence or not, and "writing" then is the key sequence is not the right
one, preserving the initial input.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-24 17:14:48 +02:00
Justin Cormack
3598f2e331 Fix error channel size in seccomp test
This was not changed when the additional tests were added.
It may be the reason for occasional test failures.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-23 18:14:55 -07:00
Sebastiaan van Stijn
0e9009bae3 Merge pull request #22554 from justincormack/seccap
Align default seccomp profile with selected capabilities
2016-05-20 12:58:28 +02:00
Justin Cormack
a01c4dc8f8 Align default seccomp profile with selected capabilities
Currently the default seccomp profile is fixed. This changes it
so that it varies depending on the Linux capabilities selected with
the --cap-add and --cap-drop options. Without this, if a user adds
privileges, eg to allow ptrace with --cap-add sys_ptrace then still
cannot actually use ptrace as it is still blocked by seccomp, so
they will probably disable seccomp or use --privileged. With this
change the syscalls that are needed for the capability are also
allowed by the seccomp profile based on the selected capabilities.

While this patch makes it easier to do things with for example
cap_sys_admin enabled, as it will now allow creating new namespaces
and use of mount, it still allows less than --cap-add cap_sys_admin
--security-opt seccomp:unconfined would have previously. It is not
recommended that users run containers with cap_sys_admin as this does
give full access to the host machine.

It also cleans up some architecture specific system calls to be
only selected when needed.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-05-11 09:30:23 +01:00
Sean Christopherson
adabb51311 Add the swapMemorySupport requirement to OOM tests
Add the swapMemorySupport requirement to all tests related to the OOM killer.  The --memory option has the subtle side effect of defaulting --memory-swap to double the value of --memory.  The OOM killer doesn't kick in until the container exhausts memory+swap, and so without the memory swap cgroup the tests will timeout due to swap being effectively unlimited.

Document the default behavior of --memory-swap in the docker run man page.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
2016-05-10 11:28:00 -07:00
Antonio Murdaca
6a8ea46c67 daemon: reorder mounts before setting them
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-04-26 11:03:25 +02:00
Yong Tang
632b314b23 Relative symlinks don't work with --device argument
This fix tries to address the issue raised in #22271 where
relative symlinks don't work with --device argument.

Previously, the symlinks in --device was implemneted (#20684)
with `os.Readlink()` which does not resolve if the linked
target is a relative path. In this fix, `filepath.EvalSymlinks()`
has been used which will reolve correctly with relative
paths.

An additional test case has been added to the existing
`TestRunDeviceSymlink` to cover changes in this fix.

This fix is related to #13840 and #20684, #22271.
This fix fixes #22271.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-04-25 07:22:56 -07:00
Kai Qiang Wu(Kennan)
62cb06a6c1 Make cpu validation correct
There was an error in validation logic before, should use period
instead of quota, and also add check for negative
number here, if not with that, it would had cpu.cfs_period_us: invalid argument
which is not good for users.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-04-22 01:18:03 +00:00
Dan Walsh
9caf7aeefd Add support for setting sysctls
This patch will allow users to specify namespace specific "kernel parameters"
for running inside of a container.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2016-04-12 13:37:31 -04:00
Vincent Demeester
a0e7e13766 Merge pull request #21818 from Microsoft/jjh/tp4fortests
Windows: Remove TP4 support from test code
2016-04-12 10:07:12 +02:00
John Howard
b0e24c7393 Windows: Remove TP4 support from test code
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-04-11 15:36:31 -07:00
David Calavera
e626011bfb Merge pull request #21760 from hqhq/hq_minimum_reservation
Add minimum limit for memory reservation
2016-04-08 07:58:28 -07:00
Qiang Huang
50a6181005 Add minimum limit for memory reservation
Kernel has no limit for memory reservation, but in different
kernel versions, the default behavior is different.

On kernel 3.13,
docker run --rm --memory-reservation 1k busybox cat /sys/fs/cgroup/memory/memory.soft_limit_in_bytes
the output would be 4096, but on kernel 4.1, the output is 0.

Since we have minimum limit for memory and kernel memory, we
can have this limit for memory reservation as well, to make
the behavior consistent.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-04-06 09:37:51 +08:00
Zhang Wei
91e5bb9541 Let client print error when speicify wrong detach keys
Fix #21064

Let client print error message explicitly when user specifies wrong
detach keys.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-04 15:35:55 +08:00
Tonis Tiigi
f01e1c865f Disable privileged test from in user namespace
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-25 09:31:36 -07:00
Tonis Tiigi
ee61235880 Fix setting cgroup permission to user/privileged devices
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-03-24 14:16:33 -07:00
David Calavera
cb9aeb0413 Consolidate security options to use = as separator.
All other options we have use `=` as separator, labels,
log configurations, graph configurations and so on.
We should be consistent and use `=` for the security
options too.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-03-17 13:34:42 -04:00
Shijiang Wei
7369ddd89f speed up DockerSuite.TestRunApparmorProcDirectory
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-03-12 18:58:29 +08:00
David Calavera
dd32445ecc Merge pull request #18697 from jfrazelle/pids-cgroup
Add PIDs cgroup support to Docker
2016-03-08 14:03:36 -08:00
Jessica Frazelle
69cf03700f
pids limit support
update bash commpletion for pids limit

update check config for kernel

add docs for pids limit

add pids stats

add stats to docker client

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2016-03-08 07:55:01 -08:00
Mrunal Patel
74bb1ce9e9 Add support for NoNewPrivileges in docker
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

Add tests for no-new-privileges

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

Update documentation for no-new-privileges

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-03-07 09:47:02 -08:00
Jessica Frazelle
7ab696f6b0
fix centos when userns not in kernel
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2016-03-02 16:58:49 -08:00
Yong Tang
7ed569efdc Follow symlink for --device argument.
Fixes: #13840

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-03-01 07:16:19 +00:00
Antonio Murdaca
11435b674b
add seccomp default profile fix tests
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2016-02-19 13:32:54 -08:00
Jessica Frazelle
0d02f2a011
make tests faster no apt-key
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2016-02-11 16:28:00 -08:00
Arnaud Porterie
a943c40150 Improve remote integration-cli tests
Progress toward being able to run integration-cli campaign using a
client hitting a remote host.

Most of these fixes imply flagging tests that assume they are running on
the same host than the Daemon. Also fixes the `contrib/httpserver` image
that couldn't run because of a dynamically linked Go binary inside the
busybox image.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2016-02-11 07:31:49 -08:00
Brian Goff
c28bba0460 Merge pull request #19725 from WeiZhang555/opt-TestRunSeccompDefaultProfile
Optimize `TestRunSeccompDefaultProfile`
2016-02-01 16:01:51 -05:00
Zhang Wei
2e9bb7870a Optimize TestRunSeccompDefaultProfile
Optimize performance of `TestRunSeccompDefaultProfile`

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-01-30 10:42:06 +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
Antonio Murdaca
7ac8c77877 integration-cli: require Apparmor
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-01-26 11:57:14 +01:00
Stefan Scherer
4f339570cb Skip failing tests on ARM to get red/green feedback from Jenkins
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
2016-01-18 17:00:15 +01:00
Jessica Frazelle
2b4f64e590
fix proc regex
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2016-01-06 10:08:35 -08:00
Jess Frazelle
fa57eedff4 Merge pull request #19002 from jfrazelle/update-test-images
cleanup test images
2016-01-04 10:24:30 -08:00
Vincent Demeester
15aa2a663b Implement configurable detach key
Implement configurable detach keys (for `attach`, exec`, `run` and
`start`) using the client-side configuration

- Adds a `--detach-keys` flag to `attach`, `exec`, `run` and `start`
  commands.
- Adds a new configuration field (in `~/.docker/config.json`) to
  configure the default escape keys for docker client.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-01-03 23:03:39 +01:00
Jessica Frazelle
327421d1df
add more seccomp profile tests
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-12-30 17:30:44 -08:00
Jessica Frazelle
626c933730
cleanup jess/unshare image
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-12-30 16:20:05 -08:00
Jessica Frazelle
15674c5fb7
add docs and unconfined to run a container without the default seccomp profile
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-12-28 10:26:51 -08:00
Jessica Frazelle
a48fe62384
add default seccomp profile tests
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-12-28 10:26:48 -08:00
Jessica Frazelle
947293a280
set default seccomp profile
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-12-28 10:18:47 -08:00
Dan Walsh
89a775d2dc No options to tmpfs is valid
If you run a

docker run command with --tmpfs /mountpoint:noexec

Or certain options that get translated into mount options, the mount command can get passed "" for mount data.
So this should be valid.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2015-12-22 14:15:07 -05:00
Ma Shimiao
673f2b8697 upate TestRunWithBlkioInvalidWeightDevice with clearly invalid device name
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-12-22 12:43:42 +08:00
Ma Shimiao
843084b08b Add support for blkio read/write iops device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-12-21 09:14:49 +08:00
Christy Perez
2236ecddfb Update TestRunWithBlkioInvalidDevice Tests
/dev/sda wasn't an invalid device and this test failed, so, hopefully
/dev/sdX isn't going to exist in other envs.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
2015-12-16 10:58:31 -06:00
Christopher Jones
7c077c2c34 Fixed typo change deivce to device.
This changes deivce to device in daemon, test and docs.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2015-12-10 15:23:05 -06:00
Qiang Huang
2347f98003 Check minimum kernel memory limit to be 4M
Fixes: #18405

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-12-09 14:26:41 +08:00
Phil Estes
0433e38915 Allow non-seccomp platforms to pass integration-cli tests
Since seccomp is still a configurable build-tag, add a requirements
entry for seccomp, as well as move seccomp tests to "_unix" given it
won't be applicable to other platforms at this time.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-12-07 20:14:52 -05:00
Ma Shimiao
3f15a055e5 Add support for blkio read/write bps device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-12-04 09:26:03 +08:00
Dan Walsh
b3e527dfd2 This patch adds --tmpfs as a option for mounting tmpfs on directories
It will Tar up contents of child directory onto tmpfs if mounted over

This patch will use the new PreMount and PostMount hooks to "tar"
up the contents of the base image on top of tmpfs mount points.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2015-12-02 10:06:59 -05:00
Antonio Murdaca
ef1d410b02 fix shm size handling
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-12-01 16:29:40 +01:00
Qiang Huang
0a426c47c8 Update cgroup integration tests
Cgroup integtaion tests should cover:
- docker can run sucessfully with these options
- these cgroup options are set to HostConfig as expected
- these cgroup options are really set to cgroup files as expected
- other cases (wrong value, combinations etc..)

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-11-30 08:40:47 +08:00
Qiang Huang
dd7b4fd651 Fix kernel memory limit
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-11-28 09:47:25 +08:00
Michael Crosby
249b3a9479 Merge pull request #17459 from brahmaroutu/Power_Z_CI
Build and test Docker on IBM Power and Z using gccgo. Enable CI on Po…
2015-11-19 15:50:07 -08:00
Antonio Murdaca
7929888214 Remove deprecated cli flags
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2015-11-15 10:40:01 +01:00
Srini Brahmaroutu
b1cc78b8f5 Build and test Docker on IBM Power and Z using gccgo. Enable CI on Power and Z.
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-11-14 03:16:45 +00:00
Ma Shimiao
0fbfa1449d Add support for blkio.weight_device
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
2015-11-11 23:06:36 +08:00
Vincent Demeester
7a82429b3d Use checker for docker_cli_run_unix_test.go
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-11-06 22:49:16 +01:00
Solomon Hykes
2519f46550 Merge pull request #17700 from calavera/remove_lxc
Remove LXC support.
2015-11-05 15:22:37 -08:00
David Calavera
157b66ad39 Remove exec-driver global daemon option.
Each platform has only a driver now.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-05 17:09:58 -05:00
David Calavera
3b5fac462d Remove LXC support.
The LXC driver was deprecated in Docker 1.8.
Following the deprecation rules, we can remove a deprecated feature
after two major releases. LXC won't be supported anymore starting on Docker 1.10.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-11-05 17:09:57 -05:00
Sally O'Malley
41de7a18d8 Change 'docker run' exit codes to distinguish docker/contained errors
The purpose of this PR is for users to distinguish Docker errors from
contained command errors.
This PR modifies 'docker run' exit codes to follow the chroot standard
for exit codes.
Exit status:
125 if 'docker run' itself fails
126 if contained command cannot be invoked
127 if contained command cannot be found
the exit status otherwise

Signed-off-by: Sally O'Malley <somalley@redhat.com>
2015-11-04 15:18:50 -05:00
Srini Brahmaroutu
2046ba3e3c GCCGO requires more memory and time to start containers, fixing GCCGO x86 CI
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-10-26 19:09:00 +00:00
Vincent Demeester
e4dadeed88 Merge pull request #17011 from sunyuan3/TestRunWithBlkioInvalidWeight
update TestRunWithBlkioInvalidWeight
2015-10-15 08:34:52 +02:00
Yuan Sun
d550fbb80e update TestRunWithBlkioInvalidWeight
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-10-14 16:20:52 +08:00
Jessica Frazelle
28ad7c588f update tests
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-10-13 15:52:14 -07:00
Antonio Murdaca
06f0d03ced daemon: execdriver: lxc: fix set memory swap
On LXC memory swap was only set to memory_limit*2 even if a value for
memory swap was provided. This patch fix this behavior to be the same
as the native driver and set correct memory swap in the template.
Also add a test specifically for LXC but w/o adding a new test
requirement.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-10-13 14:46:59 -07:00
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
Yuan Sun
042d08a2a8 add TestRunInValidCPUShares
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-10-08 10:04:51 +08:00
Jess Frazelle
698e14902a Merge pull request #16159 from runcom/validate-cpuset-cpus
Validate --cpuset-cpus, --cpuset-mems
2015-10-02 11:30:46 -07:00
Yuan Sun
3571814dc5 Update TestRunWithSwappinessInvalid.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-09-28 18:13:21 +08:00
Antonio Murdaca
94464e3a5e Validate --cpuset-cpus, --cpuset-mems
Before this patch libcontainer badly errored out with `invalid
argument` or `numerical result out of range` while trying to write
to cpuset.cpus or cpuset.mems with an invalid value provided.
This patch adds validation to --cpuset-cpus and --cpuset-mems flag along with
validation based on system's available cpus/mems before starting a container.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-27 16:38:58 +02:00
Jess Frazelle
84b53c8d87 Merge pull request #14579 from hqhq/hq_add_softlimit
Add support for memory reservation
2015-09-24 12:11:36 -07:00
Yuan Sun
b89fdc120e update TestRunWithKernelMemory
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-09-24 08:41:35 +08:00
qhuang
aa1780997f Add support for memory reservation
Signed-off-by: qhuang <qhuang@10.0.2.15>
2015-09-23 14:02:45 +08:00
Yuan Sun
ab39a4c981 Add the TestRunSwapLessThanMemoryLimit case.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-09-21 22:12:19 +08:00
Antonio Murdaca
0b8b8ed9e9 integration-cli: fix tests with memory limit
If you don't have cgroup swap memory support, `dockerCmd`'s output in
these tests will be polluted by a warning from the daemon and will fail
the tests.
No need to have memory swap support for these tests to run as it will
be reset to -1 and everything will continue correctly.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-19 00:07:40 +02:00
Yuan Sun
cf6a53642a Correct wrong comment for TestRunWithoutMemoryswapLimit case.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
2015-09-18 08:28:36 +08:00
Antonio Murdaca
e5a26ec081 Deprecate -c cli short variant flag in docker run
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-09-17 15:48:48 +02:00
David Calavera
fb01c2ea3c Merge pull request #16350 from cpuguy83/fix_error_on_dev-snd_test
Skip TestRunDeviceDirectory when no /dev/snd
2015-09-16 13:56:11 -07:00
Srini Brahmaroutu
2c53643b33 adding a Dockerfile.gccgo to use gccgo compiler instead of go compiler.
temporarily disabling registry builds as crypto package is broken with gccgo.

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-09-16 18:56:01 +00:00
Brian Goff
88b895111b Skip TestRunDeviceDirectory when no /dev/snd
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-09-16 14:43:30 -04:00
David Calavera
0e50d946a2 Signal to stop a container.
Allow to set the signal to stop a container in `docker run`:
- Use `--stop-signal` with docker-run to set the default signal the container will use to exit.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-10 19:56:05 -04:00
John Howard
d7eb85bb1f Move run tests out of unix files
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-01 09:42:19 -07:00
Lei Jitang
c340ca4f5d Add some missing cgroup test require and refactor the require check.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-08-24 11:37:11 +08: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
Qiang Huang
b6f1b4ad35 Add support for kernel memory limit
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-08-19 23:56:55 +08: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
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
Ben Firshman
6b3c928140 Fix golint warnings for integration-cli
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
2015-07-22 14:03:50 +01:00
Alexander Morozov
844fc5f77c Fix cgroup parent tests
After merging mounting cgroups in container this tests doing wrong
checks. Cgroup paths could be prepended by other cgroups from host.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-21 08:59:17 -07:00
Hu Keping
71868228c7 Refactor : Use dockerCmd in integration-cli tests
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-07-17 04:07:12 +08:00
Qiang Huang
f18fb5b3ef Add cgroup bind mount by default
Libcontainer already supported mount container's own cgroup into
container, with this patch, we can see container's own cgroup info
in container.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-10 13:12:09 +08:00
John Howard
c1b524486c Fix Windows CI fail due to GH13866 and patch up tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-07-09 10:09:45 -07:00
David Calavera
a914101296 Do not require cgroups capabilities on windows to run the integration tests.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-05-29 11:42:40 -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
David Mackey
3941623fbc trivial: typo cleanup
Signed-off-by: David Mackey <tdmackey@booleanhaiku.com>
2015-04-27 13:35:08 -07: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
Brian Goff
f7538c77ef Move TestRunDetach to integration-cli
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-13 20:48:24 -04:00
Megan Kostick
05dcf26199 Fixing fail message in TestRunDeviceDirectory
Signed-off-by: Megan Kostick <mkostick@us.ibm.com>
2015-04-07 13:14:47 -07:00
Jessica Frazelle
f472c7236f fix device test on lxc, on lxc in contianers there are no dirs with devices in /dev, but this works outside a container...
Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)
2015-04-01 17:47:36 -07:00
Jessica Frazelle
664004ed0c Mounting a directory of devices like /dev/snd should mount all child devices.
I have seen a lot of people try to do this and reach out to me on how to mount
/dev/snd because it is returning "not a device node". The docs imply you can
_just_ mount /dev/snd and that is not the case. This fixes that. It also allows
for coolness if you want to mount say /dev/usb.

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <hugs@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-04-01 15:57:41 -07:00
Vishnu Kannan
a7639c2e1f Remove debug log line from cgroup-parent feature e2e test.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2015-03-20 23:25:34 +00:00
Doug Davis
301bd57b1d Ignore blank lines in getCgroupPaths
w/o this I would see:
```
  unexpected file format for /proc/self/cgroup - ""
```
while running the cgroup tests

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-03-20 05:36:34 -07:00
Vishnu Kannan
49cb1a289f Update --cgroup-parent cli integration test to use "memory" cgroup for detecting the test's
cgroups path instead of CPU.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2015-03-20 00:38:19 +00:00
Vishnu Kannan
c7267017e9 Adding integration tests for --cgroup-parent feature.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2015-03-19 02:34:42 +00:00
Jessica Frazelle
80d585b0c7 Skip new ulimits test on lxc
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
2015-03-04 08:28:32 -08:00
Brian Goff
3f39050637 Allow setting ulimits for containers
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-02-25 19:37:43 -05: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
Tonis Tiigi
f9876dade2 Fix filenames for unix only integration-cli tests
Test suffix comes after the platform/arch.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2015-01-14 00:31:25 +02:00
Renamed from integration-cli/docker_cli_run_test_unix.go (Browse further)