Commit Graph

354 Commits

Author SHA1 Message Date
9e93b28f16 skipping test TestRunCapAddSYSTIME on lxc
Signed-off-by: Mohammed Aaqib Ansari <maaquib@gmail.com>
Upstream-commit: 84c9a6684ff159081850a60dd9cfa1f4d50ee6b8
Component: engine
2015-07-31 22:07:40 -04:00
f8cb968c76 Merge pull request #14463 from sunyuan3/TestRunCapAddSYSTIME
Add TestRunCapAddSYSTIME test case.
Upstream-commit: 5276655b694bec1125c4c119adb941a2b7531433
Component: engine
2015-07-31 09:40:12 -04:00
e9bd79ecdf Add TestRunCapAddSYSTIME test case.
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
Upstream-commit: a5e2fa2b2e30cf515d22dee532ae33d5ab695008
Component: engine
2015-07-31 12:53:46 +08:00
4d212c22a0 fix lxc test machine
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: f12e18d7ef9b1a354c10038874f0e7be0a8bb66f
Component: engine
2015-07-30 21:30:47 -07:00
76f950f781 Merge pull request #15163 from crosbymichael/proc-ro
Don't mount /proc as ro
Upstream-commit: a687448c4dec200336ed28c5ef26c8198cc0505b
Component: engine
2015-07-30 15:12:29 -04:00
114011a355 Only explicitly deny ptrace for container-originated procs
The 'deny ptrace' statement was supposed to only ignore
ptrace failures in the AUDIT log. However, ptrace was implicitly
allowed from unconfined processes (such as the docker daemon and
its integration tests) due to the abstractions/base include.

This rule narrows the definition such that it will only ignore
the failures originating inside of the container and will not
cause denials when the daemon or its tests ptrace inside processes.

Introduces positive and negative tests for ptrace /w apparmor.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: f5c388b35a9ddd699b3dbbe85b80fa02234f8355
Component: engine
2015-07-30 14:40:28 -04:00
8461105dc9 Don't mount /proc as ro
This caused a regression with LSM labeling.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: bfc51cf6605ebcf7a4ec791fb0f3b5ae7b05c6fd
Component: engine
2015-07-30 10:57:50 -07:00
36993f8dbd Fix the proc integration test & include missing AA profile
Integration tests were failing due to proc filter behavior
changes with new apparmor policies.

Also include the missing docker-unconfined policy resolving
potential startup errors. This policy is complain-only so
it should behave identically to the standard unconfined policy,
but will not apply system path-based policies within containers.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 5832715052e9e165cc40a5ac8178fa62685985aa
Component: engine
2015-07-29 17:08:51 -04:00
4e9957ee2d Merge pull request #15133 from dmcgowan/notary-fix-test-date
Skip notary tests which update system clock
Upstream-commit: 0f85fadb4ec1aa3d0270351fc72fa9a70cffd3b9
Component: engine
2015-07-29 12:51:05 -07:00
4c1bdea55d Skip notary tests which update system clock
Currently some notary tests change the system clock to check for expiration.
Skip these tests until the code can be refactored to not rely on updating the system clock.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: bf3c1e6a3afc951e41643b8d55d4ac25fa9cb06d
Component: engine
2015-07-29 12:09:40 -07:00
e9b83a5a26 Restore AppArmor profile generation
Will attempt to load profiles automatically. If loading fails
but the profiles are already loaded, execution will continue.

A hard failure will only occur if Docker cannot load
the profiles *and* they have not already been loaded via
some other means.

Also introduces documentation for AppArmor.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 3edc88f76df6a3bc9d887de8157ec71730c9057a
Component: engine
2015-07-28 17:45:51 -04:00
6e14356132 Don't pass check.C to dockerCmdWithError
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 693ba98cb9118bf15caaabc69ca281c0ce604226
Component: engine
2015-07-27 14:33:32 -04:00
abb442b01d Merge pull request #14979 from runcom/fix-flacky-TestRunNonRootUserResolvName
Fix TestRunNonRootUserResolvName flackiness
Upstream-commit: afb831d35e62139c9e7a214a471c3dd956076223
Component: engine
2015-07-24 21:50:44 -04:00
6a640c48bd Fix TestRunNonRootUserResolvName flackiness
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 30d4c70d282248ac218c6c505d5a316e5cc9ac01
Component: engine
2015-07-25 02:45:17 +02:00
4f2862dc8f Merge pull request #14546 from dmcgowan/trusted-notary-integration
Notary integration
Upstream-commit: 4f5b677fd9808b34382061c458e13d3930516889
Component: engine
2015-07-24 17:44:14 -07:00
99a373ceb8 Rename to flags and environment variables to content trust
Update help line to allow 90 characters instead of 80

