[PATCH 05/12] tests: remote: handle different ifconfig output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We could have different ifconfig output
here, so handle them also.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@xxxxxxxxx>
---
 tests/remote/rutils.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/remote/rutils.py b/tests/remote/rutils.py
index 5e8a86021..2b093e7c4 100644
--- a/tests/remote/rutils.py
+++ b/tests/remote/rutils.py
@@ -239,8 +239,10 @@ def get_ipv6(client, ifname=None):
 
     for line in lines:
         res = line.find("Scope:Link")
-        if res != -1:
-            break
+        if res == -1:
+            res = line.find("<link>");
+            if res != -1:
+                break
 
     if res != -1:
         words = line.split()
@@ -248,6 +250,8 @@ def get_ipv6(client, ifname=None):
             addr_mask = words[2]
             addr = addr_mask.split("/")
             return addr[0]
+        if words[0] == "inet6":
+            return words[1]
 
     return "unknown"
 
@@ -281,7 +285,7 @@ def get_mac_addr(host, iface=None):
     for word in words:
         if found == 1:
             return word
-        if word == "HWaddr":
+        if word == "HWaddr" or word == "ether":
             found = 1
     raise Exception("Could not find HWaddr")
 
-- 
2.17.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux