Bugzilla – Attachment 14891 Details for
Bug 8089
Use Koha::Cache everywhere
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[NOT APPLY] perl testing script
test_BZ8089.pl (text/plain), 2.44 KB, created by
Jonathan Druart
on 2013-01-28 14:39:06 UTC
(
hide
)
Description:
[NOT APPLY] perl testing script
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-01-28 14:39:06 UTC
Size:
2.44 KB
patch
obsolete
>#!/usr/bin/perl > ># Copyright 2013 BibLibre ># ># This is free software; you can redistribute it and/or modify it under the ># terms of the GNU General Public License as published by the Free Software ># Foundation; either version 2 of the License, or (at your option) any later ># version. ># ># This is distributed in the hope that it will be useful, but WITHOUT ANY ># WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR ># A PARTICULAR PURPOSE. See the GNU General Public License for more details. ># ># You should have received a copy of the GNU General Public License along with ># Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, ># Suite 330, Boston, MA 02111-1307 USA ># > >use Modern::Perl; >use utf8; >use WWW::Mechanize; >use Data::Dumper; >use XML::Simple; >use Time::Progress; >use Getopt::Long; > >my ( $max, $help ); >GetOptions( > "max:s" => \$max, >); > >$max //= 10; > >my $koha_conf = $ENV{KOHA_CONF}; >my $xml = XMLin($koha_conf); > >use C4::Context; >my $user = $ENV{KOHA_USER} || $xml->{config}->{user}; >my $password = $ENV{KOHA_PASS} || $xml->{config}->{pass}; >my $intranet = $ENV{KOHA_INTRANET_URL}; > >BAIL_OUT("You must set the environment variable KOHA_INTRANET_URL to ". > "point this test to your staff client. If you do not have ". > "KOHA_CONF set, you must also set KOHA_USER and KOHA_PASS for ". > "your username and password") unless $intranet; > >$intranet =~ s#/$##; > >my $agent = WWW::Mechanize->new(); >$agent->get( "$intranet/cgi-bin/koha/mainpage.pl" ); >$agent->form_name('loginform'); >$agent->field( 'password', $password ); >$agent->field( 'userid', $user ); >$agent->field( 'branch', '' ); >$agent->click( '', 'login to staff client' ); > >$agent->get( "$intranet/cgi-bin/koha/mainpage.pl" ); > >my $cumul_time = 0; >for my $i ( 1 .. 5 ) { > print "$i "; > $cumul_time += launch ( "$intranet/cgi-bin/koha/admin/preferences.pl", $max ); >} >print "\n"; >say $cumul_time / 5; > >$cumul_time = 0; >for my $i ( 1 .. 5 ) { > print "$i "; > $cumul_time += launch ( "$intranet/cgi-bin/koha/catalogue/search.pl?q=d", $max ); >} >print "\n"; >say $cumul_time / 5 . " s"; > > >sub launch { > my ( $url, $max ) = @_; > my $p = new Time::Progress; > $p->restart; > > > for my $cpt ( 1 .. $max ) { > my $pid; > next if $pid = fork; > die "fork failed: $!" unless defined $pid; > $agent->get( $url ); > exit; > } > > 1 while (wait() != -1); > $p->stop; > return $p->report("%l"); >}
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 8089
:
9577
|
9580
|
9581
|
9665
|
9666
|
9673
|
10166
|
10167
|
10168
|
11400
|
11401
|
11402
|
12077
|
12078
|
14765
| 14891 |
14893
|
16551