Bugzilla – Attachment 21544 Details for
Bug 10806
The staff benchmark script does not check authentication failure
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 10806: The staff benchmark script does not check authentication failure.
PASSED-QA-Bug-10806-The-staff-benchmark-script-doe.patch (text/plain), 2.56 KB, created by
Katrin Fischer
on 2013-09-28 15:24:27 UTC
(
hide
)
Description:
[PASSED QA] Bug 10806: The staff benchmark script does not check authentication failure.
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2013-09-28 15:24:27 UTC
Size:
2.56 KB
patch
obsolete
>From 20dffeb5a6f7cc3e8590214c6ef6abd25be24e5e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 29 Aug 2013 17:49:39 +0200 >Subject: [PATCH] [PASSED QA] Bug 10806: The staff benchmark script does not > check authentication failure. > >Currently, if you launch the script >misc/load_testing/benchmark_staff.pl, it always displays >"Authentication successful" or continue to execute the script even if >nothing is done. > >This patch checks if the url is right and if the authentication is >correctly done. > >Test plan: >Suppose that a correct login/pwd is koha/koha >1/ >perl misc/load_testing/benchmark_staff.pl --steps=1 >--url=http://admin.koha.local/cgi-bin/koha/ >--password="koha" --user="koha" >should produce: > Authentication successful > ... > Step 1 > ... > >2/ >perl misc/load_testing/benchmark_staff.pl --steps=1 >--url=http://admin.koha.local/cgi-bin/koha/ >--password="KOHA" --user="KOHA" >should produce: >Authentication failure: bad login/password > >3/ >perl misc/load_testing/benchmark_staff.pl --steps=1 >--url=http://admin.kobe.local/cgi-bin/koha/ >--password="koha" --user="koha" >should produce: >Authentication failure: > 500 Can't connect to admin.kobe.local:80 (Bad > hostname) > >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Comment: Works as described, detects bad url and user credentials. >No koha-qa errors > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Works as described and gives better error messages. >There are some warnings output when running the script before >and after applying the patch. >--- > misc/load_testing/benchmark_staff.pl | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/misc/load_testing/benchmark_staff.pl b/misc/load_testing/benchmark_staff.pl >index 1d225d9..786b04a 100644 >--- a/misc/load_testing/benchmark_staff.pl >+++ b/misc/load_testing/benchmark_staff.pl >@@ -76,13 +76,17 @@ my $cookie_jar = HTTP::Cookies->new(); > my $cookie; > $ua->cookie_jar($cookie_jar); > my $resp = $ua->post( "$baseurl"."/svc/authentication" , {userid =>$user, password => $password} ); >-if( $resp->is_success ) { >+if( $resp->is_success and $resp->content =~ m|<status>ok</status>| ) { > $cookie_jar->extract_cookies( $resp ); > $cookie = $cookie_jar->as_string; > unless ($short_print) { > print "Authentication successful\n"; > print "Auth:\n $resp->content" if $debug; > } >+} elsif ( $resp->is_success ) { >+ die "Authentication failure: bad login/password"; >+} else { >+ die "Authentication failure: \n\t" . $resp->status_line; > } > > # remove some unnecessary garbage from the cookie >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10806
:
20728
|
21300
| 21544