Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport][ipa-4-8] ipatests: fix race condition in finalizer of encrypted backup test #5384

Closed
wants to merge 2 commits into from

Conversation

abbra
Copy link
Contributor

@abbra abbra commented Dec 23, 2020

This PR was opened automatically because PR #5373 was pushed to master and backport to ipa-4-8 is required.

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
When using a fixture, we get a temporary directory created and then
removed by pytest. Pytest uses `shutil.rmtree` call which collects all
files in the directory being removed and then removes them one by one.
At the point of removal of our GNUPGHOME directory, gpg daemon is being
shut down and there might still be an agent UNIX domain socket. The
removal actually overlaps in time with shut down of the gpg daemon, thus
causing `shutil.rmtree()` to fail when an agent UNIX domain socket is
removed by the daemon.

Change the way how we run the gpg agent to use a temporary systemd
service. Stop the service in the finalizer method so that systemd would
send SIGTERM signal and the gpg agent would clean itself up.

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
@abbra abbra added the ack Pull Request approved, can be merged label Dec 23, 2020
@abbra
Copy link
Contributor Author

abbra commented Dec 23, 2020

PR was ACKed automatically because this is backport of PR #5373. Wait for CI to finish before pushing. In case of questions or problems contact @abbra who is author of the original PR.

@flo-renaud flo-renaud added the pushed Pull Request has already been pushed label Dec 23, 2020
@flo-renaud
Copy link
Contributor

ipa-4-8:

  • 0769a0b ipaplatform: add constant for systemd-run binary
  • 8437b5c ipatests: fix race condition in finalizer of encrypted backup test

@flo-renaud flo-renaud closed this Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ack Pull Request approved, can be merged pushed Pull Request has already been pushed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants