X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FTest%2FPing.pm;h=a6d8d5508130acca3ac6b13454c18b5ac24b31a3;hp=a85adc513da7c4b9c86d4cf97688e556a85f752a;hb=cd70eb0ff654ee0efe999a9097d9743ccfb336eb;hpb=0c96fa55a5e2cf8ff545c0f3301584bbf38612a9 diff --git a/lib/ZOOM/IRSpy/Test/Ping.pm b/lib/ZOOM/IRSpy/Test/Ping.pm index a85adc5..a6d8d55 100644 --- a/lib/ZOOM/IRSpy/Test/Ping.pm +++ b/lib/ZOOM/IRSpy/Test/Ping.pm @@ -1,4 +1,3 @@ -# $Id: Ping.pm,v 1.24 2007-05-03 14:43:31 mike Exp $ # See the "Main" test package for documentation @@ -14,14 +13,21 @@ our @ISA = qw(ZOOM::IRSpy::Test); use ZOOM::IRSpy::Utils qw(isodate); use Text::Iconv; -my $conv = new Text::Iconv("LATIN1", "UTF8"); +my $conv = new Text::Iconv("LATIN1", "UTF-8"); sub start { my $class = shift(); my($conn) = @_; - $conn->irspy_connect(undef, {}, + my %options = (); + my $xc = $conn->record()->xpath_context(); + my $user = $xc->find("e:serverInfo/e:authentication/e:user"); + my $password = $xc->find("e:serverInfo/e:authentication/e:password"); + $options{"*user"} = $user if $user; + $options{"*password"} = $password if $password; + + $conn->irspy_connect(undef, \%options, ZOOM::Event::ZEND, \&connected, exception => \¬_connected); } @@ -46,9 +52,11 @@ sub connected { if $conn->option("init_opt_$opt"); } - foreach my $opt (qw(serverImplementationId - serverImplementationName - serverImplementationVersion)) { + my %params = (serverImplementationId => "id", + serverImplementationName => "name", + serverImplementationVersion => "version", + ); + foreach my $opt (keys %params) { my $val = $conn->option($opt); next if !defined $val; # not defined for SRU, for example @@ -73,6 +81,7 @@ sub connected { $val = $maybe; } $conn->record()->store_result($opt, value => $val); + $conn->irspy()->var($params{$opt}, $val); } return ZOOM::IRSpy::Status::TEST_GOOD; @@ -82,7 +91,7 @@ sub connected { sub not_connected { my($conn, $__UNUSED_task, $__UNUSED_udata, $exception) = @_; - $conn->log("irspy_test", "not connected: $exception"); + $conn->log("irspy", "not connected: $exception"); $conn->record()->store_result("probe", ok => 0, errcode => $exception->code(),