Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1162)

Unified Diff: server/site_wlan_connect.py

Issue 3441029: AP scan on correct wifi interfaces when dumping logs. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/site_wlan_connect.py
diff --git a/server/site_wlan_connect.py b/server/site_wlan_connect.py
index 629e237a38448578c11cbfdda789b119cc61c6ff..80a52709711f6f7fa3fdcd589fb3abdec6081851 100644
--- a/server/site_wlan_connect.py
+++ b/server/site_wlan_connect.py
@@ -159,14 +159,31 @@ def OpenLogs(*logfiles):
return logs
+# Returns the list of the wifi interfaces (e.g. "wlan0") known to flimflam
+def GetWifiInterfaces():
+ interfaces = []
+ device_paths = manager.GetProperties().get("Devices", None)
+ for device_path in device_paths:
+ device = dbus.Interface(
+ bus.get_object("org.chromium.flimflam", device_path),
+ "org.chromium.flimflam.Device")
+ props = device.GetProperties()
+ type = props.get("Type", None)
+ interface = props.get("Interface", None)
+ if type == "wifi":
+ interfaces.append(interface)
+ return interfaces
+
def DumpLogs(logs):
for log in logs:
print>>sys.stderr, "Content of %s during our run:" % log['name']
print>>sys.stderr, " ))) ".join(log['file'].readlines())
- print>>sys.stderr, "iw dev wlan0 scan output: %s" % \
- subprocess.Popen(["iw", "dev", "wlan0", "scan"],
- stdout=subprocess.PIPE).communicate()[0]
+ for interface in GetWifiInterfaces():
+ print>>sys.stderr, "iw dev %s scan output: %s" % \
+ ( interface,
+ subprocess.Popen(["iw", "dev", interface, "scan"],
+ stdout=subprocess.PIPE).communicate()[0])
def ErrExit(code):
try:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698