Commit Graph

338 Commits

Author SHA1 Message Date
Aanand Prasad 75cc50f0ad Default to ~/.docker if DOCKER_CERT_PATH is empty
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-21 16:50:44 +01:00
Paul Bellamy 7de1605e9a Fix integration tests.
Forgot to update them in 33e1a58

Signed-off-by: Paul Bellamy <paul.a.bellamy@gmail.com>
2015-07-21 12:07:22 +01:00
Aanand Prasad 2c08ad21dd Merge pull request #674 from estesp/use-docker-host-in-tests
Update all client instances in integration tests to use DOCKER_HOST
2015-07-21 11:09:22 +01: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
Phil Estes f321eef031 Update all client instances in integration tests to use DOCKER_HOST
In testing Docker master with the latest docker-py release, a few new
tests exist which don't set the base_url, which is not the default unix
socket location when Docker's integration tests are running.

Also, there is no guarantee syslog can be reached from a test container
so I wrapped that test with the NOT_ON_HOST skip logic.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
2015-07-14 13:00:35 -04: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
Stephen Newey 7bbec93f64 Add test for root user as default exec_create behaviour 2015-07-02 13:24:51 +01:00
Joffrey F 2d7f1cfa1e Merge pull request #651 from docker/fix_647
Fix adapter bug + regression test
2015-06-30 15:19:14 -07: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 9e87884ba8 Fix Unix socket adapter bug with double slash in path + regression test 2015-06-30 23:59:03 +02:00
Stephen Newey 6a5a256509 Add support for user on exec_create. 2015-06-30 13:23:42 +01: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 30fac5b879 Fix stop timeout bug 2015-06-24 22:58:56 +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
Joffrey F 6fd391840e Bumped default API version == 1.19 2015-06-18 20:38:52 +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
Joffrey F 6b9ea106d7 Fixed integration test 2015-06-18 19:58:01 +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 7b2fd8cf5e Merge pull request #562 from smothiki/mems
make memory units compatible with native docker cli
2015-05-20 15:37:22 -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
smothiki ef452ed4c1 make memory units compatible with native docker cli
Signed-off-by: sivaram mothiki <smothiki@engineyard.com>
2015-05-07 20:05:32 -06:00
Joffrey F 070cbece0a Fixes for #586 2015-05-06 17:53:53 -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 c7948436e5 Added tests for log_config param 2015-04-24 15:10:51 -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 c328be7deb revert 2015-04-22 17:45:56 -07:00
Joffrey F d0a49ec3b8 Added integration test 2015-04-22 17:43:36 -07:00
Joffrey F d71bfb1b3d Improved ulimit tests 2015-04-22 15:45:49 -07:00
Joffrey F 803b37bc2e assertRaises 2.6 compat 2015-04-22 15:19:01 -07:00
Joffrey F 84fdd2925d Add tests for ulimits 2015-04-22 15:13:38 -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
Yuval Kohavi 605fc7e04f line length
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
2015-04-11 07:20:43 -05:00
Yuval Kohavi b33052b393 python 2.6 compatible
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
2015-04-11 07:17:28 -05:00
Yuval Kohavi 278e801b89 Adding port utils to split port ranges
Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
2015-04-03 17:23:50 +03: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
Aanand Prasad 014dba2841 Update default API version to 1.18
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-03-20 14:49:42 -07:00
Joffrey F 7d5c1efbbe Fix unit tests 2015-03-05 12:16:53 -08:00
Joffrey F acfa99dd10 Auto-detect integration tests 2015-03-05 12:08:41 -08:00
Tomas Tomecek 3e0496cc16 detect server version when version="auto"
heavily inspired by PR#281

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
2015-03-05 08:53:29 +01:00
Roman Mohr a86bfffd89 Properly close files and sockets in unit tests 2015-02-28 21:03:15 +01:00
Joffrey F 39ee5981b4 Merge pull request #502 from cpuguy83/498_dockerignore_special_names
Add special cases for .dockerignore
2015-02-27 11:56:19 -08:00
Joffrey F 91985b2397 Merge pull request #509 from docker/lxc_driver_test_compat
Lxc driver test compat
2015-02-27 11:48:36 -08:00
Joffrey F 0fae821350 Merge pull request #508 from docker/de-i11003
Rename test fix to take into account docker/docker#11003
2015-02-27 11:47:57 -08:00
Aanand Prasad b1a858a14d Update resolve_authconfig to bring it in line with Docker client
Instead of expanding the registry name we're looking for to a full URL,
strip entries in the authconfig down to just the hostname.

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-02-27 13:10:20 +00:00
Joffrey F 8d2b71fa7e I suck at python 2015-02-26 17:54:19 -08:00
Joffrey F e255c10f57 Ensure integration tests work with LXC exec driver 2015-02-26 17:39:44 -08:00
Joffrey F 21cc9916fd Rename test fix to take into account docker/docker#11003 2015-02-26 17:16:36 -08:00
Brian Goff ce40730b42 Add special cases for .dockerignore
Fixes #498
Allowing `Dockerfile` and `.dockerignore` in the exclusion filter
completely breaks the build on docker < 1.5

