diff --git a/t/basic.t b/t/basic.t index e5bed0d..4c515b5 100644 --- a/t/basic.t +++ b/t/basic.t @@ -33,8 +33,11 @@ foreach (@if) { } print @loopback ? 'ok ':'not ok ',4,"\n"; + +my $SKIPPED = ( $^O eq "freebsd" and qx(sysctl security.jail.jailed) =~ m{1} ) ? " # skip FreeBSD jail has no 127.0.0.1" : ""; + my @local = grep {$s->if_addr($_) eq '127.0.0.1'} @loopback; -print @local ? 'ok ': 'not ok ',5,"\n"; +print @local ? 'ok ': 'not ok ',5,"$SKIPPED\n"; diff --git a/t/simple.t b/t/simple.t index e8e1c3e..f682342 100644 --- a/t/simple.t +++ b/t/simple.t @@ -22,12 +22,14 @@ foreach (@if) { } ok($loopback,"loopback device"); -ok($loopback->address eq '127.0.0.1','loopback address'); -ok($loopback->netmask eq '255.0.0.0','loopback netmask'); + +# skip ('FreeBSD jail has no 127.0.0.1') if ( $^O eq "freebsd" and qx(sysctl security.jail.jailed) =~ m{1} ); SKIP: { my $index = $loopback->index; - skip ('index not implemented on this platform',3) unless defined $index; + skip ('index not implemented on this platform',5) unless defined $index; + ok($loopback->address eq '127.0.0.1','loopback address'); + ok($loopback->netmask eq '255.0.0.0','loopback netmask'); ok(defined $index,'loopback index');