devinstall_test: Use as binhost's IP

Avoid a conflict between qemu's networking and the host's IP address
when the latter happens to be in the 10.0.2.* range. The dev_install
requests from the guest to, say, were handled by qemu itself
and not actually passed to the host.

Forcing the guest to send requests to instead will now ensure
that it always points to the host.

Note: existing cros lint errors not fixed

TEST=cros tryjob --swarming novato-release-tryjob
TEST=cros tryjob novato-release-tryjob
TEST=local test on novato image ./devmode-test/ ...

Change-Id: I9d5873a4820c10156f7046e04b348b7561a9befd
Commit-Ready: Nicolas Norvez <>
Tested-by: Nicolas Norvez <>
Reviewed-by: Don Garrett <>
diff --git a/devmode-test/ b/devmode-test/
index a294387..3eb9839 100755
--- a/devmode-test/
+++ b/devmode-test/
@@ -39,6 +39,14 @@
 class DevModeTest(object):
   """Wrapper for dev mode tests."""
+  # qemu hardcodes as the host from the guest's point of view
+  #
+  # When the host's eth0 IP address is also 10.0.2.*, and the guest tries to
+  # access it, the requests will be handled by qemu and never be seen by the
+  # host. Instead, let the guest always connect to
   def __init__(self, image_path, board, binhost):
     """Initializes DevModeTest.
@@ -115,7 +123,8 @@'Starting the devserver.')
       self.devserver = dev_server_wrapper.DevServerWrapper()
-      self.binhost = self.devserver.GetURL(
+      self.binhost = self.devserver.GetDevServerURL(
+          ip=self.HOST_IP_ADDRESS, port=self.devserver.port,
           sub_dir='static/pkgroot/%s/packages' % self.board)'Using binhost %s', self.binhost)
@@ -144,7 +153,8 @@
           ['gmerge', 'gmerge', '--accept_stable', '--usepkg',
-           '--devserver_url', self.devserver.GetURL(),
+           '--devserver_url', self.devserver.GetDevServerURL(
+               ip=self.HOST_IP_ADDRESS, port=self.devserver.port),
            '--board', self.board])
     except (cros_build_lib.RunCommandError,
             remote_access.SSHConnectionError) as e: