← Back to team overview

kubuntu-council team mailing list archive

[Merge] ~legovini/ubuntu-manual-tests:fix-2fa into ubuntu-manual-tests:master

 

Paride Legovini has proposed merging ~legovini/ubuntu-manual-tests:fix-2fa into ubuntu-manual-tests:master.

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.


Requested reviews:
  Brian Murray (brian-murray)

For more details, see:
https://code.launchpad.net/~legovini/ubuntu-manual-tests/+git/ubuntu-manual-tests/+merge/381828
-- 
Your team Ubuntu Testcase Admins is subscribed to branch ubuntu-manual-tests:master.
diff --git a/tools/qa_tracker_update.pl b/tools/qa_tracker_update.pl
index 1f9ab81..6448c67 100644
--- a/tools/qa_tracker_update.pl
+++ b/tools/qa_tracker_update.pl
@@ -223,6 +223,24 @@ sub login {
         }
     }
 
+    print "Enter your 2FA OTP: ";
+    my $otp = <STDIN>;
+    chomp $otp;
+
+    $mech->submit_form(
+        form_id => 'login-form',
+        fields      => {
+            oath_token => $otp,
+        }
+    );
+
+    if ($mech->success()) {
+        #$output = $mech->content();
+        #print "2FA Login submit:\n" . $output . "\n";
+    } else {
+        die localtime(time) . ' Error meching 2FA Login' . "\n";
+    }
+
     #sso decide form
     $mech->submit_form(
 		form_name => 'decideform',

Follow ups