Commit Graph

55 Commits

Author SHA1 Message Date
Sebastiaan van Stijn 7168e09b16
test: fix for cgroupv2 (#2940)
This test was 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.list`

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 attach them to cgroups with
> BPF_CGROUP_DEVICE flag. (...)

Given that setting the right cgroups is not really a responsibility of this SDK,
it should be sufficient to verify that the right options were set in the container
configuration, so this patch is removing the part that checks the cgroup, to
allow this test to be run on a host with cgroups v2 enabled.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-07-26 12:06:51 -04:00
Anthony Sottile 5fcc293ba2 use python3.6+ constructs
Signed-off-by: Anthony Sottile <asottile@umich.edu>
2021-07-05 18:30:07 -04:00
Ulysses Souza c8fba210a2 Remove support to pre python 3.6
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2021-03-22 10:18:23 -03:00
Sebastiaan van Stijn 26d8045ffa Fix CreateContainerTest.test_invalid_log_driver_raises_exception
This test was updated in 7d92fbdee1, but
omitted the "error" prefix in the message, causing the test to fail;

    _________ CreateContainerTest.test_invalid_log_driver_raises_exception _________
    tests/integration/api_container_test.py:293: in test_invalid_log_driver_raises_exception
        assert excinfo.value.explanation in expected_msgs
    E   AssertionError: assert 'error looking up logging plugin asdf: plugin "asdf" not found' in ["logger: no log driver named 'asdf' is registered", 'looking up logging plugin asdf: plugin "asdf" not found']
    E    +  where 'error looking up logging plugin asdf: plugin "asdf" not found' = APIError(HTTPError('400 Client Error: Bad Request for url: http+docker://localhost/v1.39/containers/create')).explanation
    E    +    where APIError(HTTPError('400 Client Error: Bad Request for url: http+docker://localhost/v1.39/containers/create')) = <ExceptionInfo APIError tblen=6>.value

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-17 15:59:12 +02:00
Wilson Júnior 7d92fbdee1
Fix tests to support both log plugin feedbacks
Signed-off-by: Wilson Júnior <wilsonpjunior@gmail.com>
Docker-DCO-1.1-Signed-off-by: Wilson Júnior <wilsonpjunior@gmail.com> (github: wpjunior)
2020-04-21 17:00:48 -03:00
Sebastiaan van Stijn da90bb3259
xfail "docker top" tests, and adjust for alpine image
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-02-17 10:25:53 +01:00
Sebastiaan van Stijn 54b48a9b7a
Update alpine version to 3.10, and rename BUSYBOX variable
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-10 19:11:58 +02:00
Ulysses Souza ccd9ca4947 Xfail test_attach_stream_and_cancel on TLS
This test is quite flaky on ssl integration test

Signed-off-by: Ulysses Souza <ulysses.souza@docker.com>
2019-05-18 19:33:48 -07:00
Joffrey F eba8345c37 Update some test dependencies / default values with newer versions
Signed-off-by: Joffrey F <joffrey@docker.com>
2019-05-01 02:36:19 -07:00
Joffrey F 1a4881acd9 Improve low_timeout test resilience
Signed-off-by: Joffrey F <joffrey@docker.com>
2019-05-01 01:15:41 -07:00
Joffrey F 62c8bcbbb6 Increase timeout on test with long sleeps
Signed-off-by: Joffrey F <joffrey@docker.com>
2019-05-01 00:47:16 -07:00
Sebastiaan van Stijn 50d475797a
Remove init_path from create
This option was never functional, and was not intended
to be added to the "container create" API, so let's
remove it, because it has been removed in Docker 17.05,
and was broken in versions before that; see

- https://github.com/moby/moby/issues/32355 --init-path does not seem to work
- https://github.com/moby/moby/pull/32470 remove --init-path from client

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-04-10 02:42:23 +02:00
Ulysses Souza ef043559c4 Add 'sleep 2' to avoid race condition on attach
Signed-off-by: Ulysses Souza <ulysses.souza@docker.com>
2019-04-04 14:09:18 +02:00
Ulysses Souza 15862eacbf Xfail test_attach_stream_and_cancel on TLS
This test is quite flaky on ssl integration test

Signed-off-by: Ulysses Souza <ulysses.souza@docker.com>
2019-03-26 16:04:06 +01:00
Hannes Ljungberg 7143cf02ab Test port lookup with protocols
Signed-off-by: Hannes Ljungberg <hannes@5monkeys.se>
2019-03-18 22:15:49 +01:00
Corentin Henry 5f157bbaca implement stream demultiplexing for exec commands
fixes https://github.com/docker/docker-py/issues/1952

Signed-off-by: Corentin Henry <corentinhenry@gmail.com>
2018-11-27 17:01:48 -08:00
Joffrey F 6bfe2005e0 Clear error for cancellable streams over SSH
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-01 15:24:22 -07:00
Joffrey F 1df021ee24 Update tests for ssh protocol compatibility
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-11-01 15:24:22 -07:00
Marco Trillo 098318ad95 Add support for `uts_mode` parameter in `Client.create_host_config`.
This parameter allows to set the UTS namespace of the container, as in
the `--uts=X` Docker CLI parameter:
<https://docs.docker.com/engine/reference/run/#uts-settings---uts>
The only allowed value, if set, is "host".

Signed-off-by: Marco Trillo <martri@arantia.com>
Signed-off-by: Diego Alvarez <dyako.developer@gmail.com>
2018-06-29 14:54:49 +02:00
Joffrey F b4efdc1b28 Fix several integration tests on Windows
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-05-25 10:11:02 -07:00
Joffrey F ae8f77737c Fix session timeout = None case
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-04-25 15:31:26 -07:00
Joffrey F da028d88a2 Total timeout should be HTTP timeout + operation timeout
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-04-25 15:31:26 -07:00
Matthieu Nottale cef9940ed3 stop(), restart(): Adjust request timeout.
Signed-off-by: Matthieu Nottale <matthieu.nottale@docker.com>
2018-04-25 15:31:26 -07:00
Joffrey F 284c3d90d6 Remove redundant single-socket select call
Clean up + use pytest-timeout

Signed-off-by: Joffrey F <joffrey@docker.com>
2018-03-20 09:25:29 +01:00
Viktor Adam 719d4e9e20 Allow cancelling the streams from other threads
Signed-off-by: Viktor Adam <rycus86@gmail.com>
2018-03-20 09:25:29 +01:00
Joffrey F 48e45afe88 Add support for device_cgroup_rules parameter in host config
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-02-13 17:05:16 -08:00
Joffrey F 7fabcdaa4c Update wait to always return a dict
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-01-31 16:52:26 -08:00
Joffrey F df8422d079 Refuse API version < 1.21 ; Remove associated code paths
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-01-31 14:42:01 -08:00
Joffrey F ccbde11c8d Improve separation between auth_configs and general_configs
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-01-30 18:42:38 -08:00
Joffrey F e304f91b46 Update detach tests to work with AF_INET as well
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-01-30 17:16:23 -08:00
Fumiaki MATSUSHIMA dd858648a0 Use config.json for detachKeys
Signed-off-by: Fumiaki Matsushima <mtsmfm@gmail.com>
2018-01-30 17:16:23 -08:00
Joffrey F 3422211309 Use pytest asserts
Signed-off-by: Joffrey F <joffrey@docker.com>
2018-01-30 14:26:24 -08:00
Joffrey F abd60aedc7 Bump default API version to 1.35
Add ContainerSpec.isolation support
Add until support in logs
Add condition support in wait
Add workdir support in exec_create

Signed-off-by: Joffrey F <joffrey@docker.com>
2018-01-26 13:56:01 -08:00
Joffrey F 445cb18723 Add integration test for CPU realtime options
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-12-13 19:06:29 -08:00
Joffrey F 5d1b652246 Add support for mounts in HostConfig
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-11-07 15:18:26 -08:00
Joffrey F 0c2b4e4d3a Always send attach request as streaming
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-08-22 17:00:11 -07:00
Joffrey F 9b9fb0aa01 Make sure data is written in prune test so space can be reclaimed
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-06-20 16:07:15 -07:00
Madhuri Kumari 612c0f3d0d Fix test cases for ``runtime`` config
Signed-off-by: Madhuri Kumari <madhuri.kumari@intel.com>
2017-06-07 10:47:27 +05:30
Madhuri Kumari 6ae24b9e60 Add support for ``runtime`` in container create and run API 2017-06-01 15:09:46 +00:00
Joffrey F bf60e2a330 init_path removed in Engine 17.05
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-05-09 16:16:10 -07:00
Joffrey F c2d114c067 Move LinksTest to appropriate file
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-03-09 16:12:22 -08:00
Tomasz Madycki 8c6534d7be Add init_path parameter to container HostConfig
Signed-off-by: Tomasz Madycki <tomasz.madycki@gmail.com>
2017-03-01 14:02:35 -08:00
Tomasz Madycki 13b5f785a7 Add init parameter to container HostConfig
Signed-off-by: Tomasz Madycki <tomasz.madycki@gmail.com>
2017-03-01 14:02:35 -08:00
Boaz Shuster 5dced6579a Update assert in test_create_with_restart_policy
In https://github.com/docker/docker/pull/30870 a new
error message is displayed if the container is restarting.

To make "test_create_with_restart_policy" pass against the
above change, the test checks that the error message contains
"You cannot remove " instead of
"You cannot remove a running container"

Signed-off-by: Boaz Shuster <ripcurld.github@gmail.com>
2017-03-01 15:36:32 +02:00
Joffrey F 3a9c83509c Add xfail mark to storageopt test
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-02-15 19:02:31 -08:00
Joffrey F 4a50784ad4 Merge pull request #1459 from shin-/1300-storageopts
Add support for storage_opt in host_config
2017-02-15 18:12:31 -08:00
Joffrey F ece3b19782 Add support for storage_opt in host_config
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-02-15 17:43:24 -08:00
Joffrey F f2a867f04b Add prune_containers method
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-01-30 18:53:46 -08:00
Joffrey F 847f209865 Add stop_timeout to create_container
Fix requires_api_version test decorator

Signed-off-by: Joffrey F <joffrey@docker.com>
2017-01-27 16:00:18 -08:00
Joffrey F 848b7aa6a4 Add support for auto_remove in HostConfig
Signed-off-by: Joffrey F <joffrey@docker.com>
2017-01-25 16:45:59 -08:00