-
Notifications
You must be signed in to change notification settings - Fork 123
crypto: stop gpg-agents after unit test #2008
Conversation
See ElektraInitiative#1928 for discussion.
src/plugins/crypto/test_internals.h
Outdated
|
||
static void clean_env (void) | ||
{ | ||
// TODO make it pretty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if gpg_dir != NULL
src/plugins/crypto/test_internals.h
Outdated
succeed_if (gpg_dir != NULL, "no memory available"); | ||
if (gpg_dir == NULL) exit (-1); | ||
snprintf (gpg_dir, gpg_dir_size, "%s", tmp_template); | ||
gpg_dir = mkdtemp (gpg_dir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate code: line 126
See ElektraInitiative#1928 for discussion.
jenkins build all please |
Now I run consistently into the same problem as in #1973 . For some reason |
I have a few ideas that we could still try:
no output on stderr really does not help... |
another thing i noticed while trying through steps that might fail is that gpg will throw a warning regarding directory permissions when using GNUPGHOME on a random directory. But no error code is set. //EDIT: and I only tried with the test_key.asc directly, not the hexdump in test_key.h |
So still no progress here? |
Sadly no, still could not get any output from the gpg call or why it is
setting a nonzero exit code.
…On 23 May 2018 at 17:43, markus2330 ***@***.***> wrote:
So still no progress here?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2008 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEOv-jxWQgPecvqEEcxWgW371jh9BDRRks5t1YO9gaJpZM4UDzfB>
.
|
I too have no progress so far on this issue. 😞 |
I just had something fun happen in https://build.libelektra.org/jenkins/blue/organizations/jenkins/libelektra/detail/PR-2003/97/pipeline/326. gpg tests randomly failed. replayed the test and it passed. maybe trying to solve the gpg-agent issue is just exposing something wonky in the gpg interaction? |
I will play around with the gpg module to find out more. |
I know it would be a lot of work but have you considered replacing gpg exe manipulation with https://www.gnupg.org/software/gpgme/index.html? |
Yes, I already had a discussion with @markus2330 . Personally I would prefer to use gpgme. But it would take a lot of work to replace the current gpg module. |
Maybe writing a "hello world" testcase with gpgme would be a good start. Then we see if gpgme actually solves this problem. gpgme seems to work very similar to @petermax2's code. |
gpgme uses a lot more abstraction layers than my code 😆 LibAssuan handles the inter process communication but I did not have an in-depth look into its code so far. I will try to advance my progress on the |
@petermax2 I am not sure you followed #2056 but as you can see there the files for gpg-agent have changed and thus are not getting cleaned up anymore. Changing the gpg module to cleanup itself is probably overkill as the c testframework should handle it and is just outdated. Additionally I am sure you might have noticed that |
I did.
It is also not acceptable for a regular user session. I do not want my gpg-agent to stop after using Elektra. Especially if my agent was running before, I would be surprised if it is closed after using Elektra.
Actually I did some sort of dirty hack by invoking it three times. The first one deletes all files, the scond one the sub directories and the third one the root directory.
EDIT: I do appreciate every input about how to make this code less hacky. |
Purpose
This PR affects unit tests of
crypto
andfcrypt
.The general idea is to:
GNUPGHOME
to a temporary directory,gpg-agent
when the unit tests are done.Step 2 instructs
gpg-agent
to shut down. A big thank you to @ingwinlu for finding out how to properly shut down thegpg-agent
.Closes #1928 .
Checklist
Check relevant points but please do not remove entries.
For docu fixes, spell checking, and similar nothing
needs to be checked.
TODOs
fcrypt
unit test