Help needed to fix FilterActionEncryptTest::shouldEncrypt(PGP*) unit tests
Friedrich W. H. Kossebau
kossebau at kde.org
Wed Aug 18 00:29:35 BST 2021
Am Dienstag, 17. August 2021, 19:17:06 CEST schrieb Sandro Knauß:
> What I used for all tests inside messagelib is in gpg-agent.conf
> faked-system-time 20130110T154812
>
> this makes sure, that keys do not expire ;)
> see messagelib/messagecore/autotests/gnupg_home for maybe more settings,
> that may help.
>
> Also what helps a lot is to create a GPGHOME at your own, by coping
> src/filter/autotests/gpghome into a temp dir and than
> export GNUPGHOME = <path>
>
> and than use gpg --list-keys and gpg --list-secrect-keys etc. to understand
> why those keys can't be used. As this give you a direct output, that is more
> "user friendly".
Did that, and indeed having a gpg-conf with the line
faked-system-time 20130110T154812
helped in that manual test you described above, "gpg --list-keys" changed from
```
/path/to/gpghome/pubring.gpg
---------------------------------------
pub rsa2048 2017-08-01 [SC] [expired: 2019-08-01]
818AE8DA30F81B0CEA4403BA358732559B8659B2
uid [ expired] KMail Test <kmail at test.kde>
```
to
```
/path/to/gpghome/pubring.gpg
---------------------------------------
pub rsa2048 2017-08-01 [SCEA]
818AE8DA30F81B0CEA4403BA358732559B8659B2
uid [ultimate] KMail Test <kmail at test.kde>
sub rsa2048 2017-08-01 []
```
Just, adding the same line to the gpg.conf file which gets deployed to the
temporary home during the unit test run did not change the error there. :(
Also changed code to set explicitly the GnupgHome property on the
MessageComposer::EncryptJob, so it sets it on the QGpgME::Job::context, in
case the env var GNUPGHOME as set by the test's GPGHelper is ignored, but also
to no effect.
But at least we got one step further I think. So what could be the next steps
to try?
Cheers
Friedrich
More information about the kde-pim
mailing list