In Docker 1.5 these entries are treated as special cases when included
in the .dockerignore and are still sent as part of the context. The
daemon ends up excluding them from any `ADD`, `COPY`, and cache
validation.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-02-24 15:48:51 -05:00
Daniel Nephin 0713488fac Resolves #497 - add support for dockerfile
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2015-02-20 21:20:21 -05:00
Tianon Gravi 7f49cf1279 Fix several DOCKER_HOST assumptions in integration_test.py 2015-02-16 16:42:34 -07:00
Joffrey F 7084802da2 Fix pep8 error 2015-02-16 10:56:08 -08:00
Joffrey F c02f0ab723 Formatting 2015-02-12 15:54:16 -08:00
Joffrey F 1a7e3a2d6d Merge branch 'add-stats-api-support' of https://github.com/nir0s/docker-py into nir0s-add-stats-api-support 2015-02-12 13:15:59 -08:00
nir0s c50795a08a minor 2015-02-12 10:01:42 +02:00
nir0s 52702f7da0 removed aggregation for now and added a unit test. also using stream_helper now 2015-02-12 09:48:33 +02:00
Joffrey F cab37b604a pid_mode integration tests 2015-02-11 12:16:36 -08:00
nir0s f402af551d added initial support for stats retrieval 2015-02-11 22:04:32 +02:00
Joffrey F 22dd8d78ea Merge pull request #480 from ggtools/events
Add missing options to the events command
2015-02-11 11:13:52 -08:00
Christophe Labouisse 53b1bb41ac Fix datetime issue with Python 2.6
Signed-off-by: Christophe Labouisse <christophe@labouisse.org>
2015-02-11 07:25:59 +01:00
Christophe Labouisse a07bd28077 Add missing options to the events command
- Add since, until and filters parameters to `Client.events`
- Add missing `events`command in the documentation

Signed-off-by: Christophe Labouisse <christophe@labouisse.org>
2015-02-11 07:25:59 +01:00
Joffrey F e379e8ae24 read_only parameter 2015-02-10 16:13:09 -08:00
Joffrey F d0512028be Merge pull request #482 from docker/rename_container
New Client.rename() method
2015-02-10 13:56:29 -08:00
Joffrey F a7f7fbb0fd rename() tests and docs 2015-02-10 12:55:44 -08:00
Vincent Giersch f3717f5815 Fix crash when building from remote sources
Avoid crashing when the Docker python client is able to load
registry credentials when building using a remote source

Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
2015-02-04 16:26:55 +00:00
Joffrey F 40770878ad Additional tests and small improvement to auth.resolve_authconfig 2015-02-01 15:36:56 -08:00
James Harris 301515ed56 Add Support for Mac Address
The new docker api allows specifing mac address for containers. This change is to allow docker py the same functionality.

Signed-off-by: James Harris <james@rancher.com>
2015-01-21 16:08:16 -07:00
Joffrey F aa19d7b660 Fixed TestRestartingContainer 2015-01-13 10:32:28 -08:00
Joffrey F 1f8cde8560 Integration tests fixes 2015-01-09 14:22:55 -08:00
Joffrey F 43c334656b Added RO volumes tests 2015-01-08 18:02:03 -08:00
Joffrey F 4d3e7eb1cb Merge branch 'master' of https://github.com/rmohr/docker-py into rmohr-master 2015-01-08 16:23:21 -08:00
Joffrey F 09ea71971c Fix for issue #443 2015-01-08 15:57:44 -08:00
Sam Thursfield b1d4a5d8d1 Add integration tests for Client.import_image() function
Currently TestImportFromStream fails, because something is going wrong
with the HTTP chunked transfer-encoding. This didn't work before,
either (for a different reason).
2015-01-05 12:33:36 +00:00
Sam Thursfield 2f3b87a470 Rewrite Client.import_image() and add less-magical versions
Rather than have one function that can do 5 things and attempts to guess
what the user wanted, it's good to have a function for each possible
method of importing an image. Error cases are handled a lot better this
way.

The unit test test_import_image_from_file() was changed to be
test_import_image_from_bytes(), because if we try to import a temporary
file in the test, the 'data' parameter of the 'fake_request' object is
an instance of a funny internal type like <_io.BufferedReader
name='/tmp/tmpc9chux'> and it's very hard to match such a thing with
`mock.assert_called_with()`.
2015-01-05 12:32:56 +00:00
Sam Thursfield 42b91885a2 Rework Unix connection code so that 'chunked' transfers work
This allows streaming a system to the 'import' command, rather than
having to read the whole thing into memory before sending it.

Previously both the UnixAdapter and the docker.Client objects would
track the 'base URL' of the Docker daemon (socket path in the case of
local Unix-domain socket connections). The Client object would construct
URLs which contained the path to the socket with the path of the Docker
API call appended. The UnixHTTPConnection instance would then remove the
known socket path from the URL.

This relied on all calls going through the HTTPConnection.request()
function, where the URL could be rewritten. In the case of 'chunked'
HTTP POST requests this doesn't happen, so such calls would request
a path still including the socket path and would receive a 404 error.

The client now constructs URLs containing just the path of the desired API
endpoint, and expects the Unix socket transport to know the path to the
Docker daemon's socket.
2015-01-05 12:05:39 +00:00
Roman Mohr 2d34c38c4d Keep unix socket alive with python3 2014-12-21 11:42:41 +01:00
Joffrey F 2218dbaa67 Use create_host_config in start (unifying parameter processing) 2014-12-18 18:03:27 -08:00
Joffrey F 53d61a77b6 Improved integration tests to run on python3 and close sessions after in tearDown phase 2014-12-18 17:46:41 -08:00
Joffrey F 53beba75f4 Merge pull request #427 from abanna/adding_multiple_dockercfg_support
adding the ability to login with different dockercfg files.
2014-12-18 10:39:59 -08:00
Joffrey F 96f66f7558 Merge pull request #435 from dims/fix-flake8-issues
flake8 fails with F821 for unicode under python 3.4.2
2014-12-18 10:33:40 -08:00
abanna d3cf874938 missed a lint error 2014-12-18 10:21:02 -08:00
Alex Banna 4cbf4e312c adding the ability to login with different dockercfg files. 2014-12-18 10:19:40 -08:00
Davanum Srinivas d9fa43a9b7 flake8 fails with F821 for unicode under python 3.4.2 2014-12-18 11:08:37 -05:00