The trust flag pushes out the help description column wider, requiring more room to display help messages.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 259cadb0b19a9049302e78fec529b0105efabb1d
Component: engine
2015-07-24 16:31:18 -07:00
e5887c6923 Added tests for expired snapshots and timestamps
Signed-off-by: Diogo Monica <diogo@docker.com>
Upstream-commit: 3e90b12d42f6f937639edafa4b2ddc12badf8895
Component: engine
2015-07-24 16:31:18 -07:00
937cba2db1 Add tests simulating an evil server
Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
Upstream-commit: 268fa5af4768f7b1df32501d5f7ba0daba2c2da1
Component: engine
2015-07-24 16:31:18 -07:00
97834446bf Add build integration cli tests
Clean up tests to remove duplicate code

Add tests which run pull and create in an isolated configuration directory.
Add build test for untrusted tag

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 871d2b96ed5cf234c41a5e731a34fc9deda4e9f1
Component: engine
2015-07-24 16:31:12 -07:00
5944bec2a8 ignore certain tests on lxc driver
Signed-off-by: Jessica Frazelle <princess@docker.com>
Upstream-commit: 0a5b8c40c088c90abb8e3410b92758ed603836d9
Component: engine
2015-07-24 16:10:59 -07:00
9180bba544 #14474 skip DockerSuite.TestRunCapAddCHOWN on lxc
Signed-off-by: Zhang Kun <zkazure@gmail.com>
Upstream-commit: 0547b5fb2ac98d67eea3ed56f4afae87dff3079c
Component: engine
2015-07-24 15:16:07 -07:00
be6fe06878 Add trust tests for Docker create, run, push, and pull
Created date util function

Signed-off-by: Nathan McCauley <nathan.mccauley@docker.com>
Upstream-commit: 1406cb35fd814a987b91f92ed1a4b61a21205736
Component: engine
2015-07-24 14:08:20 -07:00
e54fe5cfea Merge pull request #14925 from calavera/fix_volume_symlink_test
Remove reference to old Volumes field in inspect struct.
Upstream-commit: 9c0bb22571eca47246a210ddfdae7c7eaedb800f
Component: engine
2015-07-24 10:41:00 -04:00
4f814a612a Add and modify tests for legacy and new daemon invokations
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: e7fc632147e40f5a243158e8378082c51a3d952e
Component: engine
2015-07-23 20:31:43 -04:00
b52c35c14d Remove reference to old Volumes field in inspect struct.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: bb43bdf6c5272976215f74240ffd9db4d5fd2a3a
Component: engine
2015-07-23 16:10:31 -07:00
992fae5b93 Merge pull request #14613 from stefanberger/nohidevols2
Do not hide user provided network mounts [v2]
Upstream-commit: d106a2ea2ac7e78f0937798fbb7a21ff7fe1532c
Component: engine
2015-07-22 16:24:22 -04:00
472987774a Do not hide user provided network mounts [v2]
Prevent the docker daemon from mounting the created network files over
those provided by the user via -v command line option. This would otherwise
hide the one provide by the user.
The benefit of this is that a user can provide these network files using the
-v command line option and place them in a size-limited filesystem.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
Upstream-commit: 6bd389b9db38eaf4ce2b9cc0cf5024f8450504ef
Component: engine
2015-07-22 13:44:21 -04:00
6aa4de764e Fix golint warnings for integration-cli
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Upstream-commit: 6b3c928140193f911b73f87bb8b07f54bba5a63a
Component: engine
2015-07-22 14:03:50 +01:00
2d8d0361a7 Merge pull request #13711 from calavera/version_volumes_inspect
Expose new mount points structs in inspect.
Upstream-commit: 50d2597e490c4636ee8cacabf34bb9ed3e21d3fc
Component: engine
2015-07-22 09:02:00 +02:00
b821d19c27 Expose new mount points structs in inspect.
Keep old hashes around for old api version calls.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 1c3cb2d31ea722e2c174bf78eda62fec6949fb8b
Component: engine
2015-07-21 15:33:05 -07:00
25af73dba8 Merge pull request #14765 from runcom/fix-dockerCmd-refactor
Refactor missed dockerCmd changes
Upstream-commit: 6c95040e3b75725cb7230d7f9a22fdf36a4bb03a
Component: engine
2015-07-21 11:53:28 -04:00
74cf202b4f Move AppArmor policy to contrib & deb packaging
The automatic installation of AppArmor policies prevents the
management of custom, site-specific apparmor policies for the
default container profile. Furthermore, this change will allow
a future policy for the engine itself to be written without demanding
the engine be able to arbitrarily create and manage AppArmor policies.

