uprichard
Programmer
- May 2, 2002
- 16
I am automating testing of a Network Load Balancing product.
Part of the script needs to get a page from a Virtual IP address that has been setup. Everything is fine if the IP got setup correctly but if not the following bit of code take 15 minutes to execute on my Linux box, which is way to long.
Any one have any idea how I can get it to return quicker? I tried setting a timeout on the LWP::UserAgent->new() but that did not help.
I have no problems replacing the code with something completely different if that will help.
use HTTP::Request;
use LWP::UserAgent;
my ($rc, $req, $ua);
$ua = LWP::UserAgent->new();
$req = HTTP::Request->new('GET', " $command_out=$ua->request($req)->as_string();
$rc=0 if $ua->request($req)->is_success() ;
$rc=1 if $ua->request($req)->is_info() ;
$rc=2 if $ua->request($req)->is_redirect() ;
$rc=3 if $ua->request($req)->is_error() ;
print "C = $command_out\n";
print "RC= $rc\n";
Part of the script needs to get a page from a Virtual IP address that has been setup. Everything is fine if the IP got setup correctly but if not the following bit of code take 15 minutes to execute on my Linux box, which is way to long.
Any one have any idea how I can get it to return quicker? I tried setting a timeout on the LWP::UserAgent->new() but that did not help.
I have no problems replacing the code with something completely different if that will help.
use HTTP::Request;
use LWP::UserAgent;
my ($rc, $req, $ua);
$ua = LWP::UserAgent->new();
$req = HTTP::Request->new('GET', " $command_out=$ua->request($req)->as_string();
$rc=0 if $ua->request($req)->is_success() ;
$rc=1 if $ua->request($req)->is_info() ;
$rc=2 if $ua->request($req)->is_redirect() ;
$rc=3 if $ua->request($req)->is_error() ;
print "C = $command_out\n";
print "RC= $rc\n";