Commit Graph

370 Commits

Author SHA1 Message Date
322a07231d Merge pull request #12159 from mrunalp/feature/ipc_share_dev
ipc: Share /dev/shm and /dev/mqueue when --ipc container:<id/name> is used
Upstream-commit: 903cd2b9e3e2cea8b5ee7c0b74d52ff4a3beafb5
Component: engine
2015-08-24 17:55:03 -07:00
a5560b01cb Merge pull request #15766 from hqhq/hq_fix_device
Add mode check for device
Upstream-commit: 6b21e98432ef3c4c9b7da42cdb94749b9181b654
Component: engine
2015-08-24 10:58:49 -07:00
d98907dbfe Merge pull request #15444 from coolljt0725/add_test_require_for_test_blkio
Add test require for TestRunWithBlkioInvalidWeight and TestRunWithBlkio
Upstream-commit: 2b174d3d9d6f6308a8092c93ff74461f2a946fee
Component: engine
2015-08-24 08:33:17 -04:00
fdb06e387e Add mode check for device
This fixes two problems:
1. docker run --device /dev/sda:rw ubuntu bash doesn't work
2. --device /dev/zero:/dev/noro:ro doesn't show clear error message,
but fail when writing to cgroup file.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 429423624c61b38efeaeda95792077a0da65c4ef
Component: engine
2015-08-24 17:57:12 +08:00
7143030753 Merge pull request #15571 from ewindisch/apparmor_denywproc
AppArmor: Deny w to /proc/* files
Upstream-commit: 9bac520c129c9fd5c9415b5170a66567d85247b4
Component: engine
2015-08-24 11:03:41 +02:00
bfcda62bd6 Add some missing cgroup test require and refactor the require check.
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: c340ca4f5db9ab526532f26718a140654ff45458
Component: engine
2015-08-24 11:37:11 +08:00
e2e0f70ccb Merge pull request #15412 from vdemeester/dont-sleep-too-much
time.Sleep in integration tests — comment and waitRun/waitInspect
Upstream-commit: 5929502b4e05ed82e78347169f3ba705cac8ad35
Component: engine
2015-08-21 20:43:55 -04:00
83fa43c4c9 Modify test to include /dev/shm sharing
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Upstream-commit: 457aeaa2e1bdbb75c5b3bcedacde460920965c2f
Component: engine
2015-08-19 12:36:57 -04:00
e87b5d1d77 integration-cli: fix printf verbs of wrong types
Signed-off-by: Soshi Katsuta <katsuta_soshi@cyberagent.co.jp>
Upstream-commit: 5759b95e7e7c269af48a095773961ed8d13f8798
Component: engine
2015-08-19 17:47:33 +09:00
22da8315f6 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>
Upstream-commit: 799d9605d6d37a0f5c559b0325d924ad183ff4ee
Component: engine
2015-08-18 20:36:08 +02:00
a3521c2e7e fix in daemon side
Signed-off-by: Zhang Kun <zkazure@gmail.com>

goformat

Signed-off-by: Zhang Kun <zkazure@gmail.com>

fix small

Signed-off-by: Zhang Kun <zkazure@gmail.com>

change to rm

Signed-off-by: Zhang Kun <zkazure@gmail.com>

handler other error

Signed-off-by: Zhang Kun <zkazure@gmail.com>

unique ERR

Signed-off-by: Zhang Kun <zkazure@gmail.com>

setHostConfig_fail_test

Signed-off-by: Zhang Kun <zkazure@gmail.com>

format

Signed-off-by: Zhang Kun <zkazure@gmail.com>

err handle and modify test

Signed-off-by: Zhang Kun <zkazure@gmail.com>

golint error

Signed-off-by: Zhang Kun <zkazure@gmail.com>
Upstream-commit: 1ed15550f57ae822bb30263ce81174cabeb794ec
Component: engine
2015-08-18 10:06:36 +08:00
9aef8f471d AppArmor: Deny w to /proc/* files
Introduce a write denial for files at the root of /proc.

This prohibits root users from performing a chmod of those
files. The rules for denials in proc are also cleaned up,
making the rules better match their targets.

Locally tested on:
- Ubuntu precise (12.04) with AppArmor 2.7
- Ubuntu trusty (14.04) with AppArmor 2.8.95

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 7342d59114fe443ae8d59474abb59280f014c493
Component: engine
2015-08-13 15:39:25 -04:00
755087c2f9 Merge pull request #15420 from vlajos/typofixes-vlajos-20150807
typofix - https://github.com/vlajos/misspell_fixer
Upstream-commit: bf892dcfcc002ee374057033a940ce2250181066
Component: engine
2015-08-08 01:08:49 -07:00
3cfa964774 Merge pull request #14965 from stefanberger/nohidevols2
Have network files mounted read-only when -v parameter has 'ro' passed
Upstream-commit: 196aa6d62d7084033a37f7085c2b2f55cd744d34
Component: engine
2015-08-07 19:10:59 -07:00
2c6e673ce7 typofix - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
Upstream-commit: 514623272398574c8fd7ef3fe42c5b2ae161349a
Component: engine
2015-08-07 23:25:49 +01:00
70e2333c7e Have network files mounted read-only when -v parameter has 'ro' passed
Have network files mounted read-only when mounted using the -v
open and -v parameter has 'ro' passed.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 38295d4b48fed3d9569100543a25e46b21deba46
Component: engine
2015-08-06 20:37:28 -04:00
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