- Add deb package suggests for apparmor.
- Ubuntu postinst use aa-status & fix policy path
- Add the policies to the debian packages.
- Add apparmor tests for writing proc files
Additional restrictions against modifying files in proc
are enforced by AppArmor. Ensure that AppArmor is preventing
access to these files, not simply Docker's configuration of proc.
- Remove /proc/k?mem from AA policy
The path to mem and kmem are in /dev, not /proc
and cannot be restricted successfully through AppArmor.
The device cgroup will need to be sufficient here.
- Load contrib/apparmor during integration tests
Note that this is somewhat dirty because we
cannot restore the host to its original configuration.
However, it should be noted that prior to this patch
series, the Docker daemon itself was loading apparmor
policy from within the tests, so this is no dirtier or
uglier than the status-quo.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 80d99236c1ef9d389dbaca73c1a949da16b56b42
Component: engine
2015-07-21 11:05:53 -04:00
f215de06a3 Refactor missed dockerCmd changes
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: bd328da55549dd71b3c24f27c660f1c26f277c15
Component: engine
2015-07-20 20:55:57 +02:00
56aba58eb4 CI: use dockercmd when possible
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: 27ac154d05cf9f7aa1e9cbebe3c7769fa746de1e
Component: engine
2015-07-21 04:40:15 +08:00
da9ff50d73 Simplify swappiness check
As suggested in https://github.com/docker/docker/pull/14004/files#r34022527

The concern there is we can't differentiate whether user explicitly
asked for an invalid value of -1 or he did not specify anything.

I don't think this would be a problem, because:
 - like all other default values like zero, we can't differentiate
   user specify it or not, most of which, zeros are also invalid, so
   default is default, we show these default values in help info,
   so users would know if they set value as default, it'll be like
   they set nothing.
 - we can't do this kind of string check in REST api request, so
   it'll make the behave different from docker command and RESTapi.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 6f8ddec1d0e67058c7a4a15c7d4d9a75bc1e5dea
