From a85940f9149c862a6421503f97a9f821ea5f4cee Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 15 Sep 2015 18:28:00 +0000 Subject: Bug 1204704: Backport upstream testsuite changes to test against bug 1202447 --- qa/t/test_create_user_accounts.t | 2 ++ qa/t/webservice_user_create.t | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'qa') diff --git a/qa/t/test_create_user_accounts.t b/qa/t/test_create_user_accounts.t index d9c0c4404..5d6471073 100644 --- a/qa/t/test_create_user_accounts.t +++ b/qa/t/test_create_user_accounts.t @@ -85,6 +85,8 @@ foreach my $account (@accounts) { # These accounts are illegal but do not cause a javascript alert @accounts = ('test@bugzilla.org@bugzilla.test', 'test@bugzilla..test'); +# Logins larger than 127 characters must be rejected, for security reasons. +push @accounts, 'selenium-' . random_string(110) . '@bugzilla.test'; foreach my $account (@accounts) { $sel->click_ok("link=New Account"); $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 20301a6c5..551de9977 100644 --- a/qa/t/webservice_user_create.t +++ b/qa/t/webservice_user_create.t @@ -13,7 +13,7 @@ use strict; use warnings; use lib qw(lib); use QA::Util; -use Test::More tests => 69; +use Test::More tests => 75; my ($config, $xmlrpc, $jsonrpc, $jsonrpc_get) = get_rpc_clients(); use constant NEW_PASSWORD => 'password'; @@ -25,7 +25,7 @@ use constant PASSWORD_TOO_SHORT => 'a'; use constant INVALID_EMAIL => '()[]\;:,<>@webservice.test'; sub new_login { - return 'created_' . random_string() . '@webservice.test'; + return 'created_' . random_string(@_) . '@webservice.test'; } sub post_success { @@ -75,6 +75,12 @@ foreach my $rpc ($jsonrpc, $xmlrpc) { error => "didn't pass our syntax checking", test => 'Invalid email address fails', }, + { user => 'admin', + args => { email => new_login(128), full_name => NEW_FULLNAME, + password => NEW_PASSWORD }, + error => "didn't pass our syntax checking", + test => 'Too long (> 127 chars) email address fails', + }, { user => 'admin', args => { email => $config->{unprivileged_user_login}, full_name => NEW_FULLNAME, password => NEW_PASSWORD }, -- cgit v1.2.3-24-g4f1b