summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-01-12 18:16:37 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-01-12 18:16:37 -0800
commitc368665647b9ac72efc161c6e291cba8c3674628 (patch)
tree8bb0073da537f2ecd41ebcb17ddc1b04d16de738 /tests
parentab1ede4439fa63a44de6b2e0db5e6df5ba495df1 (diff)
downloadvyatta-cfg-c368665647b9ac72efc161c6e291cba8c3674628.tar.gz
vyatta-cfg-c368665647b9ac72efc161c6e291cba8c3674628.zip
Better version of getIPadresses and getInterfacesdebian/0.14.2
Use new Vyatta::Interface and sysfs to avoid using ifconfig and ip command unnecessarily.
Diffstat (limited to 'tests')
-rw-r--r--tests/interface.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/interface.pl b/tests/interface.pl
index 989d6c5..eaa295f 100644
--- a/tests/interface.pl
+++ b/tests/interface.pl
@@ -7,8 +7,12 @@
use strict;
use warnings;
use Vyatta::Interface;
+use Vyatta::Misc qw(getInterfaces getInterfacesIPadresses);
-foreach my $arg (@ARGV) {
+my @ips = getInterfacesIPadresses('all');
+print "IP addresses = ",join(' ',@ips), "\n";
+
+foreach my $arg (getInterfaces()) {
print "$arg : ";
my $intf = new Vyatta::Interface($arg);