Component: engine
2015-07-20 16:10:10 +08:00
6b6bb1a8e9 Adds test for additional groups.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Upstream-commit: 0b7938e8459eda3b80bcc581837e90edc4d6855f
Component: engine
2015-07-13 14:47:28 -04:00
11e2c4a554 Add the memory swappiness tuning option to docker.
Memory swappiness option takes 0-100, and helps to tune swappiness
behavior per container.
For example, When a lower value of swappiness is chosen
the container will see minimum major faults. When no value is
specified for memory-swappiness in docker UI, it is inherited from
parent cgroup. (generally 60 unless it is changed).

Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Upstream-commit: 921da495d24695dda66d3f58e78887dd0bc2402e
Component: engine
2015-07-12 13:16:33 +05:30
9f9bda0c57 Merge pull request #13669 from ewindisch/readonly-proc
Make /proc, /sys, & /dev readonly for readonly containers
Upstream-commit: 703248da20566f707b8290662805a9264629e2e0
Component: engine
2015-07-10 15:32:13 -07:00
0f6e3890ae Merge pull request #14480 from Microsoft/fix-windows-ci
Fix Windows CI fail due to GH13866
Upstream-commit: 56e8a99b617588f6fce5b8a311fa7d01db67c7e6
Component: engine
2015-07-09 16:37:41 -07:00
448d2ef599 Fix Windows CI fail due to GH13866 and patch up tests
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: c1b524486c80932f0c97b935f1ff9e41d30eab4e
Component: engine
2015-07-09 10:09:45 -07:00
81d1e83005 Fix volumes-from mount references.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 3d029c3bf335bc2867d1efc803096d2912b81799
Component: engine
2015-07-09 09:01:57 -06:00
237be75b88 Merge pull request #13866 from brahmaroutu/runOOM_13766
RunOOM test should check to see if Oom Control is enabled
Upstream-commit: a5283d2ff3546c1fe946aa8a1ddc076b08d5700c
Component: engine
2015-07-07 16:21:46 -07:00
7570a24c80 RunOOM test should check to see if Oom Control is enabled
closes #13766
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: e7fb38410dfcbdd83df7c9e16806bbf8fc3af8b5
Component: engine
2015-07-06 21:15:55 +00:00
be54d1050e add TestRunCapAddCHOWN test case
Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
Upstream-commit: 230179c8dc120b4b1a181e24de055bdca7963491
Component: engine
2015-07-03 23:25:52 +08:00
793088ed0a Make /proc, /sys, /dev readonly for readonly containers
If a container is read-only, also set /proc, /sys,
& /dev to read-only. This should apply to both privileged and
unprivileged containers.

Note that when /dev is read-only, device files may still be
written to. This change will simply prevent the device paths
from being modified, or performing mknod of new devices within
the /dev path.

Tests are included for all cases. Also adds a test to ensure
that /dev/pts is always mounted read/write, even in the case of a
read-write rootfs. The kernel restricts writes here naturally and
bad things will happen if we mount it ro.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 5400d8873f730e6099d29af49fe45931665c3b49
Component: engine
2015-07-02 19:08:00 +00:00
9161e24479 Move /nat to /pkg/nat
By convention /pkg is safe to use from outside the docker tree, for example
if you're building a docker orchestrator.

/nat currently doesn't have any dependencies outside of /pkg, so it seems
reasonable to move it there.

This rename was performed with:

```
gomvpkg -vcs_mv_cmd="git mv {{.Src}} {{.Dst}}" \
	-from github.com/docker/docker/nat \
        -to   github.com/docker/docker/pkg/nat

```

Signed-off-by: Peter Waller <p@pwaller.net>
Upstream-commit: 9c2374d19623581028f070bc93fa4c60a660dce4
Component: engine
2015-06-30 17:43:17 +01:00
5ec67f98b1 Fix endpoint leave failure for --net=host mode
When a container is started with `--net=host` with
a particular name and it is subsequently destroyed,
then all subsequent creations of the container with
the same name will fail. This is because in `--net=host`
the namespace is shared i.e the host namespace so
trying to destroy the host namespace by calling
`LeaveAll` will fail and the endpoint is left with
the dangling state. So the fix is, for this mode, do
not attempt to destroy the namespace but just cleanup
the endpoint state and return.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Upstream-commit: 9bb69f9726e7f8cba0cdf681e5060e47b9c45298
Component: engine
2015-06-24 12:33:52 -07:00
f29d02bba3 Merge pull request #13502 from coolljt0725/conflict_port_and_netmode
Add --net=container with --publish --expose --publish-all error out
Upstream-commit: 637023a5f8d8347a0e271c09d5c9bc84fbc97693
Component: engine
2015-06-15 16:25:59 +02:00
9eb2d545d0 fix lxc build
Signed-off-by: Jessica Frazelle <princess@docker.com>
Upstream-commit: 0adfb908a682e679b54f511fe89e668d6e676dda
Component: engine
2015-06-05 09:50:30 -07:00
93fe2d99ac test: Skip TestDevicePermissions on lxc
Closes: #13641

Signed-off-by: Zefan Li <lizefan@huawei.com>
Upstream-commit: e55649192ef9c947e9c90018c71bbc0a8d99a546
Component: engine
2015-06-02 10:27:54 +08:00