From d438cb59a068b6f076e6bd70d3a2c46bc05ccb5c Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Mon, 19 Sep 2016 10:01:19 +0200 Subject: [PATCH] qt: Add debug output for testTofuPolicy * lang/qt/tests/t-tofuinfo.cpp (testTofuPolicy): Add debug output. -- The debug output is only emitted before a failure of the test in case a keylisting of bravo@example.net fails which it should never do. --- lang/qt/tests/t-tofuinfo.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lang/qt/tests/t-tofuinfo.cpp b/lang/qt/tests/t-tofuinfo.cpp index f40bf21d..d76ff7b7 100644 --- a/lang/qt/tests/t-tofuinfo.cpp +++ b/lang/qt/tests/t-tofuinfo.cpp @@ -299,6 +299,26 @@ private Q_SLOTS: auto result = job->exec(QStringList() << QStringLiteral("bravo@example.net"), false, keys); + if (keys.empty()) { + qDebug() << "bravo@example.net not found"; + qDebug() << "Error: " << result.error().asString(); + const auto homedir = QString::fromLocal8Bit(qgetenv("GNUPGHOME")); + qDebug() << "Homedir is: " << homedir; + QFileInfo fi(homedir + "/pubring.gpg"); + qDebug () << "pubring exists: " << fi.exists() << " readable? " + << fi.isReadable() << " size: " << fi.size(); + QFileInfo fi2(homedir + "/pubring.kbx"); + qDebug () << "keybox exists: " << fi2.exists() << " readable? " + << fi2.isReadable() << " size: " << fi2.size(); + + result = job->exec(QStringList(), false, keys); + foreach (const auto key, keys) { + qDebug() << "Key: " << key.userID(0).name() << " <" + << key.userID(0).email() + << ">\n fpr: " << key.primaryFingerprint(); + } + } + Q_ASSERT(!result.error()); Q_ASSERT(!keys.empty()); auto key = keys[0]; Q_ASSERT(!key.isNull());