Device-PaloAlto-Firewall
view release on metacpan or search on metacpan
lib/Device/PaloAlto/Firewall/Test.pm view on Meta::CPAN
package Device::PaloAlto::Firewall::Test;
use 5.006;
use strict;
use warnings;
our $VERSION = '0.091'; # VERSION - generated by DZP::OurPkgVersion
use Moose;
use Modern::Perl;
use Carp;
use List::Util qw( any first );
#use List::MoreUtils qw( uniq );
#use Array::Utils qw{ array_minus };
use Params::Validate qw( :all );
use Data::Dumper;
=head1 NAME
Device::PaloAlto::Firewall::Test- Run a suite of tests against Palo Alto firewalls.
=head1 VERSION
version 0.091
=cut
=head1 SYNOPSIS
This module contains a set of methods that run tests against an Palo Alto firewall.
The functions take arguments and return 1 or 0 depending on the current runtime state of the firewall.
These methods should be used in conjunction with the C<ok()> function provided by C<Test::More>.
Multiple '.t' files can be created with tests for each firewall and run using the C<prove> test harness.
use Device::PaloAlto::Firewall;
use Test::More qw{ no_plan };
my $tester = Device::PaloAlto::Firewall->new(uri => 'https://test_firewall.int', username => 'ro_account', password => 'complex_password)->tester();
ok( $tester->environmentals(), "No alarms on the firewall" );
ok( $tester->interfaces_up(interfaces => ['ethernet1/1']), "WAN interface is up");
=cut
has 'firewall' => ( is => 'ro', isa => 'Device::PaloAlto::Firewall', default => sub { });
=head1 SUBROUTINES
=head2 Platform Tests
These methods test platform related aspects of the firewalls.
=head3 version
Takes a C<version> (as a string) and returns 1 if the firewall is running that version of PAN-OS. Returns 0 if it is running a different version.
ok( $fw_test->version(version => '7.1.2'), "Firewall running PAN-OS 7.1.2");
Hotfixes (version suffixed with '-h1', '-h2', etc) are considered equivalent to their base versions.
=cut
sub version {
my $self = shift;
my %args = validate(@_,
{
version => { type => SCALAR },
( run in 0.437 second using v1.01-cache-2.11-cpan-364913b4093 )