Ask a Question related to PERL Miscellaneous, Design and Development.
-
chris #1
perl code to test my C based CGI application
Already tried cgi newsgroup to no avail.
I'm a Perl begginner, and it's starting to look like Perl is the best
way to do this. I have a C based CGI executable that receives a single
arguement via HTTP POST method as follows:
<form method="POST" action="http://mypc-01/scripts/MyCGI.exe"
name="postToCGI">
I'd like to load test it by creating a Perl script that simply calls
it with same argument over and over and over. How can I do this?
thanks.
chris
chris Guest
-
How to do test for a Flex Application?
Hello all: I'm trying to test a Flex App (a dynamic web project). Other than manual test, could please give me some advice? First I'm supposed... -
Application Center Test with IIS
Please, I would like to stress test my webservice and i thought about Application Center Test, but i got no idea how can i do this. There's a... -
Application Center Test
Hi everybody, I dont know if this is the best place for this question, but could not find any newsgroups for Microsoft's Application Center... -
64 bit Perl memory test...
I have been asked to get a 64bit version of Perl compiled and working under HP-UX 11i. I have found some helpful hints on actually compiling this... -
change cursor code to set based code
INSERT INTO TableA (Col1, Col2...) SELECT Col1,Col2... FROM TableB -- Andrew J. Kelly SQL Server MVP -
David K. Wall #2
Re: perl code to test my C based CGI application
chris <od488gw02@sneakemail.com> wrote:
[a CGI program written in C]See> I'd like to load test it by creating a Perl script that simply
> calls it with same argument over and over and over. How can I do
> this?
perldoc lwpcook
It has examples that should get you started.
David K. Wall Guest
-
Purl Gurl #3
Re: perl code to test my C based CGI application
chris wrote:
Are you a beg-ginner or a beginner?> I'm a Perl begginner, and it's starting to look like Perl is the best
> way to do this. I have a C based CGI executable that receives a single
> arguement via HTTP POST method as follows:
"argument"
> <form method="POST" action="http://mypc-01/scripts/MyCGI.exe" name="postToCGI">[url]http://stein.cshl.org/~lstein/torture/torture.html[/url]> I'd like to load test it by creating a Perl script that simply calls
> it with same argument over and over and over. How can I do this?
Purl Gurl
--
"This is Usenet, not a classroom. Get over it....little boy."
- Elaine Ashton
Purl Gurl Guest
-
chris #4
Re: perl code to test my C based CGI application
Purl Gurl <purlgurl@purlgurl.net> wrote in message news:<3EFB529C.3C9EFFC1@purlgurl.net>...
Spell correcting in a newsgroup? yikes.> chris wrote:
>>> > I'm a Perl begginner, and it's starting to look like Perl is the best
> > way to do this. I have a C based CGI executable that receives a single
> > arguement via HTTP POST method as follows:
> Are you a beg-ginner or a beginner?
>
> "argument"
>
>>> > <form method="POST" action="http://mypc-01/scripts/MyCGI.exe" name="postToCGI">>> > I'd like to load test it by creating a Perl script that simply calls
> > it with same argument over and over and over. How can I do this?
> [url]http://stein.cshl.org/~lstein/torture/torture.html[/url]
>
>
> Purl Gurl
Thanks everyone. I found a nice example by Jason Mathews and modified a bit:
#!/bin/perl
# based on sample script by Jason Mathews 28-March-1996
for ($count=1; $count < 11; $count++)
{
$ENV{'GATEWAY_INTERFACE'} = "CGI/1.1";
$ENV{'SCRIPT_NAME'} = "C:/Inetpub/Scripts/MyCGIUtility.exe";
$ENV{'SERVER_PROTOCOL'} = "HTTP/1.0";
#
# Set all environment variables that are referenced in your
# CGI program. For example, only REQUEST_METHOD, QUERY_STRING,
# and CONTENT_LENGTH are referenced in the dump.cgi program.
################################################## #####################
$| = 1;
# CGI form input
$cgi_input = 'acctid=501020000246';
#
# POST method
#
print "----------------------------------------------------\n";
print "simulating a POST method:\n";
# Setup environment
$ENV{'REQUEST_METHOD'} = "POST";
$ENV{'CONTENT_LENGTH'} = length($cgi_input);
$ENV{'CONTENT_TYPE'} = "application/x-www-form-urlencoded";
open(PIPE, "| MyCGIUtility.exe");
print PIPE $cgi_input;
close(PIPE);
} # end for
chris
chris Guest
-
Eric Schwartz #5
Re: perl code to test my C based CGI application
[email]od488gw02@sneakemail.com[/email] (chris) writes:
<snip>> Thanks everyone. I found a nice example by Jason Mathews and modified a bit:
I guess it depends on what you're testing. What you did will test the
program, but outside its normal execution environment
(Webserver+CGI). You're essentially simulating a CGI environment, and
then testing. This isn't a big problem, but you need to also test it
in a real CGI environment, as you always have the risk that your
simulation isn't necessarily good enough.
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
Eric Schwartz Guest
-
chris #6
Re: perl code to test my C based CGI application
Purl Gurl <purlgurl@purlgurl.net> wrote in message news:<3EFC6C08.A07C140B@purlgurl.net>...
Thanks. I moved all my env vars and flushing outside the loop now.> chris wrote:
>>> > Purl Gurl wrote:> > > chris wrote:>> > > > I'm a Perl begginner, and it's starting to look like Perl is the best
> > > > way to do this. I have a C based CGI executable that receives a single
> > > > arguement via HTTP POST method as follows:>> > > Are you a beg-ginner or a beginner?>> > > "argument">> > Spell correcting in a newsgroup? yikes.
> My presumption is you do not care to improve your spelling skills,
> which is often a reason for poor spelling skills.
>
>>> > > > I'd like to load test it by creating a Perl script that simply calls
> > > > it with same argument over and over and over. How can I do this?>> > > [url]http://stein.cshl.org/~lstein/torture/torture.html[/url]
>>> > I found a nice example by Jason Mathews and modified a bit:
> Yours is a nice example, although inefficient. It does not load
> test your software, however.
>
> A single iteration of your example code is no different than eleven
> iterations. Either your program works right or it doesn't. Your
> efficiency would be greatly improved by moving your environment
> variables outside your looping mechanism; no need to set those
> variables eleven times. Same is true for your $| flushing. This
> only needs to be set once. A simple system() call would be quicker
> than opening a filehandle.
>
> Nice example which could be improved significantly, keeping in
> mind your example does not load test.
>
>
> Purl Gurl
I plan to run this script from 10 different client boxes at the same
time, that will all be hitting the CGI server, so I think it will give
me somehwhat of a load test. I suppose it's more of a performance
test.
chris
chris Guest



Reply With Quote

