1 # $Id: Ping.pm,v 1.8 2006-07-21 16:49:52 mike Exp $
3 # See the "Main" test package for documentation
5 package ZOOM::IRSpy::Test::Ping;
11 use ZOOM::IRSpy::Test;
13 @ISA = qw(ZOOM::IRSpy::Test);
18 my $irspy = $this->irspy();
19 my $pod = $irspy->pod();
21 $pod->callback(ZOOM::Event::CONNECT, \&connected);
22 $pod->callback("exception", \¬_connected);
23 my $err = $pod->wait($irspy);
29 sub connected { maybe_connected(@_, 1) }
30 sub not_connected { maybe_connected(@_, 0) }
33 my($conn, $irspy, $rs, $event, $ok) = @_;
35 my $rec = $irspy->record($conn);
36 $irspy->log("irspy_test", $conn->option("host"),
37 ($ok ? "" : " not"), " connected");
38 $conn->option(pod_omit => 1) if !$ok;
40 $rec->append_entry("zeerex:serverInfo", "<irspy:probe ok='$ok'>" .
41 isodate(time()) . "</irspy:probe>");
49 my($sec, $min, $hour, $mday, $mon, $year) = localtime($time);
50 return sprintf("%04d-%02d-%02dT%02d:%02d:%02d",
51 $year+1900, $mon+1, $mday, $hour, $min, $sec);