BEGIN { plan
tests
=> 2 };
ok(1);
print
"This test calls GlobalInfo and upon success displays the Audiotron's firmware version\n\n"
;
print
"\nEnter the Audiotron's IP address: "
;
my
$ip
= <STDIN>;
chomp
(
$ip
);
print
"\nEnter the Audiotron's Username: "
;
my
$user
= <STDIN>;
chomp
(
$user
);
print
"\nEnter the Audiotron's Password: "
;
my
$pass
= <STDIN>;
chomp
(
$pass
);
print
"\n\nTesting...\n\n"
;
my
$at
= new Device::Audiotron(
$ip
,
$user
,
$pass
);
if
(!
$at
){ok(0);}
my
(
$ref_status
,
$ref_shares
,
$ref_hosts
);
eval
{(
$ref_status
,
$ref_shares
,
$ref_hosts
) =
$at
->GlobalInfo();};
if
($@)
{
warn
(
"Audiotron unit not detected on network!\nCPAN testers have no need to submit test results for this module!\n"
);
ok(1);
}
else
{
print
"\n\nFirmware Version: "
.
$ref_status
->{
"Version"
} .
"\n\n"
;
ok(1);
}