[Kde-pim] GPGSM always opens a pinentry: makes automated tests impossible

Ingo Klöcker kloecker at kde.org
Thu Mar 7 20:06:21 GMT 2013


On Thursday 07 March 2013, Kevin Krammer wrote:
> On Thursday, 2013-03-07, Sandro Knauß wrote:
> > Hello,
> > 
> > I'm fixing the bugs now the tests in messageviewer(reviewboard
> > #109325) and messagecomposer(reviewboard #109327), that are
> > related to
> > encryption/signing. I already fixed them but, they won't run in
> > jenkins, because gpgsm (SMIME) always opens multiple pinentry
> > windows (that has to closed via mouse). For me it only runs with.
> > Only if I enter:
> > 
> > export GNUPGHOME=$KDE_SRC/kdepim/messagecore/tests/gnupg_home
> > source `gpg-agent --daemon`
> > 
> > than only one pinentry window opens.
> > 
> > Someone knows how to get these tests running without pinentry
> > window.
> > 
> > Keep in mind, that I never used gpgsm before, the workaround I
> > build based on my knowledge with gpg.
> 
> I don't know either but maybe we could have a fake pinentry program
> that delivers a predetermined passphrase.
> The pinentry program seems to be specified by gpg-agent..conf so a
> unit test environment could likely have a special version of that.

Alternatively, we could create mocks for {Encrypt,Sign,EncryptSign}Job. 
After all, we do not want to test encryption or signing, but just the 
correct composition of signed and/or encrypted messages. Using mocks 
will make this much simpler because they would always return the same 
values. Hence a simple string comparison of the composed messages 
against excepted result will do. With the real jobs checking a correct 
result will be more difficult because the real jobs always return 
different values (because the session key used for encryption is always 
different and signatures contain a timestamp).


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20130307/1c9e0f74/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list