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

Unified Diff: telemetry/telemetry/core/cros_interface_unittest.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 | « telemetry/telemetry/core/cros_interface.py ('k') | telemetry/telemetry/core/local_server.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/core/cros_interface_unittest.py
diff --git a/telemetry/telemetry/core/cros_interface_unittest.py b/telemetry/telemetry/core/cros_interface_unittest.py
index 268bd52f289d6e9a1c5a2337ebb853f9788b428d..1df0124e9307aed6cb7f531dd02b5dbf1c8c4377 100644
--- a/telemetry/telemetry/core/cros_interface_unittest.py
+++ b/telemetry/telemetry/core/cros_interface_unittest.py
@@ -6,15 +6,12 @@
# actually talking to the device. This would improve our coverage quite
# a bit.
-import socket
import tempfile
import unittest
import mock
from telemetry.core import cros_interface
from telemetry import decorators
-from telemetry.internal import forwarders
-from telemetry.internal.forwarders import cros_forwarder
from telemetry.testing import options_for_unittests
@@ -72,51 +69,6 @@ class CrOSInterfaceTest(unittest.TestCase):
with self._GetCRI() as cri:
self.assertTrue(cri.IsServiceRunning('openssh-server'))
- # TODO(achuith): Fix this test. crbug.com/619767.
- @decorators.Disabled('all')
- def testGetRemotePortAndIsHTTPServerRunningOnPort(self):
- with self._GetCRI() as cri:
- # Create local server.
- sock = socket.socket()
- sock.bind(('', 0))
- port = sock.getsockname()[1]
- sock.listen(0)
-
- # Get remote port and ensure that it was unused.
- remote_port = cri.GetRemotePort()
- self.assertFalse(cri.IsHTTPServerRunningOnPort(remote_port))
-
- # Forward local server's port to remote device's remote_port.
- forwarder = cros_forwarder.CrOsForwarderFactory(cri).Create(
- forwarders.PortPairs(http=forwarders.PortPair(port, remote_port),
- https=None,
- dns=None))
-
- # At this point, remote device should be able to connect to local server.
- self.assertTrue(cri.IsHTTPServerRunningOnPort(remote_port))
-
- # Next remote port shouldn't be the same as remote_port, since remote_port
- # is now in use.
- self.assertTrue(cri.GetRemotePort() != remote_port)
-
- # Close forwarder and local server ports.
- forwarder.Close()
- sock.close()
-
- # Device should no longer be able to connect to remote_port since it is no
- # longer in use.
- self.assertFalse(cri.IsHTTPServerRunningOnPort(remote_port))
-
- @decorators.Enabled('chromeos')
- def testGetRemotePortReservedPorts(self):
- with self._GetCRI() as cri:
- # Should return 2 separate ports even though the first one isn't
- # technically being used yet.
- remote_port_1 = cri.GetRemotePort()
- remote_port_2 = cri.GetRemotePort()
-
- self.assertTrue(remote_port_1 != remote_port_2)
-
# TODO(achuith): Doesn't work in VMs.
@decorators.Disabled('all')
def testTakeScreenshotWithPrefix(self):
« no previous file with comments | « telemetry/telemetry/core/cros_interface.py ('k') | telemetry/telemetry/core/local_server.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698