From: Janusz Dziedzic Date: Sun, 12 Jan 2020 22:02:19 +0000 (+0100) Subject: tests: remote: Handle different ifconfig output formats X-Git-Tag: hostap_2_10~1768 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a934fe72a61163448022026feb058484d5f290c;p=thirdparty%2Fhostap.git tests: remote: Handle different ifconfig output formats We could have different ifconfig output formats on the remote devices, so make the parser more flexible to handle such cases. Signed-off-by: Janusz Dziedzic --- diff --git a/tests/remote/rutils.py b/tests/remote/rutils.py index 70ad82c87..0acef42d1 100644 --- a/tests/remote/rutils.py +++ b/tests/remote/rutils.py @@ -239,6 +239,8 @@ def get_ipv6(client, ifname=None): for line in lines: res = line.find("Scope:Link") + if res == -1: + res = line.find("") if res != -1: break @@ -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")