test/docker-py: Skip tests that enable autolock

Enabling autolock makes the swarm node renew its TLS certificate.
When the test's teardown force-leaves the swarm while that renewal is
still writing to /var/lib/docker/swarm/certificates, removing the
swarm state fails with "unlinkat /var/lib/docker/swarm/certificates:
directory not empty".
The encrypted state stays on disk, so the next test's swarm init fails
with "Swarm is encrypted and needs to be unlocked", and docker-py's
force_leave_swarm helper hides the failed leave.
On this branch the victim is test_init_swarm_with_ca_config, which
runs right after test_init_swarm_with_autolock_managers.

Skip the two tests that enable autolock until the race is fixed.

Signed-off-by: Cory Snider <csnider@mirantis.com> (cherry picked from
commit 01958e5137)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Cory Snider authored and Paweł Gronowski committed 2026-10-30 17:50:49 +01:00
1 parent fceb7c142b
commit fc04cade92
1 file changed
+7
+7
View File
@@ -33,6 +33,13 @@ PY_TEST_OPTIONS="${PY_TEST_OPTIONS} --deselect=tests/integration/api_container_t
# See https://github.com/moby/moby/pull/50846 and https://github.com/moby/moby/pull/50957
PY_TEST_OPTIONS="${PY_TEST_OPTIONS} --deselect=tests/integration/api_container_test.py::CreateContainerTest::test_create_with_mac_address"
# TODO re-enable once leaving a swarm no longer races the certificate renewal
# that follows enabling autolock. When the leave loses, it fails with
# "unlinkat /var/lib/docker/swarm/certificates: directory not empty", the
# encrypted swarm state is left behind, and the next test's swarm init fails
# with "Swarm is encrypted and needs to be unlocked".
PY_TEST_OPTIONS="$PY_TEST_OPTIONS --deselect=tests/integration/api_swarm_test.py::SwarmTest::test_init_swarm_with_autolock_managers"
PY_TEST_OPTIONS="$PY_TEST_OPTIONS --deselect=tests/integration/api_swarm_test.py::SwarmTest::test_rotate_manager_unlock_key"
(
bundle .integration-daemon-start