[TESTCASE] Wallet not saving entries when closed

David Faure faure at kde.org
Mon Nov 12 00:20:43 CET 2007


On Saturday 10 November 2007, Thomas McGuire wrote:
> Hello,
> 
> i noticed that KMail seemingly randomly loses its passwords when they are 
> stored in the wallet.
> It seems that as soon as the last application using kwallet quits, the data is 
> lost.

I experience a similar bug in kde3 with kwallet and form data... When I reboot
some form contents saved into kwallet are forgotten. Good to see a test for that bug,
this is informative too (I thought the bug was higher up, in khtml, than in kwallet itself)

> I've written a testcase (attached) which tests some of the kwallet features. 
> It fails after closing the wallet, then reopening it again to read some keys.
> 
> To run it, first start kdeinit4 to make sure the wallet daemon is active, then 
> run the test.
Call KToolInvocation::klauncher() from the test so that this happens automatically.

> This is the first test I've written. Can it go into kdelibs or does it need 
> some modifications? Any other comments on it?
The test breaks, i.e. fails due to the bug, right? Then you can't commit it
(the rule 1 of unit testing is: all tests should always pass :).
But you can add a QEXPECT_FAIL (see kurltest.cpp for an example) before the failing test
and commit IMHO.

> I think modifing the main wallet and requiring a running kded module might not 
> be a good idea for a test, but I don't know how to do this better.
Hmm, good question. In general unit tests run "in their own environment" due to $KDEHOME
being set automatically to .kde-unit-test by qtest_kde.h, so at least any KConfig messing
won't affect the real user's configuration. But with DBUS the unit tests talk to the real
DBUS servers like kded, so the wallet test does affect your real wallet. Unless we start
our own dbus session server (and kded4) just for the test...

> Even if the wallet bug turns out to be user error or KMail's fault, I think 
> this testcase still makes a nice addition to kdelibs.
> Otherwise, I would be nice if somebody could fix the bug.
Yep.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).


More information about the Kdelibs-bugs mailing list