diff options
| author | Andrew Leech <andrew@alelec.net> | 2022-04-29 22:47:58 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-06-03 14:35:37 +1000 |
| commit | b7a39ad2d19a5be4b5a1a16c184e08be0d602b1a (patch) | |
| tree | 419c4059d3ede32913f14099a51ece118ec10b00 /tests/run-multitests.py | |
| parent | 73a1ea881231e544ae7bc1f2b56064d61ed296e7 (diff) | |
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: Andrew Leech <andrew@alelec.net>
Diffstat (limited to 'tests/run-multitests.py')
| -rwxr-xr-x | tests/run-multitests.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/run-multitests.py b/tests/run-multitests.py index bb3ef185d..d8a4a48fa 100755 --- a/tests/run-multitests.py +++ b/tests/run-multitests.py @@ -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 {} |
