Skip to content

Commit aa99999

Browse files
committed
integration/swarm: Preserve rotated unlock key
Fixes flaky SwarmTest.test_update_node erroring out with "Swarm is encrypted and needs to be unlocked before it can be used. Please use "docker swarm unlock" to unlock it." `test_rotate_manager_unlock_key` enables autolock and then rotates the manager unlock key, but teardown still holds the original key. If the swarm needs to be unlocked during cleanup, the stale key cannot unlock it and the daemon can remain in locked swarm state for the next test. Store the rotated unlock key so teardown can unlock and leave the swarm cleanly. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
1 parent 059d371 commit aa99999

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

tests/integration/api_swarm_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ def test_rotate_manager_unlock_key(self):
249249
rotate_manager_unlock_key=True
250250
)
251251
key_2 = self.client.get_unlock_key()
252+
self._unlock_key = key_2
252253
assert key_1['UnlockKey'] != key_2['UnlockKey']
253254

254255
@requires_api_version('1.30')

0 commit comments

Comments
 (0)