python: Fix teardown of ephemeral contexts.
authorJustus Winter <justus@g10code.com>
Fri, 17 Feb 2017 11:18:56 +0000 (12:18 +0100)
committerJustus Winter <justus@g10code.com>
Fri, 17 Feb 2017 11:18:56 +0000 (12:18 +0100)
commitde8494b16bc50c60a8438f2cae1f8c88e8949f7a
tree3fae3b3fd43eb9e860fc446415dccd0d6358044c
parent9350168a1eed3f055040d7cc8a9bf4cdf745b23a
python: Fix teardown of ephemeral contexts.

* lang/python/tests/support.py (EphemeralContext): New function.
* lang/python/tests/t-quick-key-creation.py: Use the new function to
manage ephemeral contexts.
* lang/python/tests/t-quick-key-manipulation.py: Likewise.
* lang/python/tests/t-quick-subkey-creation.py: Likewise.
--

Previously, there was a problem with cleaning up ephemeral home
directories.  shutil.rmtree deleted the agents main socket, gpg-agent
detected that, and deleted the other sockets as well, racing
shutil.rmtree which did not cope will with that.

Fix this by asking the agent nicely to shut down.

Signed-off-by: Justus Winter <justus@g10code.com>
lang/python/tests/support.py
lang/python/tests/t-quick-key-creation.py
lang/python/tests/t-quick-key-manipulation.py
lang/python/tests/t-quick-subkey-creation.py