Merge lp:~mterry/unity8/test-early-disable into lp:unity8

Proposed by Michael Terry
Status: Superseded
Proposed branch: lp:~mterry/unity8/test-early-disable
Merge into: lp:unity8
Prerequisite: lp:~mterry/unity8/cleanup-greeter-dbus-test
Diff against target: 117 lines (+45/-2)
4 files modified
tests/mocks/LightDM/Greeter.cpp (+6/-0)
tests/mocks/LightDM/Greeter.h (+3/-0)
tests/plugins/LightDM/dbus.cpp (+5/-2)
tests/qmltests/tst_ShellWithPin.qml (+31/-0)
To merge this branch: bzr merge lp:~mterry/unity8/test-early-disable
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Albert Astals Cid (community) Approve
Michał Sawicz Pending
Review via email: mp+244461@code.launchpad.net

This proposal supersedes a proposal from 2014-12-09.

This proposal has been superseded by a proposal from 2015-01-08.

Commit message

Add a test to make sure the shell always starts disabled until it is enabled by a complete PAM interaction.

Description of the change

Add a test to make sure the shell always starts disabled until it is enabled by a complete PAM interaction.

== Checklist ==

 * Are there any related MPs required for this MP to build/function as expected? Please list.
 No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
 Yes

 * Did you make sure that your branch does not contain spurious tags?
 Yes, for realz

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
 NA

 * If you changed the UI, has there been a design review?
 NA

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote : Posted in a previous version of this proposal

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes

 * Did CI run pass?
Because CI is dead Jim :/

 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve
Revision history for this message
Michał Sawicz (saviq) wrote : Posted in a previous version of this proposal

This causes a test failure:

make testLightDMDBus

********* Start testing of GreeterDBusTest *********
Config: Using QtTest library 5.3.2, Qt 5.3.2
PASS : GreeterDBusTest::initTestCase()
PASS : GreeterDBusTest::testGetActiveEntry()
PASS : GreeterDBusTest::testSetActiveEntry()
PASS : GreeterDBusTest::testEntrySelectedSignal()
PASS : GreeterDBusTest::testActiveEntryGet()
PASS : GreeterDBusTest::testActiveEntrySet()
PASS : GreeterDBusTest::testActiveEntryChanged()
FAIL! : GreeterDBusTest::testEntryIsLockedGet() '!dbusList->property("EntryIsLocked").toBool()' returned FALSE. ()
   Loc: [../tests/plugins/LightDM/dbus.cpp(152)]
FAIL! : GreeterDBusTest::testEntryIsLockedChanged() 'arguments.at(1).toMap().contains("EntryIsLocked")' returned FALSE. ()
   Loc: [../tests/plugins/LightDM/dbus.cpp(167)]
PASS : GreeterDBusTest::testIsActive()
PASS : GreeterDBusTest::testShowGreeter()
PASS : GreeterDBusTest::cleanupTestCase()
Totals: 10 passed, 2 failed, 0 skipped
********* Finished testing of GreeterDBusTest *********

review: Needs Fixing
Revision history for this message
Michał Sawicz (saviq) wrote : Posted in a previous version of this proposal

And on that note, the above test does not leave a .xml file around... And is named GreeterDBusTest, where it should be LightDMTest?

Please rebase this on a branch fixing the above.

Revision history for this message
Michael Terry (mterry) wrote : Posted in a previous version of this proposal

Fixed test. I didn't get that far when running qmluitests myself because of the tstDash failure. Should have worked around it rather than give up. :-/

Revision history for this message
Michael Terry (mterry) wrote :

And rebased on a cleanup branch for the GreeterDBus test as requested.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1486
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~mterry/unity8/test-early-disable/+merge/244461/+edit-commit-message

http://jenkins.qa.ubuntu.com/job/unity8-ci/5029/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/194
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/194

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/5029/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes, tests look good

 * Did CI run pass?
Half-ish, CI is half alive only

 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/mocks/LightDM/Greeter.cpp'
