summaryrefslogtreecommitdiffstats
path: root/qa
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2017-09-15 20:30:40 +0200
committerGitHub <noreply@github.com>2017-09-15 20:30:40 +0200
commite9adcde4648b54db8d40f314ca938dca5080bb9c (patch)
treebd826aa5f5857e063d575fec1ec16068712edd4a /qa
parent06c57b6e475767923f8294cf93fd746d45f3dc6f (diff)
downloadbugzilla-e9adcde4648b54db8d40f314ca938dca5080bb9c.tar.gz
bugzilla-e9adcde4648b54db8d40f314ca938dca5080bb9c.tar.xz
Bug 1391702 - Replace Bugzilla::User::validate_password() with calls to Data::Password::passwdqc
Diffstat (limited to 'qa')
-rw-r--r--qa/config/generate_test_data.pl5
-rw-r--r--qa/config/selenium_test.conf16
-rw-r--r--qa/t/test_bmo_enter_new_bug.t2
-rw-r--r--qa/t/test_password_complexity.t97
-rw-r--r--qa/t/test_user_groups.t7
-rw-r--r--qa/t/webservice_user_create.t4
6 files changed, 18 insertions, 113 deletions
diff --git a/qa/config/generate_test_data.pl b/qa/config/generate_test_data.pl
index 62daef772..333bffa26 100644
--- a/qa/config/generate_test_data.pl
+++ b/qa/config/generate_test_data.pl
@@ -182,7 +182,8 @@ foreach my $username (@usernames) {
}
Bugzilla::User->create(
- { login_name => $login,
+ {
+ login_name => $login,
realname => $realname,
cryptpassword => $password,
%extra_args,
@@ -498,7 +499,7 @@ foreach my $product (@products) {
Bugzilla::User->create({
login_name => $watch_user,
- cryptpassword => generate_random_password(),
+ cryptpassword => Bugzilla->passwdqc->generate_password(),
disable_mail => 1,
});
diff --git a/qa/config/selenium_test.conf b/qa/config/selenium_test.conf
index 2a163d5f0..7fbfeffe3 100644
--- a/qa/config/selenium_test.conf
+++ b/qa/config/selenium_test.conf
@@ -22,28 +22,28 @@
'test_bug_1' => 1,
'test_bug_2' => 2,
'admin_user_login' => 'admin@mozilla.test',
- 'admin_user_passwd' => 'password',
+ 'admin_user_passwd' => 'bo6aazeKohch',
'admin_user_username' => 'QA Admin',
'admin_user_nick' => 'admin',
'permanent_user' => 'permanent_user@mozilla.test',
'permanent_user_login' => 'permanent_user@mozilla.test',
- 'permanent_user_passwd' => 'password',
+ 'permanent_user_passwd' => 'bo6aazeKohch',
'unprivileged_user_login' => 'no-privs@mozilla.test',
- 'unprivileged_user_passwd' => 'password',
+ 'unprivileged_user_passwd' => 'bo6aazeKohch',
'unprivileged_user_username' => 'no-privs',
'unprivileged_user_nick' => 'no-privs',
'unprivileged_user_login_truncated' => 'no-privs@mo',
'QA_Selenium_TEST_user_login' => 'QA-Selenium-TEST@mozilla.test',
- 'QA_Selenium_TEST_user_passwd' => 'password',
+ 'QA_Selenium_TEST_user_passwd' => 'bo6aazeKohch',
'editbugs_user_login' => 'editbugs@mozilla.test',
- 'editbugs_user_passwd' => 'password',
+ 'editbugs_user_passwd' => 'bo6aazeKohch',
'canconfirm_user_login' => 'canconfirm@mozilla.test',
- 'canconfirm_user_passwd' => 'password',
+ 'canconfirm_user_passwd' => 'bo6aazeKohch',
'tweakparams_user_login' => 'tweakparams@mozilla.test',
'tweakparams_user_login_truncated' => 'tweakparams@mo',
- 'tweakparams_user_passwd' => 'password',
+ 'tweakparams_user_passwd' => 'bo6aazeKohch',
'disabled_user_login' => 'disabled@mozilla.test',
- 'disabled_user_passwd' => 'password',
+ 'disabled_user_passwd' => 'bo6aazeKohch',
'common_email' => '@mozilla.test',
'test_extensions' => 1,
};
diff --git a/qa/t/test_bmo_enter_new_bug.t b/qa/t/test_bmo_enter_new_bug.t
index 702d067a1..6e5753c74 100644
--- a/qa/t/test_bmo_enter_new_bug.t
+++ b/qa/t/test_bmo_enter_new_bug.t
@@ -413,7 +413,7 @@ sub _check_user {
$sel->wait_for_page_to_load(WAIT_TIME);
$sel->title_is('Add user');
$sel->type_ok('login', $user);
- $sel->type_ok('password', 'password');
+ $sel->type_ok('password', 'icohF1io2ohw');
$sel->click_ok("add");
$sel->wait_for_page_to_load(WAIT_TIME);
$sel->is_text_present('regexp:The user account .* has been created successfully');
diff --git a/qa/t/test_password_complexity.t b/qa/t/test_password_complexity.t
deleted file mode 100644
index 97b440ddd..000000000
--- a/qa/t/test_password_complexity.t
+++ /dev/null
@@ -1,97 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This Source Code Form is "Incompatible With Secondary Licenses", as
-# defined by the Mozilla Public License, v. 2.0.
-
-use 5.10.1;
-use strict;
-use warnings;
-use lib qw(lib ../../lib ../../local/lib/perl5);
-
-use Test::More "no_plan";
-use QA::Util;
-
-my ($sel, $config) = get_selenium();
-log_in($sel, $config, 'admin');
-
-set_parameters($sel, {"Administrative Policies" => {"allowuserdeletion-on" => undef},
- "User Authentication" => {"createemailregexp" => {type => "text", value => '.*'},
- "emailsuffix" => {type => "text", value => ''}} });
-
-# Set the password complexity to BMO.
-# Password must contain at least one UPPER and one lowercase letter.
-my @invalid_bmo = qw(lowercase UPPERCASE 1234567890 123lowercase 123UPPERCASE !@%&^lower !@&^UPPER);
-
-check_passwords($sel, 'bmo', \@invalid_bmo, ['Longerthan12chars', '%9rT#j22S']);
-
-# Set the password complexity to No Constraints.
-check_passwords($sel, 'no_constraints', ['12xY!', 'aaaaa'], ['aaaaaaaa', '>F12Xy?#']);
-
-logout($sel);
-
-sub check_passwords {
- my ($sel, $param, $invalid_passwords, $valid_passwords) = @_;
-
- set_parameters($sel, { "User Authentication" => {"password_complexity" => {type => "select", value => $param}} });
- my $new_user = 'selenium-' . random_string(10) . '@bugzilla.org';
-
- go_to_admin($sel);
- $sel->click_ok("link=Users");
- $sel->wait_for_page_to_load_ok(WAIT_TIME);
- $sel->title_is('Search users');
- $sel->click_ok('link=add a new user');
- $sel->wait_for_page_to_load_ok(WAIT_TIME);
- $sel->title_is('Add user');
- $sel->type_ok('login', $new_user);
-
- foreach my $password (@$invalid_passwords) {
- $sel->type_ok('password', $password, 'Enter password');
- $sel->click_ok('add');
- $sel->wait_for_page_to_load_ok(WAIT_TIME);
- if ($param eq 'no_constraints') {
- $sel->title_is('Password Too Short');
- }
- else {
- $sel->title_is('Password Fails Requirements');
- }
-
- my $error_msg = trim($sel->get_text("error_msg"));
- if ($param eq 'bmo') {
- ok($error_msg =~ /must meet three of the following requirements/,
- "Password fails requirement: $password");
- }
- else {
- ok($error_msg =~ /The password must be at least \d+ characters long/,
- "Password Too Short: $password");
- }
- $sel->go_back_ok();
- $sel->wait_for_page_to_load_ok(WAIT_TIME);
- }
-
- my $created = 0;
-
- foreach my $password (@$valid_passwords) {
- $sel->type_ok('password', $password, 'Enter password');
- $sel->click_ok($created ? 'update' : 'add');
- $sel->wait_for_page_to_load_ok(WAIT_TIME);
- $sel->title_is($created ? "User $new_user updated" : "Edit user $new_user");
- my $msg = trim($sel->get_text('message'));
- if ($created++) {
- ok($msg =~ /A new password has been set/, 'Account updated');
- }
- else {
- ok($msg =~ /The user account $new_user has been created successfully/, 'Account created');
- }
- }
-
- return unless $created;
-
- $sel->click_ok('delete');
- $sel->wait_for_page_to_load_ok(WAIT_TIME);
- $sel->title_is("Confirm deletion of user $new_user");
- $sel->click_ok('delete');
- $sel->wait_for_page_to_load_ok(WAIT_TIME);
- $sel->title_is("User $new_user deleted");
-}
diff --git a/qa/t/test_user_groups.t b/qa/t/test_user_groups.t
index 89fc2fd6d..0798a1b80 100644
--- a/qa/t/test_user_groups.t
+++ b/qa/t/test_user_groups.t
@@ -12,6 +12,7 @@ use lib qw(lib ../../lib ../../local/lib/perl5);
use Test::More "no_plan";
use QA::Util;
+use constant PASSWORD => 'uChoopoh1che';
my ($sel, $config) = get_selenium();
@@ -67,7 +68,7 @@ $sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_is('Add user');
$sel->type_ok('login', 'master@selenium.bugzilla.org');
$sel->type_ok('name', 'master-user');
-$sel->type_ok('password', 'selenium', 'Enter password');
+$sel->type_ok('password', PASSWORD, 'Enter password');
$sel->type_ok('disabledtext', 'Not for common usage');
$sel->click_ok('add');
$sel->wait_for_page_to_load_ok(WAIT_TIME);
@@ -83,7 +84,7 @@ $sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_is('Add user');
$sel->type_ok('login', 'slave@selenium.bugzilla.org');
$sel->type_ok('name', 'slave-user');
-$sel->type_ok('password', 'selenium', 'Enter password');
+$sel->type_ok('password', PASSWORD, 'Enter password');
$sel->type_ok('disabledtext', 'Not for common usage');
$sel->click_ok('add');
$sel->wait_for_page_to_load_ok(WAIT_TIME);
@@ -99,7 +100,7 @@ $sel->wait_for_page_to_load_ok(WAIT_TIME);
$sel->title_is('Add user');
$sel->type_ok('login', 'reg@selenium.bugzilla.org');
$sel->type_ok('name', 'reg-user');
-$sel->type_ok('password', 'selenium', 'Enter password');
+$sel->type_ok('password', PASSWORD, 'Enter password');
$sel->type_ok('disabledtext', 'Not for common usage');
$sel->click_ok('add');
$sel->wait_for_page_to_load_ok(WAIT_TIME);
diff --git a/qa/t/webservice_user_create.t b/qa/t/webservice_user_create.t
index f82e71ae4..34b7a4896 100644
--- a/qa/t/webservice_user_create.t
+++ b/qa/t/webservice_user_create.t
@@ -16,7 +16,7 @@ use QA::Util;
use Test::More tests => 75;
my ($config, $xmlrpc, $jsonrpc, $jsonrpc_get) = get_rpc_clients();
-use constant NEW_PASSWORD => 'password';
+use constant NEW_PASSWORD => 'UiX1Shuuchid';
use constant NEW_FULLNAME => 'WebService Created User';
use constant PASSWORD_TOO_SHORT => 'a';
@@ -91,7 +91,7 @@ foreach my $rpc ($jsonrpc, $xmlrpc) {
{ user => 'admin',
args => { email => new_login(), full_name => NEW_FULLNAME,
password => PASSWORD_TOO_SHORT },
- error => 'password must be at least',
+ error => 'The password does not meet our security requirements for the following reason: too short',
test => 'Password Too Short fails',
},
{ user => 'admin',