summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2016-10-18 22:16:24 +0200
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>2016-10-20 00:15:49 +0200
commitbb660b564b18e962c4f7221075b5e556d4dc4360 (patch)
tree067a0434075bfe22dd2b09fe12438782f1a63d17 /test
parent8b0fb68e04323248df1208516e8a9293af9859d8 (diff)
Testsuite: Test for existence if 'ip'
Diffstat (limited to 'test')
-rwxr-xr-xtest/runtest5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/runtest b/test/runtest
index 7fe0e5dae..8dca8316b 100755
--- a/test/runtest
+++ b/test/runtest
@@ -3039,9 +3039,8 @@ else
# Find this host's IP addresses - there may be many, of course, but we keep
# one of each type (IPv4 and IPv6).
-open(IFCONFIG, 'ip address|') # show *all*, addresses w/o label
- or open(IFCONFIG, 'ifconfig -a|') # probably skips addresses w/o label
- or die "** Cannot run 'ifconfig' or 'ip address': $!\n";
+open(IFCONFIG, '-|', (grep { -x "$_/ip" } split /:/, $ENV{PATH}) ? 'ip address' : 'ifconfig -a')
+ or die "** Cannot run 'ip address' or 'ifconfig -a'\n";
while (not ($parm_ipv4 and $parm_ipv6) and defined($_ = <IFCONFIG>))
{
if (not $parm_ipv4 and /^\s*inet(?:\saddr)?:?\s?(\d+\.\d+\.\d+\.\d+)(?:\/\d+)\s/i)