From f5e621b2c113c45ce661cf5bb27494fce22265a4 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 13 Jan 2009 14:41:13 -0800 Subject: Fix problems with test program Interfaces has changed, so need to change tests. --- tests/interface.pl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/interface.pl b/tests/interface.pl index eaa295f..79f4df4 100644 --- a/tests/interface.pl +++ b/tests/interface.pl @@ -9,10 +9,13 @@ use warnings; use Vyatta::Interface; use Vyatta::Misc qw(getInterfaces getInterfacesIPadresses); +my @interfaces = getInterfaces(); +print "Interfaces: ", join(' ',@interfaces),"\n"; + my @ips = getInterfacesIPadresses('all'); print "IP addresses = ",join(' ',@ips), "\n"; -foreach my $arg (getInterfaces()) { +foreach my $arg (@interfaces) { print "$arg : "; my $intf = new Vyatta::Interface($arg); @@ -32,14 +35,11 @@ foreach my $arg (getInterfaces()) { print "address ", join(' ',@addresses), "\n"; } - foreach my $attr (qw(exists configured disabled using up running)) { + foreach my $attr (qw(exists configured disabled using_dhcp flags up running)) { my $val = $intf->$attr(); - if (defined $val) { - print "\t$attr = $val\n"; - } else { - print "\t$attr is not set\n"; - } + print " $attr=$val" if ($val); } + print "\n"; } exit 0; -- cgit v1.2.3