summaryrefslogtreecommitdiff
path: root/hack/make/test-docker-py
Commit message (Collapse)AuthorAgeFilesLines
* Volume prune: only prune anonymous volumes by defaultBrian Goff2022-10-041-1/+2
| | | | | | | | | | | | | | | This adds a new filter argument to the volume prune endpoint "all". When this is not set, or it is a false-y value, then only anonymous volumes are considered for pruning. When `all` is set to a truth-y value, you get the old behavior. This is an API change, but I think one that is what most people would want. Signed-off-by: Brian Goff <cpuguy83@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* docker-py: skip CreateContainerTest::test_create_with_device_cgroup_rulesSebastiaan van Stijn2022-01-201-2/+3
| | | | | | | | | | | | | | | | | | | | | This test is verifying that the container has the right options set (through `docker inspect`), but also checks if the cgroup-rules are set within the container by reading `/sys/fs/cgroup/devices/devices` Unlike cgroups v1, on cgroups v2, there is no file interface, and rules are handled through ebpf, which means that the test will fail because this file is not present. From the Linux documentation for cgroups v2: https://github.com/torvalds/linux/blob/v5.16/Documentation/admin-guide/cgroup-v2.rst#device-controller > (...) > Device controller manages access to device files. It includes both creation of > new device files (using mknod), and access to the existing device files. > > Cgroup v2 device controller has no interface files and is implemented on top of > cgroup BPF. To control access to device files, a user may create bpf programs > of type BPF_PROG_TYPE_CGROUP_DEVICE and att> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* CI: update docker-py to 5.0.3Sebastiaan van Stijn2021-10-201-1/+1
| | | | | | full diff: https://github.com/docker/docker-py/compare/5.0.0...5.0.3 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* testing: update docker-py 5.0.0Sebastiaan van Stijn2021-04-061-1/+1
| | | | | | | | drops support for python 2. full diff: https://github.com/docker/docker-py/compare/4.4.1...5.0.0 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* testing: update docker-py 4.4.1Sebastiaan van Stijn2021-01-261-1/+1
| | | | | | | | run docker-py integration tests of the latest release; full diff: https://github.com/docker/docker-py/compare/4.3.0...4.4.1 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Update docker-py to 4.3.0Sebastiaan van Stijn2020-08-131-8/+3
| | | | | | full diff: https://github.com/docker/docker-py/compare/4.2.2...4.3.0 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* testing: bump docker-py 4.2.2Sebastiaan van Stijn2020-07-171-2/+2
| | | | | | full diff: https://github.com/docker/docker-py/compare/4.2.1...4.2.2 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Merge pull request #40499 from thaJeztah/docker_py_api_versionTibor Vass2020-07-161-1/+5
|\ | | | | docker-py: override default API version to run all tests
| * docker-py: override default API version to run all testsSebastiaan van Stijn2020-02-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise some tests are skipped with the default API version used: SKIPPED [1] tests/integration/api_service_test.py:882: API version is too low (< 1.38) SKIPPED [1] tests/integration/api_swarm_test.py:59: API version is too low (< 1.39) SKIPPED [1] tests/integration/api_swarm_test.py:38: API version is too low (< 1.39) SKIPPED [1] tests/integration/api_swarm_test.py:45: API version is too low (< 1.39) SKIPPED [1] tests/integration/api_swarm_test.py:52: API version is too low (< 1.39) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | Merge pull request #40807 from wpjunior/plugin-feedbackSebastiaan van Stijn2020-07-161-1/+2
|\ \ | | | | | | Improve error feedback when plugin does not implement desired interface
| * | Improve error feedback when plugin does not implement desired interfaceWilson Júnior2020-04-211-1/+2
| | | | | | | | | | | | Signed-off-by: Wilson Júnior <wilsonpjunior@gmail.com>
* | | testing: bump docker-py 4.2.1Sebastiaan van Stijn2020-06-031-1/+1
|/ / | | | | | | | | | | full diff: https://github.com/docker/docker-py/compare/4.2.0...4.2.1 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* | run shfmtAkihiro Suda2020-03-031-0/+1
| | | | | | | | | | | | git grep --name-only '^#!' | egrep -v '(vendor|\.go|Jenkinsfile)' | xargs shfmt -w -bn -ci -sr Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
* | docker-py: skip flaky AttachContainerTest::test_attach_no_stream (again)Sebastiaan van Stijn2020-02-121-1/+2
|/ | | | | | | | | | | | | | | | | | | | This test was disabled in the past, but re-enabled when we upgraded docker-py to 4.2.0. The test looks to be still flaky though, so skipping it again: ``` [2020-02-10T23:40:44.429Z] =================================== FAILURES =================================== [2020-02-10T23:40:44.429Z] __________________ AttachContainerTest.test_attach_no_stream ___________________ [2020-02-10T23:40:44.429Z] tests/integration/api_container_test.py:1250: in test_attach_no_stream [2020-02-10T23:40:44.429Z] assert output == 'hello\n'.encode(encoding='ascii') [2020-02-10T23:40:44.429Z] E AssertionError: assert b'' == b'hello\n' [2020-02-10T23:40:44.429Z] E Right contains more items, first extra item: 104 [2020-02-10T23:40:44.429Z] E Use -v to get the full diff [2020-02-10T23:40:44.429Z] ------- generated xml file: /src/bundles/test-docker-py/junit-report.xml ------- ```` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* testing: bump docker-py to 4.2.0Sebastiaan van Stijn2020-02-061-8/+6
| | | | | | full diff: https://github.com/docker/docker-py/compare/4.1.0...4.2.0 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* docker-py: skip broken ImageCollectionTest::test_pull_multipleSebastiaan van Stijn2020-01-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The ImageCollectionTest.test_pull_multiple test performs a `docker pull` without a `:tag` specified) to pull all tags of the given repository (image). After pulling the image, the image(s) pulled are checked to verify if the list of images contains the `:latest` tag. However, the test assumes that all tags of the image are tags for the same version of the image (same digest), and thus a *single* image is returned, which is not always the case. Currently, the `hello-world:latest` and `hello-world:linux` tags point to a different digest, therefore the `client.images.pull()` returns multiple images: one image for digest, making the test fail: =================================== FAILURES =================================== ____________________ ImageCollectionTest.test_pull_multiple ____________________ tests/integration/models_images_test.py:90: in test_pull_multiple assert len(images) == 1 E AssertionError: assert 2 == 1 E + where 2 = len([<Image: 'hello-world:linux'>, <Image: 'hello-world:latest'>]) This patch temporarily skips the broken test until it is fixed upstream. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* docker-py: re-enable tests that were fixed in v4.1.0Sebastiaan van Stijn2020-01-031-5/+0
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* bump docker-py to 4.1.0Sebastiaan van Stijn2019-10-031-1/+1
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Temporarily switch docker-py to "master"Sebastiaan van Stijn2019-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The docker-py tests were broken, because the version of py-test that was used, used a dependency that had a new major release with a breaking change. Unfortunately, it was not pinned to a specific version, so when the dependency did the release, py-test broke; ``` 22:16:47 Traceback (most recent call last): 22:16:47 File "/usr/local/bin/pytest", line 10, in <module> 22:16:47 sys.exit(main()) 22:16:47 File "/usr/local/lib/python3.6/site-packages/_pytest/config/__init__.py", line 61, in main 22:16:47 config = _prepareconfig(args, plugins) 22:16:47 File "/usr/local/lib/python3.6/site-packages/_pytest/config/__init__.py", line 182, in _prepareconfig 22:16:47 config = get_config() 22:16:47 File "/usr/local/lib/python3.6/site-packages/_pytest/config/__init__.py", line 156, in get_config 22:16:47 pluginmanager.import_plugin(spec) 22:16:47 File "/usr/local/lib/python3.6/site-packages/_pytest/config/__init__.py", line 530, in import_plugin 22:16:47 __import__(importspec) 22:16:47 File "/usr/local/lib/python3.6/site-packages/_pytest/tmpdir.py", line 25, in <module> 22:16:47 class TempPathFactory(object): 22:16:47 File "/usr/local/lib/python3.6/site-packages/_pytest/tmpdir.py", line 35, in TempPathFactory 22:16:47 lambda p: Path(os.path.abspath(six.text_type(p))) 22:16:47 TypeError: attrib() got an unexpected keyword argument 'convert' ``` docker-py master has a fix for this (bumping the version of `py-test`), but it's not in a release yet, and the docker cli that's used in our CI is pinned to 17.06, which doesn't support building from a remote git repository from a specific git commit. To fix the immediate situation, this patch switches the docker-py tests to run from the master branch. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* docker-py: skip flaky AttachContainerTest::test_attach_no_streamSebastiaan van Stijn2019-09-021-0/+1
| | | | | | | | | | | | | | | | Seen failing a couple of times: ``` [2019-09-02T08:40:15.796Z] =================================== FAILURES =================================== [2019-09-02T08:40:15.796Z] __________________ AttachContainerTest.test_attach_no_stream ___________________ [2019-09-02T08:40:15.796Z] tests/integration/api_container_test.py:1250: in test_attach_no_stream [2019-09-02T08:40:15.796Z] assert output == 'hello\n'.encode(encoding='ascii') [2019-09-02T08:40:15.796Z] E AssertionError: assert b'' == b'hello\n' [2019-09-02T08:40:15.796Z] E Right contains more items, first extra item: 104 [2019-09-02T08:40:15.796Z] E Use -v to get the full diff ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* docker-py: output junit.xml for test-resultsSebastiaan van Stijn2019-08-151-2/+3
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* docker-py: use --mount for bind-mounting docker.sockSebastiaan van Stijn2019-08-151-1/+1
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* docker-py: run without tty to disable color outputSebastiaan van Stijn2019-08-151-1/+1
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* docker-py: fix linting issues reported by shellcheckSebastiaan van Stijn2019-08-151-6/+8
| | | | | | | - SC2006: use $(...) notation instead of legacy backticked `...` - SC2086: double quote to prevent globbing and word splitting Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* docker-py: skip PullImageTest::test_pull_invalid_platformSebastiaan van Stijn2019-08-101-1/+1
| | | | | | | and remove `PullImageTest::test_build_invalid_platform` from the list, which was a copy/paste error in f8cde0b32d86fa2df71ec65adc3d45f862b3ea33 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* docker-py: deselect broken experimental testsSebastiaan van Stijn2019-08-091-2/+8
| | | | | | | These tests are fixed upstream, but those fixes are not yet in a released version. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* docker-py: skip flaky testsSebastiaan van Stijn2019-07-161-1/+5
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* docker-py: use host-network for nested build of docker-pySebastiaan van Stijn2019-07-161-0/+1
| | | | | | | | | | | | | | | When building this image docker-in-docker, the DNS in the environment may not be usable for the build-container, causing resolution to fail: ``` 02:35:31 W: Failed to fetch http://deb.debian.org/debian/dists/jessie/Release.gpg Temporary failure resolving 'deb.debian.org' ``` This patch detects if we're building from within a container, and if so, skips creating a networking namespace for the build by using `--network=host`. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* docker-py: don't build --quiet is TESTDEBUG is setSebastiaan van Stijn2019-07-161-1/+2
| | | | Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Bump docker-py to 4.0.2, and run tests from upstream repositorySebastiaan van Stijn2019-07-161-8/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes all the installation steps for docker-py from the Dockerfile, and instead builds the upstream Dockerfile, and runs docker-py tests in a container. To test; ``` make test-docker-py ... Removing bundles/ ---> Making bundle: dynbinary (in bundles/dynbinary) Building: bundles/dynbinary-daemon/dockerd-dev Created binary: bundles/dynbinary-daemon/dockerd-dev ---> Making bundle: test-docker-py (in bundles/test-docker-py) ---> Making bundle: .integration-daemon-start (in bundles/test-docker-py) Using test binary docker Starting dockerd INFO: Waiting for daemon to start... . INFO: Building docker-sdk-python3:3.7.0... sha256:686428ae28479e9b5c8fdad1cadc9b7a39b462e66bd13a7e35bd79c6a152a402 INFO: Starting docker-py tests... ============================= test session starts ============================== platform linux -- Python 3.6.8, pytest-4.1.0, py-1.8.0, pluggy-0.9.0 rootdir: /src, inifile: pytest.ini plugins: timeout-1.3.3, cov-2.6.1 collected 359 items tests/integration/api_build_test.py .......s.... .... ``` Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Revert "Bash scripts; use double brackets, fix bare variables, add quotes"Sebastiaan van Stijn2019-01-101-1/+1
| | | | | | This reverts commit 297b30df5ff4deaaedb6ceb17d7bd2e306a580ab. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Bash scripts; use double brackets, fix bare variables, add quotesSebastiaan van Stijn2018-12-241-1/+1
| | | | | | | | | | | These scripts explicitly use Bash, so we should be able to use `[[` instead of `[` (which seems to be recommended). Also added curly brackets to some bare variables, and quoted some paths. This makes my IDE a bit more silent :-) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* Convert script shebangs from "#!/bin/bash" to "#!/usr/bin/env bash"Tianon Gravi2017-02-131-1/+1
| | | | | | This is especially important for distributions like NixOS where `/bin/bash` doesn't exist, or for MacOS users who've installed a newer version of Bash than the one that comes with their OS. Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
* Output docker-py test results in xunit formatMichael Crosby2016-08-311-1/+1
| | | | | | This adds a `results.xml` to the test-docker-py output folder. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
* Support interactive integration testing.Daniel Nephin2016-08-051-0/+2
| | | | | | | Interactive integration testing is useful when you're developing new tests, or making changes to cli code. Signed-off-by: Daniel Nephin <dnephin@docker.com>
* docker-py: upgrade and fix test scriptTibor Vass2015-10-281-1/+1
| | | | Signed-off-by: Tibor Vass <tibor@docker.com>
* Update docker-py to current master (~docker-py 1.3.1)Phil Estes2015-07-221-1/+1
| | | | | | | | | | | | | The docker-py commit used in the standard `Dockerfile` is from Feb. 2015 and is out of date with the current API level and has fixes for things like the new docker cli config location and registry v2 changes/API responses as well. Also pass "NOT_ON_HOST=true" to docker-py test suite so that tests relying on direct HOST interaction (versus running in a container) are skipped. Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
* hack: explicit bundles for integration-cli prequisitesJörg Thalheim2015-06-091-2/+2
| | | | | | | | | | | | | | | | | | | no longer load hide critical code such as in .integration-daemon-{start,stop}, if this step failed, it will had logged the corresponding module before: ---> Making bundle: .integration-daemon-start (in bundles/1.7.0-dev/daemon-start) which is nicer to debug. This will make it also easier to execute a single tests in an interactive shell. $ make shell docker> . hack/make.sh binary .integration-daemon-start .integration-daemon-setup docker> docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES docker> go test github.com/docker/docker/integration-cli Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
* Make "DEST" a make.sh construct instead of ad-hocTianon Gravi2015-05-301-2/+0
| | | | | | Using "DEST" for our build artifacts inside individual bundlescripts was already well-established convention, but this officializes it by having `make.sh` itself set the variable and create the directory, also handling CYGWIN oddities in a single central place (instead of letting them spread outward from `hack/make/binary` like was definitely on their roadmap, whether they knew it or not; sneaky oddities). Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
* Fix daemon start/stop logic in hack/make/* scriptsTianon Gravi2015-04-231-18/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the Bash manual's `set -e` description: (https://www.gnu.org/software/bash/manual/bashref.html#index-set) > Exit immediately if a pipeline (see Pipelines), which may consist of a > single simple command (see Simple Commands), a list (see Lists), or a > compound command (see Compound Commands) returns a non-zero status. > The shell does not exit if the command that fails is part of the > command list immediately following a while or until keyword, part of > the test in an if statement, part of any command executed in a && or > || list except the command following the final && or ||, any command > in a pipeline but the last, or if the command’s return status is being > inverted with !. If a compound command other than a subshell returns a > non-zero status because a command failed while -e was being ignored, > the shell does not exit. Additionally, further down: > If a compound command or shell function executes in a context where -e > is being ignored, none of the commands executed within the compound > command or function body will be affected by the -e setting, even if > -e is set and a command returns a failure status. If a compound > command or shell function sets -e while executing in a context where > -e is ignored, that setting will not have any effect until the > compound command or the command containing the function call > completes. Thus, the only way to have our `.integration-daemon-stop` script actually run appropriately to clean up our daemon on test/script failure is to use `trap ... EXIT`, which we traditionally avoid because it does not have any stacking capabilities, but in this case is a reasonable compromise because it's going to be the only script using it (for now, at least; we can evaluate more complex solutions in the future if they actually become necessary). The alternatives were much less reasonable. One is to have the entire complex chains in any script wanting to use `.integration-daemon-start` / `.integration-daemon-stop` be chained together with `&&` in an `if` block, which is untenable. The other I could think of was taking the body of these scripts out into separate scripts, essentially meaning we'd need two files for each of these, which further complicates the maintenance. Add to that the fact that our `trap ... EXIT` is scoped to the enclosing subshell (`( ... )`) and we're in even more reasonable territory with this pattern. Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
* hack/make/test-integration-cli: introduce MAKEDIR variableJörg Thalheim2015-04-151-2/+2
| | | | | | | - every execution of dirname costs time - less repeating Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
* Move scripts back to hack/, leave docs in project/Tianon Gravi2015-03-131-0/+30
This also removes the now-defunct `*maintainer*.sh` scripts that don't work with the new TOML format, and moves a couple not-build-or-release-related scripts to `contrib/` instead. Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>