Use consistent return values and provide default initalizations

Add inital versions of Layer 2 test classes
This commit is contained in:
Eric A. Miller
2018-04-05 23:28:57 -04:00
parent ce0a350ef2
commit 0371ca35d6
18 changed files with 1469 additions and 10 deletions

View File

@@ -70,7 +70,7 @@ $VERSION = '3.54';
sub i_physical {
my $cat = shift;
my $p_port = $cat->p_port();
my $p_port = $cat->p_port() || {};
my %i_physical;
foreach my $port ( keys %$p_port ) {
@@ -104,8 +104,8 @@ sub os_ver {
# Workaround for incomplete bp_index
sub bp_index {
my $cat = shift;
my $p_index = $cat->p_port();
my $b_index = $cat->p_oidx();
my $p_index = $cat->p_port() || {};
my $b_index = $cat->p_oidx() || {};
my %bp_index;
foreach my $iid ( keys %$p_index ) {