Bug 10806

Summary: The staff benchmark script does not check authentication failure
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Test SuiteAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: bgkriegel, chris, gmcharlt, kyle, m.de.rooy, tomascohen
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 10806: The staff benchmark script does not check authentication failure.
[SIGNED-OFF] Bug 10806: The staff benchmark script does not check authentication failure.
[PASSED QA] Bug 10806: The staff benchmark script does not check authentication failure.

Description Jonathan Druart 2013-08-30 07:30:57 UTC

    
Comment 1 Jonathan Druart 2013-08-30 07:31:34 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2013-09-21 20:12:23 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2013-09-28 11:14:07 UTC
Is it by intention that benchmark_staff.pl is not executable? 
-rw-rw-r-- 1 katrin katrin 12879 Sep 28 13:06 benchmark_staff.pl
Comment 4 Katrin Fischer 2013-09-28 11:23:37 UTC
It seems I can't get this to work with my locally running Koha. I have tried various variations of localhost and 127.0.0.1 in the URL parameter, maybe someone else can take a look?
Comment 5 Bernardo Gonzalez Kriegel 2013-09-28 12:20:55 UTC
(In reply to Katrin Fischer from comment #4)
> It seems I can't get this to work with my locally running Koha. I have tried
> various variations of localhost and 127.0.0.1 in the URL parameter, maybe
> someone else can take a look?

Just copying my results, I used a real staff URL on port 80

1)
bgkriegel@sentey:~/kohaclone$ perl misc/load_testing/benchmark_staff.pl --steps=1 --url=http://staffdev.local.koha/cgi-bin/koha/ --password="test" --user="test"
Authentication successful
Use of uninitialized value $author in split at misc/load_testing/benchmark_staff.pl line 124.
Use of uninitialized value $author in split at misc/load_testing/benchmark_staff.pl line 124.
--------------
Koha STAFF benchmarking utility
--------------
Benchmarking with 20 occurences of each operation and 30 concurrent sessions
Step 1: staff client main page          13537ms 1.477 pages/sec
Skipping step 2
Skipping step 3
Skipping step 4
Skipping step 5
Skipping step 6
Skipping 'testing all transactions at once'
 (step 0)

2)
bgkriegel@sentey:~/kohaclone$ perl misc/load_testing/benchmark_staff.pl --steps=1 --url=http://staffdev.local.koha/cgi-bin/koha/ --password="badtest" --user="test"
Authentication failure: bad login/password at misc/load_testing/benchmark_staff.pl line 87.

3)
bgkriegel@sentey:~/kohaclone$ perl misc/load_testing/benchmark_staff.pl --steps=1 --url=http://badhost.local.koha/cgi-bin/koha/ --password="test" --user="test"
Authentication failure:
        500 Can't connect to badhost.local.koha:80 (Bad hostname) at misc/load_testing/benchmark_staff.pl line 89.
Comment 6 Katrin Fischer 2013-09-28 15:24:27 UTC
Created attachment 21544 [details] [review]
[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.
Comment 7 Galen Charlton 2013-10-02 15:35:39 UTC
Pushed to master.  Thanks, Jonathan!