Commit b7a39ad2 authored by Andrew Leech's avatar Andrew Leech Committed by Damien George

tests/run-multitests.py: Read IP address from boot nic if available.

This works if your network is pre-configured in boot.py as an object called
"nic".  Without this, multitests expects to access the WLAN/LAN class which
isn't always correct.
Signed-off-by: default avatarAndrew Leech <andrew@alelec.net>
parent 73a1ea88
......@@ -63,13 +63,16 @@ class multitest:
@staticmethod
def get_network_ip():
try:
import network
if hasattr(network, "WLAN"):
ip = network.WLAN().ifconfig()[0]
else:
ip = network.LAN().ifconfig()[0]
ip = nic.ifconfig()[0]
except:
ip = HOST_IP
try:
import network
if hasattr(network, "WLAN"):
ip = network.WLAN().ifconfig()[0]
else:
ip = network.LAN().ifconfig()[0]
except:
ip = HOST_IP
return ip
{}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment