[Kde-pim] Review Request 109434: starts and shutdon gpg-agent for tests
Kevin Krammer
krammer at kde.org
Tue Mar 12 18:14:31 GMT 2013
> On March 12, 2013, 9 a.m., Kevin Krammer wrote:
> > messagecore/tests/util.cpp, line 38
> > <http://git.reviewboard.kde.org/r/109434/diff/2/?file=119392#file119392line38>
> >
> > I am wondering if it might not also work to run it without --daemon, i.e. stay in control of the child process.
> > That way you wouldn't need cleanupEnv().
> >
> > Obviously makes the reading a bit more difficult since you can't use waitForFinished.
> >
> >
>
> Sandro Knauß wrote:
> Unfortunatelly gpg-agent without --daemon woll not start any gpg-agent:
> $ LANG=C gpg-agent
> gpg-agent[13121]: enabled debug flags: command mpi crypto memory cache memstat hashing assuan
> gpg-agent: no gpg-agent running in this session
> gpg-agent: random usage: poolsize=600 mixed=0 polls=0/0 added=0/0
> outmix=0 getlvl1=0/0 getlvl2=0/0
> gpg-agent: secmem usage: 0/32768 bytes in 0 blocks
>
> --server will start an deamonan keeps in foreground, but wants to interact via stdin/stdout and not via an socket. I think, technical it is possible to connect this stdout to a socket and set this socket to GPG_AGENT_INFO. But I don't think this code would be more readable.
>
>
>
> Kevin Krammer wrote:
> I see.
> Would be interesting to check if it can work without pinentry program if run in --server mode.
> While reading the man page I saw --allow-loopback-pinentry but I couldn't find any example on how this is being used.
>
> Anyway, I was mostly suggesting this because staying in control of the process would allow to use QProcess features to kill the process, which would also work on Windows (system("kill...") will not)
> But I forgot that the fake pinentry is currently also Unix only
>
> Can you check if gpg-connect-agent can be used to shut down the agent in a cross platform fashion?
>
> Sandro Knauß wrote:
> * No gpg-connect-agent can't shutdown gpg-agent.
> * There is a --no-detach arg for gpg-agent but I don't how to use :/
> * --allow-loopback-pinentry i already saw, but it is not available in gnupg 2.0.X
I did a bit more research and I wonder if we can somehow change the way the $unittest.shell files are generated.
Because then we could run the test as an argument to gpg-agent, basically run
gpg-agent --daemon testexecutable
This would make the agent exit when the test exits, most likely even when the test crashes
- Kevin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/109434/#review29055
-----------------------------------------------------------
On March 11, 2013, 11:33 p.m., Sandro Knauß wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/109434/
> -----------------------------------------------------------
>
> (Updated March 11, 2013, 11:33 p.m.)
>
>
> Review request for KDEPIM.
>
>
> Description
> -------
>
> starts and shutdon gpg-agent for tests
>
> To make sure that encryt test can run automatically f.ex. on jenkins a
> running gpg-agent is nessaccary.
>
> The gpg-agent is started via QProcess and will be killed afterwards.
>
>
> Diffs
> -----
>
> messagecore/tests/util.cpp 5dbc89c165995fa348bb7c7966de0809d74f0208
> messagecore/tests/util.h 6807a51789ee25a4d75b811751424fb28a464aed
> messagecomposer/tests/signjobtest.cpp ce20db6d7a1c1d92cd77b43b1058bf4969074730
> messagecomposer/tests/signjobtest.h 07c38d1f4ba42693036f8eee5cb8492aa830f625
> messagecomposer/tests/signencrypttest.cpp a4ef6a7cd3ffdc4617132dc1aaaa35a1fd975d32
> messagecomposer/tests/signencrypttest.h 941de3191eb961e781670606eb057e377a669426
> messagecomposer/tests/encryptjobtest.cpp 3cdced3bbb167eef1574333b44c7ad7472bf502b
> messagecomposer/tests/encryptjobtest.h bfda50739fdbef4c161534be17111c0427b3d09d
> messagecomposer/tests/cryptocomposertest.cpp b398975f17e72031fd503645654fc0db03f413c1
> messagecomposer/tests/cryptocomposertest.h 3862eea3eff43b10d9109d4ff1ddcdfa725f13ed
> messageviewer/tests/objecttreeparsertest.h df6a49fd731b31960f3b39859d09487ff40f5766
> messageviewer/tests/objecttreeparsertest.cpp fa9672b4d2249b509a84a3ff90829fd427a08e9c
> messageviewer/tests/rendertest.cpp 87f35c6e1a706ea21ef8aaea139cbd552d6e3a0e
> messageviewer/tests/unencryptedmessagetest.cpp 5e4ab2cc22aca347871e09f01a6fc25b512609ad
>
> Diff: http://git.reviewboard.kde.org/r/109434/diff/
>
>
> Testing
> -------
>
> grep MessageCore::Test::getKeys
> grep MessageCore::Test::setupEnv
>
> unset GPG_AGENT_INFO
> unset GNUPGHOME
>
> cd messagecomposer && make test
> cd messageviewer && make test
>
> ps aux | grep gpg-agent
>
>
> Thanks,
>
> Sandro Knauß
>
>
_______________________________________________
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