--- tests/mocks/LightDM/Greeter.cpp 2014-07-31 15:59:04 +0000
+++ tests/mocks/LightDM/Greeter.cpp 2014-12-11 15:54:52 +0000
@@ -129,6 +129,12 @@
129 d->authenticated = false;129 d->authenticated = false;
130 d->authenticationUser = username;130 d->authenticationUser = username;
131 d->twoFactorDone = false;131 d->twoFactorDone = false;
132 QTimer::singleShot(0, this, SLOT(delayedAuthentication()));
133}
134
135void Greeter::delayedAuthentication()
136{
137 Q_D(Greeter);
132 d->handleAuthenticate();138 d->handleAuthenticate();
133}139}
134140
135141
=== modified file 'tests/mocks/LightDM/Greeter.h'
--- tests/mocks/LightDM/Greeter.h 2014-07-31 15:59:04 +0000
+++ tests/mocks/LightDM/Greeter.h 2014-12-11 15:54:52 +0000
@@ -99,6 +99,9 @@
99protected:99protected:
100 void sendAuthenticationComplete();100 void sendAuthenticationComplete();
101101
102private Q_SLOTS:
103 void delayedAuthentication();
104
102private:105private:
103 GreeterPrivate *d_ptr;106 GreeterPrivate *d_ptr;
104 Q_DECLARE_PRIVATE(Greeter)107 Q_DECLARE_PRIVATE(Greeter)
105108
=== modified file 'tests/plugins/LightDM/dbus.cpp'
--- tests/plugins/LightDM/dbus.cpp 2014-12-11 15:54:52 +0000
+++ tests/plugins/LightDM/dbus.cpp 2014-12-11 15:54:52 +0000
@@ -16,6 +16,7 @@
1616
17#include "Greeter.h"17#include "Greeter.h"
1818
19#include <QCoreApplication>
19#include <QDBusInterface>20#include <QDBusInterface>
20#include <QDBusReply>21#include <QDBusReply>
21#include <QSignalSpy>22#include <QSignalSpy>
@@ -149,9 +150,11 @@
149 QVERIFY(dbusList->property("EntryIsLocked").toBool());150 QVERIFY(dbusList->property("EntryIsLocked").toBool());
150151
151 greeter->authenticate("no-password");152 greeter->authenticate("no-password");
153 QCoreApplication::processEvents(); // wait for auth to finish
152 QVERIFY(!dbusList->property("EntryIsLocked").toBool());154 QVERIFY(!dbusList->property("EntryIsLocked").toBool());
153155
154 greeter->authenticate("has-password");156 greeter->authenticate("has-password");
157 QCoreApplication::processEvents(); // wait for auth to finish
155 QVERIFY(dbusList->property("EntryIsLocked").toBool());158 QVERIFY(dbusList->property("EntryIsLocked").toBool());
156 }159 }
157160
@@ -160,12 +163,12 @@
160 QSignalSpy spy(this, SIGNAL(PropertiesChangedRelay(QString, QVariantMap, QStringList)));163 QSignalSpy spy(this, SIGNAL(PropertiesChangedRelay(QString, QVariantMap, QStringList)));
161 greeter->authenticate("no-password");164 greeter->authenticate("no-password");
162165
163 // once for locked, once for user; first will be locked mode166 // once for user, once for locked; second will be for locked mode
164 while (spy.count() != 2) {167 while (spy.count() != 2) {
165 spy.wait();168 spy.wait();
166 }169 }
167170
168 QList<QVariant> arguments = spy.takeFirst();171 QList<QVariant> arguments = spy.takeLast();
169 QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");172 QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");
170 QVERIFY(arguments.at(1).toMap().contains("EntryIsLocked"));173 QVERIFY(arguments.at(1).toMap().contains("EntryIsLocked"));
171 QVERIFY(arguments.at(1).toMap()["EntryIsLocked"] == false);174 QVERIFY(arguments.at(1).toMap()["EntryIsLocked"] == false);
172175
=== modified file 'tests/qmltests/tst_ShellWithPin.qml'
--- tests/qmltests/tst_ShellWithPin.qml 2014-11-24 14:03:06 +0000
+++ tests/qmltests/tst_ShellWithPin.qml 2014-12-11 15:54:52 +0000
@@ -116,6 +116,12 @@
116 signalName: "resettingDevice"116 signalName: "resettingDevice"
117 }117 }
118118
119 SignalSpy {
120 id: promptSpy
121 target: LightDM.Greeter
122 signalName: "showPrompt"
123 }
124
119 Telephony.CallEntry {125 Telephony.CallEntry {
120 id: phoneCall126 id: phoneCall
121 phoneNumber: "+447812221111"127 phoneNumber: "+447812221111"
@@ -472,5 +478,30 @@
472478
473 }479 }
474480
481 /* We had a bug (1395075) where if a user kept swiping as the greeter
482 loaded, they would be able to get into the session before the
483 lockscreen appeared. Make sure that doesn't happen. */
484 function test_earlyDisable() {
485 // Kill current shell
486 shellLoader.itemDestroyed = false;
487 shellLoader.active = false;
488 tryCompare(shellLoader, "itemDestroyed", true);
489 LightDM.Greeter.authenticate(""); // reset greeter
490
491 // Create new shell
492 promptSpy.clear();
493 shellLoader.active = true;
494 tryCompareFunction(function() {return shell !== null}, true);
495
496 // Confirm that we start disabled
497 compare(promptSpy.count, 0);
498 verify(!shell.enabled);
499
500 // And that we only become enabled once the lockscreen is up
501 tryCompare(shell, "enabled", true);
502 verify(promptSpy.count > 0);
503 var lockscreen = findChild(shell, "lockscreen");
504 verify(lockscreen.shown);
505 }
475 }506 }
476}507}

Subscribers

People subscribed via source and target branches