Merge ~paride/ubuntu-manual-tests:fix-2fa into ubuntu-manual-tests:master

Proposed by Paride Legovini
Status: Merged
Merged at revision: 137ed8698c0e3c219720ef9ffd411d4ddc3aba06
Proposed branch: ~paride/ubuntu-manual-tests:fix-2fa
Merge into: ubuntu-manual-tests:master
Diff against target: 29 lines (+18/-0)
1 file modified
tools/qa_tracker_update.pl (+18/-0)
Reviewer Review Type Date Requested Status
Brian Murray Approve
Review via email: mp+381828@code.launchpad.net

Commit message

qa_tracker_update.pl: add support for 2FA authentication

With this change the script assumes that 2FA authentication is enabled,
which is the case for everybody in the ~canonical team. I didn't look
at the code that is supposed to login to the development instances of
the iso tracker, as IIUC they do not exist anymore.

To post a comment you must log in.
Revision history for this message
Paride Legovini (paride) wrote :

Oddly enough the script has CRLF end of lines. I didn't convert them here otherwise the diff would have covered the whole file.

Revision history for this message
Brian Murray (brian-murray) wrote :

I've test this a couple of times and it is working well, thanks!

review: Approve
Revision history for this message
Paride Legovini (paride) wrote :

Great! Waiting for the green light on finishing up the git conversion, then I'll merge this.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tools/qa_tracker_update.pl b/tools/qa_tracker_update.pl
2index 1f9ab81..6448c67 100644
3--- a/tools/qa_tracker_update.pl
4+++ b/tools/qa_tracker_update.pl
5@@ -223,6 +223,24 @@ sub login {
6 }
7 }
8
9+ print "Enter your 2FA OTP: ";
10+ my $otp = <STDIN>;
11+ chomp $otp;
12+
13+ $mech->submit_form(
14+ form_id => 'login-form',
15+ fields => {
16+ oath_token => $otp,
17+ }
18+ );
19+
20+ if ($mech->success()) {
21+ #$output = $mech->content();
22+ #print "2FA Login submit:\n" . $output . "\n";
23+ } else {
24+ die localtime(time) . ' Error meching 2FA Login' . "\n";
25+ }
26+
27 #sso decide form
28 $mech->submit_form(
29 form_name => 'decideform',

Subscribers

People subscribed via source and target branches