Cisco-Reconfig
view release on metacpan or search on metacpan
t/indentbug.t view on Meta::CPAN
#!/usr/bin/perl -I. -w
#
# The configuration file in this test is buggy. It's a Cisco
# bug so we'll try to work around it.
#
use Cisco::Reconfig;
use Test;
use Carp qw(verbose);
use Scalar::Util qw(weaken);
my $debugdump = 0;
BEGIN { plan test => 6 };
sub wok
{
my ($a, $b) = @_;
require File::Slurp;
import File::Slurp;
write_file('x', $a);
write_file('y', $b);
return ok($a,$b);
}
my $config = readconfig(\*DATA);
if ($debugdump) {
require Data::XDumper;
require File::Slurp;
File::Slurp::write_file("dumped", join("\n",Data::XDumper::Dump($config)));
exit(0);
}
ok(defined $config);
# -----------------------------------------------------------------
$x = $config->get('controller T1 3/1');
ok($x->subs->text,<<END);
framing esf
clock source internal
linecode b8zs
description to abc
END
# -----------------------------------------------------------------
$x = $config->get('class-map match-all mpls-1');
ok($x->subs->text,<<END);
match mpls experimental topmost 1
END
# -----------------------------------------------------------------
$x = $config->get('class-map match-all mpls-5');
ok($x->subs->text,<<END);
match mpls experimental topmost 5
END
# -----------------------------------------------------------------
$x = $config->get('policy-map OutToP');
ok($x->alltext,<<END);
policy-map OutToP
class mpls-premium+
priority percent 15
class mpls-premium
bandwidth percent 20
random-detect
( run in 1.866 second using v1.01-cache-2.11-cpan-99c4e6809bf )