Help needed to fix FilterActionEncryptTest::shouldEncrypt(PGP*) unit tests

Sandro Knauß sknauss at kde.org
Wed Aug 18 15:05:06 BST 2021


> 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. :(

Well gpg.conf is not the same like gpg-agent.conf!  Please create a 
gpg-agent.conf. 

> 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.

Wait - now you are talking about tests of messagelib/messagecomposer. These 
are independent of the tests in mailcommon. The messagecomposer tests are 
using the gpghome of messagelib/messagecore/autotests/gnupg_home and those 
talk to gpg via GpgME library. As those tests/keys are quite old it it 
possible, that they do not accept current hash functions. 

But please focus on the mailcommon ones. The mailcommon tests are using gpg 
from the commandline (that it in bug in it self, as gpg cmd interface is not 
guaranteed to never change). But that's why we should not mix the results, as 
the solutions may be different. 

> But at least we got one step further I think. So what could be the next
> steps to try?

I would suggest, that you print out the gpghome that gpg is using (gpg --
version). Also check the engineHomeDirectory of the QGpgME::Job::context. I 
expect that those are not correctly set.

Also it may be a test to run the tests when you first copy the gnupghome by and 
end export GNUPGHOME:
export GNUPGHOME = <path>

than do manual encrypt/decrypt:
gpg -e -r kmail at test.kde -o encrypt.asc
gpg -d encrypt.asc

than in the same terminal run the tests via ctest:
ctest -R mailcommon-filter-filteractionencrypttest --output-on-failure

and directly:
<path>/build/bin/filteractionencrypttest

(btw I also run the tests directly from the build path to have one layer less 
that can make strange things, exactly if I'm fighting with gpg setting/homedir)







More information about the kde-pim mailing list