[go: up one dir, main page]

File: net_interface_centos7.t

package info (click to toggle)
rex 1.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,800 kB
  • sloc: perl: 30,667; xml: 264; makefile: 8
file content (18 lines) | stat: -rw-r--r-- 706 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use Test::More tests => 6;
use Rex::Hardware::Network::Linux;

my @in = eval { local (@ARGV) = ("t/ip.out_centos7"); <>; };
my $info = Rex::Hardware::Network::Linux::_parse_ip(@in);

is( $info->{lo}->{netmask}, '255.0.0.0', 'loopback netmask' );
is( $info->{lo}->{ip},      '127.0.0.1', 'loopback ip' );

is( $info->{eth0}->{ip},        '10.211.55.171',     'eth0 ip' );
is( $info->{eth0}->{netmask},   '255.255.255.0',     'eth0 netmask' );
is( $info->{eth0}->{broadcast}, '10.211.55.255',     'eth0 broadcast' );
is( $info->{eth0}->{mac},       '00:1c:42:fe:5a:b5', 'eth0 mac' );

@in = eval { local (@ARGV) = ("t/ip.out_centos7_alias"); <>; };
$info = Rex::Hardware::Network::Linux::_parse_ip(@in);

1;