Commit Graph

208 Commits

Author SHA1 Message Date
Joffrey F 0258c6e622 Update `Client.create_volume` to use new endpoint
New API endpoint is POST /volumes/create (previously just /volumes)
Since the feature is yet unreleased (RC), no fallback strategy is
implemented.

Signed-off-by: Joffrey F <joffrey@docker.com>
2015-10-21 13:51:09 -07:00
Joffrey F 23cf76838a Use DOCKER_CONFIG environment variable to look up auth config
When provided, default paths are ignored.

Signed-off-by: Joffrey F <joffrey@docker.com>
2015-10-09 17:15:19 -07:00
Joffrey F eb869c0bd3 Fix tests
Skips were masking some errors / compatibility issues

Signed-off-by: Joffrey F <joffrey@docker.com>
2015-10-08 12:09:59 -07:00
Aanand Prasad 1df3226c9b Implement methods for managing networks
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-10-05 16:46:25 +01:00
Joffrey F 7884ab9fe2 Merge pull request #789 from PierreF/top_ps_args
Allow to specify ps_args when listing processes
2015-09-28 14:36:08 -07:00
Pierre Fersing c1577606be Added test for "top" function
Signed-off-by: Pierre Fersing <pierre.fersing@bleemeo.com>
2015-09-28 11:59:25 +02:00
Aanand Prasad 29b12cf007 _url can take arbitrarily many arguments
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-09-25 14:25:00 -07:00
Joffrey F acd5e634ff Generic skip decorator for low API version accessible to all tests
Add simpler version comparison functions
Add decorator to enforce minimum version in API methods
Fix utils imports
Add minimum_version decorators on API methods that needed it
GroupAdd test requires API version >= 1.20

Signed-off-by: Joffrey F <joffrey@docker.com>
2015-09-16 12:55:13 -07:00
Joffrey F 05267f63d3 Modify unit tests suite to allow mock routes to optionally be method-aware
Added mock API routes for volumes API
Add unit tests and integration tests for volume API

Signed-off-by: Joffrey F <joffrey@docker.com>
2015-09-16 12:54:26 -07:00
Joffrey F c735cc69a0 Split different APIs into several mixins for clarity / easier maintenance
Signed-off-by: Joffrey F <joffrey@docker.com>
2015-09-11 16:19:29 -07:00
Joffrey F 3d884f9a3c Test URL construction 2015-08-31 15:01:40 -07:00
Aanand Prasad 20e142fe78 Better support for .dockerignore
- Support all basic pattern forms: file, directory, *, ?, !

- Fix handling of wildcard patterns and subdirectories - `*/a.py` should
  match `foo/a.py`, but not `foo/bar/a.py`

- Fix handling of directory patterns with a trailing slash - make sure
  they're handled equivalently to those without one

- Fix handling of custom Dockerfiles - make sure they go in the tarball

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-08-26 19:14:09 +01:00
Aanand Prasad d5bcdaf2f8 Use pytest helpers to assert exceptions and deprecated warnings
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-08-25 16:34:33 +01:00
Aanand Prasad 6e27c2a3d0 Run tests with pytest
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-08-25 16:34:33 +01:00
Aanand Prasad 36424ca001 Stop catching Exception in tests where it isn't expected
The test runner will report on the exception anyway, so it's redundant.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-08-25 16:00:42 +01:00
Aanand Prasad d9a149f327 Merge pull request #732 from docker/version-dependent-hostconfig
Version dependent hostconfig
2015-08-25 14:03:51 +01:00
Colin Huang edebf3756a Split the entrypoint string to shell-like syntax. 2015-08-25 09:44:47 +08:00
Joffrey F 595965ebc4 Adapt tests to new create_host_config usage 2015-08-24 16:25:18 -07:00
Mohit Soni 3caaa0050b Added support for cgroup parent
Clean up cgroup_parent usage
2015-08-24 14:43:05 -07:00
Joffrey F 42b712d100 Merge pull request #680 from aanand/fix-timestamp-conversion
Enforce UTC datetimes in arguments to `events()`
2015-07-21 10:45:29 -07:00
Aanand Prasad 657420a4d3 Enforce UTC datetimes in arguments to `events()`
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-21 10:49:27 +01:00
Aanand Prasad 33e1a58b60 Stop pinging registries from the client
The daemon already pings the registry, so doing it on our end is
redundant and error-prone.

The `insecure_registry` argument to `push()`, `pull()` and `login()` has
been deprecated - in the latter case, it wasn't being used anyway.

The `insecure` argument to `docker.auth.resolve_repository_name()` has
also been deprecated.

