diff options
author | Dylan William Hardison <dylan@hardison.net> | 2017-08-18 00:29:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-18 00:29:49 +0200 |
commit | 7eb7529be9c43e9a1ff69bf1dd974ed3b123241e (patch) | |
tree | 88acc9f77ae1fc1cdb4c9cce1635878d9e45623c /scripts | |
parent | 5c849ad08765322010064f482fd2dea11482c114 (diff) | |
download | bugzilla-7eb7529be9c43e9a1ff69bf1dd974ed3b123241e.tar.gz bugzilla-7eb7529be9c43e9a1ff69bf1dd974ed3b123241e.tar.xz |
Bug 1388148 - Test password quality checking code
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/entrypoint.pl | 22 | ||||
-rwxr-xr-x | scripts/generate_bmo_data.pl | 4 |
2 files changed, 20 insertions, 6 deletions
diff --git a/scripts/entrypoint.pl b/scripts/entrypoint.pl index 2d1ef8fe9..c39551131 100755 --- a/scripts/entrypoint.pl +++ b/scripts/entrypoint.pl @@ -3,16 +3,18 @@ use 5.10.1; use strict; use warnings; use lib qw(/app /app/local/lib/perl5); + use Bugzilla::Install::Localconfig (); use Bugzilla::Install::Util qw(install_string); +use Bugzilla::Test::Util qw(create_user); use DBI; use Data::Dumper; use English qw($EUID); use File::Copy::Recursive qw(dircopy); use Getopt::Long qw(:config gnu_getopt); use LWP::Simple qw(get); -use User::pwent; use POSIX qw(WEXITSTATUS setsid); +use User::pwent; use IO::Async::Loop; use IO::Async::Process; @@ -53,7 +55,7 @@ sub cmd_load_test_data { run( 'perl', 'generate_test_data.pl' ); } else { - run( 'perl', 'scripts/generate_bmo_data.pl' ); + run( 'perl', 'scripts/generate_bmo_data.pl', '--param' => 'use_mailer_queue=0' ); } } @@ -76,6 +78,8 @@ sub cmd_test_webservices { my $conf = require $ENV{BZ_QA_CONF_FILE}; check_data_dir(); + wait_for_db(); + my @httpd_cmd = ( '/usr/sbin/httpd', '-DFOREGROUND', '-f', '/app/httpd/httpd.conf' ); if ($ENV{BZ_QA_LEGACY_MODE}) { copy_qa_extension(); @@ -98,6 +102,7 @@ sub cmd_test_selenium { my $conf = require $ENV{BZ_QA_CONF_FILE}; check_data_dir(); + wait_for_db(); my @httpd_cmd = ( '/usr/sbin/httpd', '-DFOREGROUND', '-f', '/app/httpd/httpd.conf' ); if ($ENV{BZ_QA_LEGACY_MODE}) { copy_qa_extension(); @@ -121,6 +126,16 @@ sub cmd_prove { run( "prove", "-I/app", "-I/app/local/lib/perl5", @_ ); } sub cmd_version { run( 'cat', '/app/version.json' ); } sub cmd_test_bmo { + check_data_dir(); + wait_for_db(); + + $ENV{BZ_TEST_NEWBIE} = 'newbie@mozilla.example'; + $ENV{BZ_TEST_NEWBIE_PASS} = 'captain.space.bagel.ROBOT!'; + create_user($ENV{BZ_TEST_NEWBIE}, $ENV{BZ_TEST_NEWBIE_PASS}, realname => "Newbie User"); + + $ENV{BZ_TEST_NEWBIE2} = 'newbie2@mozilla.example'; + $ENV{BZ_TEST_NEWBIE2_PASS} = 'captain.space.pants.time.lord'; + prove_with_httpd( httpd_url => $ENV{BZ_BASE_URL}, httpd_cmd => [ '/usr/sbin/httpd', '-f', '/app/httpd/httpd.conf', '-DFOREGROUND' ], @@ -131,9 +146,6 @@ sub cmd_test_bmo { sub prove_with_httpd { my (%param) = @_; - check_data_dir(); - wait_for_db(); - unless (-d "/app/logs") { mkdir("/app/logs") or die "unable to mkdir(/app/logs): $!\n"; } diff --git a/scripts/generate_bmo_data.pl b/scripts/generate_bmo_data.pl index 788227443..b2df7ddba 100755 --- a/scripts/generate_bmo_data.pl +++ b/scripts/generate_bmo_data.pl @@ -63,7 +63,8 @@ my %user_prefs = ( zoom_textareas => 'off', ); -GetOptions('user-pref=s%' => \%user_prefs); +my %opt_param; +GetOptions('user-pref=s%' => \%user_prefs, 'param=s' => \%opt_param); my $admin_email = shift || 'admin@mozilla.bugs'; Bugzilla->set_user(Bugzilla::User->check({ name => $admin_email })); @@ -496,6 +497,7 @@ my %set_params = ( use_mailer_queue => 1, user_info_class => 'GitHubAuth,CGI', user_verify_class => 'GitHubAuth,DB', + %opt_param, ); my $params_modified; |