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

Unified Diff: telemetry/telemetry/core/cros_interface.py

Issue 2997603002: Try fixing telemetry on CrOS (Closed)
Patch Set: Created 3 years, 4 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 | telemetry/telemetry/core/cros_interface_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/core/cros_interface.py
diff --git a/telemetry/telemetry/core/cros_interface.py b/telemetry/telemetry/core/cros_interface.py
index 1921207d3c9f9e829a5576b115cc6e82b44375a3..e5e4377a2fd36b73babc6fa733ef7e92fc10a65c 100644
--- a/telemetry/telemetry/core/cros_interface.py
+++ b/telemetry/telemetry/core/cros_interface.py
@@ -97,9 +97,6 @@ class CrOSInterface(object):
self._hostname = hostname
self._ssh_port = ssh_port
- # List of ports generated from GetRemotePort() that may not be in use yet.
- self._reserved_ports = []
-
if self.local:
return
@@ -439,25 +436,6 @@ class CrOSInterface(object):
logging.debug("IsServiceRunning(%s)->%s" % (service_name, running))
return running
- def GetRemotePort(self):
- netstat = self.RunCmdOnDevice(['netstat', '-ant'])
- netstat = netstat[0].split('\n')
- ports_in_use = []
-
- for line in netstat[2:]:
- if not line:
- continue
- address_in_use = line.split()[3]
- port_in_use = address_in_use.split(':')[-1]
- ports_in_use.append(int(port_in_use))
-
- ports_in_use.extend(self._reserved_ports)
-
- new_port = sorted(ports_in_use)[-1] + 1
- self._reserved_ports.append(new_port)
-
- return new_port
-
def IsHTTPServerRunningOnPort(self, port):
wget_output = self.RunCmdOnDevice(['wget', 'localhost:%i' % (port), '-T1',
'-t1'])
« no previous file with comments | « no previous file | telemetry/telemetry/core/cros_interface_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698