Skip to content

Commit

Permalink
make wlan interface name generic
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Apr 11, 2018
1 parent 6dbd8c9 commit ea1c1dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/automated/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ def _connect_wifi(dongle_id, pw, insecure_okay=False):
if sys.platform == "darwin":
os.system("networksetup -setairportnetwork en0 %s %s" % (ssid, pw))
else:
wlan_interface = subprocess.check_output(["sh", "-c", "iw dev | awk '/Interface/ {print $2}'"]).strip()
cnt = 0
MAX_TRIES = 10
while cnt < MAX_TRIES:
print "WIFI: scanning %d" % cnt
if os.system("ifconfig | grep wlp3s0") == 0:
os.system("sudo iwlist wlp3s0 scanning > /dev/null")
os.system("sudo iwlist %s scanning > /dev/null" % wlan_interface)
os.system("nmcli device wifi rescan")
wifi_scan = filter(lambda x: ssid in x, subprocess.check_output(["nmcli","dev", "wifi", "list"]).split("\n"))
if len(wifi_scan) != 0:
Expand Down

0 comments on commit ea1c1dc

Please sign in to comment.