`docker port` and inspect do not return ports for containers which are
not running. Because the container command is `true`, sometimes that
exits before the inspect is called.
Signed-off-by: Paul Bellamy <paul.a.bellamy@gmail.com>
User can now specify a protocol in Client.port using the port/proto
syntax. Default port is now TCP instead of UDP (to match the
behavior of `docker port`) when no proto is specified.
Regression test
Signed-off-by: Joffrey F <joffrey@docker.com>
Instead of creating the test directory directly on the host, create it
by starting a container with the directory bind-mounted, so that it
doesn't matter whether the daemon is local, in a VM or remote.
This removes the need to make /tmp a volume in the test container, and
to share it with the dind container.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
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>
- Fix the setup step (the process has changed now that we're using
pytest)
- Skip tests that are unstable
- Make better use of build caching
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
- There was a typo (".dockerginore"), which meant that the exclusion of
the .dockerignore file itself wasn't being tested.
- Some of the file names were non-descriptive.
- The test was inspecting the output of the build process, rather than
running 'ls' in a new container, which meant it was full of extra
output, and would fail when there was a cache hit.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
By having this hardcoded list of log drivers, it is a bottleneck
to us supporting more log drivers.
The daemon already validates if a log driver is valid or not, so rather
than duplicating that validation, let's pass the log_driver along.
This allows support for new/more log drivers as they become supported
in docker without having to wait for both docker-py and docker-compose
to support them.
Keeping the current list of log driver types for backwards compatibility.
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
By using `json-file` as the use case we can run this without needing
to be on a machine with syslog installed.
Even if syslog was installed, this test was still failing as the
`log_opt` of 'key1' is an invalid option.
This test is slightly different style to the others, it hopefully
includes an example of how to space out tests for increased readability,
we construct our tests in 3 phases(generally) and include a space imbetween
them:
- setup
- perform action
- assertions
Expanded variable names is important for readability/clarity. Also
reduced the number of assertions to focus on the logic we're testing.
Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
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)