`docker.utils.ping_registry()` has been deprecated.

`docker.auth.expand_registry_url()` has been removed.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-20 19:50:18 +01:00
Dan O'Reilly 70b921f8a3 Fix handling output from tty-enabled containers.
Treat output from TTY-enabled containers as raw streams, rather than
as multiplexed streams. The docker API docs specify that tty-enabled
containers don't multiplex. Also update tests to pass with these
changes, and changed the code used to read raw streams to not
read line-by-line, and to not skip empty lines.

Addresses issue #630

Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
2015-07-06 18:20:41 -04:00
Joffrey F ac90a874be Merge pull request #644 from docker/memory-memswap-hostconfig
memory / memswap in hostconfig
2015-06-30 15:06:32 -07:00
Joffrey F 237ce20013 Merge branch 'id-resolution-in-check-resource' of https://github.com/posita/docker-py into posita-id-resolution-in-check-resource 2015-06-30 01:46:22 +02:00
Joffrey F a12ba1a96f Updated tests for mem_limit changes 2015-06-19 02:13:12 +02:00
Joffrey F e05d06bcf2 Merge branch 'allow-any-mode' of https://github.com/aanand/docker-py into aanand-allow-any-mode 2015-06-18 21:10:13 +02:00
Luke Marsden 5fa7576e8c Add volume_driver param to client.create_container
- Add appropriate test which also asserts that volume names can be passed through to drivers.
- Add new param to docs.

Signed-off-by: Luke Marsden <luke@clusterhq.com>
2015-06-18 20:38:21 +02:00
Aanand Prasad 1446b8c5ee Allow binds to be specified as a list of strings
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-06-12 12:36:59 -04:00
Aanand Prasad 7dd7625391 Allow any mode string to be passed into a volume bind
Volume binds now take a "mode" key, whose value can be any string.

"ro" is still supported. It is an error to specify both "ro" and "mode".

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-06-05 13:25:59 +01:00
Matt Bogosian 947febcbd8 Move image/container ID resolution to @check_resource decorator. 2015-05-20 15:37:40 -07:00
Joffrey F fe12dad21b Separate check_resource inspect tests 2015-05-20 14:46:51 -07:00
Matt Bogosian de2f58d818 Fix #602. Raise ValueError on empty argument to inspect_{container,image}() methods. 2015-05-17 17:39:25 -07:00
Joffrey F 329662c53e Merge pull request #593 from docker/deprecate_start_hostconfig
Deprecate start hostconfig
2015-05-08 14:32:42 -07:00
Joffrey F 2fd2eebcb0 Added deprecation warning for host config in start 2015-05-08 14:00:58 -07:00
Joffrey F 1f74262ab3 unit test 2015-05-08 11:36:14 -07:00
Xiaojian Huang b9909c68f9 exec_resize is incorrectly passing param as json 2015-04-28 19:50:15 -07:00
Joffrey F f6b816c264 Fix #573 2015-04-28 10:48:09 -07:00
Joffrey F 7958110fda Added unit tests for container limits in build 2015-04-27 16:36:15 -07:00
Joffrey F ae329cb3ac * Separate file to store constants
* Added container_limits param to Client.build
2015-04-27 16:24:42 -07:00
Joffrey F e337a2317e Updated exec API documentation 2015-04-27 14:11:43 -07:00
Joffrey F e2ad91bdf7 Exec API tests 2015-04-27 13:57:15 -07:00
Joffrey F c2d48652ce Added check_resource decorator to interrupt command if container or image argument is None 2015-04-24 15:56:35 -07:00
Joffrey F 6228929a88 Handle ID truncate on client side in containers list (and changed default from True to False) 2015-04-22 18:00:53 -07:00
Joffrey F c7511481a6 BaseTestCase shims assertIn 2015-04-22 15:11:55 -07:00
Joffrey F a5519022d9 Merge branch 'sam/import-improvements' of https://github.com/ssssam/docker-py into ssssam-sam/import-improvements
Conflicts:
	docker/client.py
	docker/unixconn/unixconn.py
	tests/integration_test.py
2015-04-22 11:50:45 -07:00
Joffrey F 2f6579bf59 Use assertRaises in a backward compatible fashion 2015-03-25 16:07:16 -07:00
Joffrey F 6e0b5a8d70 Added assertIn shim for py2.6 2015-03-25 16:02:46 -07:00
Joffrey F b097d19f2f docs and unit test for security_opt 2015-03-25 15:40:14 -07:00
Aanand Prasad bd72bd13c7 Finish labels implementation, add tests and docs
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-03-20 15:42:10 -07:00