BEGIN { use_ok(
'Text::XmlMatch'
); }
my
$results
;
my
$keyCount
;
my
$matcher
= Text::XmlMatch->new(
'extras/EHConfig.xml'
);
$results
=
$matcher
->findMatch(
'03599-1751-1-a-t.asd.ph-RH'
);
if
(
$results
->{
'Nashville-RDC_SERVICE-asd'
} eq
'datacenter'
) {
pass(
'Nashville-RDC_SERVICE-asd Detection'
);
}
else
{
fail(
'Nashville-RDC_SERVICE-asd Detection'
);
}
for
(
$keyCount
=0;
$keyCount
< (
keys
%$results
);
$keyCount
++) {}
if
(
$keyCount
== 1) {
pass(
'Unique matches for ASD'
);
}
else
{
fail(
"Unique matches for ASD - $keyCount"
);
}
$results
=
$matcher
->findMatch(
'msod870-1750-1-p-h.mso.na-RH'
);
if
(
$results
->{
'Nashville-RDC_SERVICE-mso'
} eq
'datacenter'
) {
pass(
'MSO Detection'
);
}
else
{
fail(
'MSO Detection'
);
}
for
(
$keyCount
=0;
$keyCount
< (
keys
%$results
);
$keyCount
++) {}
if
(
$keyCount
== 1) {
pass(
'Unique matches for MSO'
);
}
else
{
fail(
"Unique matches for MSO - $keyCount"
);
}
$results
=
$matcher
->findMatch(
'nasun-7204-1-b-d.sun.na-FastEthernet1/0.1-ISLvLANsubif'
);
if
(
$results
->{
'FortWorth-RDC'
} eq
'datacenter'
) {
pass(
'DisasterDC/Disaster Recovery Detection'
);
}
else
{
fail(
'DisasterDC/Disaster Detection'
);
}
for
(
$keyCount
=0;
$keyCount
< (
keys
%$results
);
$keyCount
++) {}
if
(
$keyCount
== 1) {
pass(
'Unique matches for DisasterDC/Disaster'
);
}
else
{
fail(
"Unique matches for DisasterDC/Disaster - $keyCount"
);
}
my
$facilityMatch
= Text::XmlMatch->new(
'extras/facilityConfig.xml'
);