1 # $Id: Ping.pm,v 1.11 2006-09-13 16:29:55 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 $irspy->log("irspy_test", $conn->option("host"),
36 ($ok ? "" : " not"), " connected");
37 my $rec = $irspy->record($conn);
38 $rec->append_entry("irspy:status", "<irspy:probe ok='$ok'>" .
39 $irspy->isodate(time()) . "</irspy:probe>");
40 $conn->option(pod_omit => 1) if !$ok;