chaos: Enable port forwarding to webdriver instances.

Precondition: This required adding testing_rsa keys to all VMs.

BUG=None
TEST=Ran network_WiFi_ChaosConnectDisconnect; could establish driver connection

Change-Id: I27eb1cfb0dd29dc345bbac4536fe50bde2777044
Reviewed-on: https://chromium-review.googlesource.com/343154
Commit-Ready: Tien Chang <tienchang@chromium.org>
Tested-by: Tien Chang <tienchang@chromium.org>
Reviewed-by: Kris Rambish <krisr@chromium.org>
diff --git a/server/cros/network/chaos_clique_utils.py b/server/cros/network/chaos_clique_utils.py
index 33ebfbd..3fe5af7 100644
--- a/server/cros/network/chaos_clique_utils.py
+++ b/server/cros/network/chaos_clique_utils.py
@@ -1,4 +1,4 @@
-# Copyright 2015 The Chromium OS Authors. All rights reserved.
+# Copyright 2016 The Chromium OS Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
@@ -47,14 +47,14 @@
 
     @param lock_manager HostLockManager object.
 
-    @return string hostname of locked webdriver instance
+    @return An SSHHost object representing a locked webdriver instance.
     """
     afe = frontend.AFE(debug=True,
                        server=site_utils.get_global_afe_hostname())
-    webdriver_hostname = site_utils.lock_host_with_labels(afe, lock_manager,
-                                    labels=['webdriver'])
-    if webdriver_hostname is not None:
-        return webdriver_hostname
+    webdriver_host = hosts.SSHHost(site_utils.lock_host_with_labels(
+                        afe, lock_manager, labels=['webdriver']))
+    if webdriver_host is not None:
+        return webdriver_host
     logging.error("Unable to allocate VM instance")
     return None
 
@@ -66,8 +66,8 @@
     @param instance: locked webdriver instance
 
     """
-    logging.debug('Powering on %s VM', instance)
-    power_on_cmd = 'VBoxManage startvm %s' % instance
+    logging.debug('Powering on %s VM', instance.hostname)
+    power_on_cmd = 'VBoxManage startvm %s' % instance.hostname
     master.run(power_on_cmd)
 
 
@@ -78,8 +78,8 @@
     @param instance: locked webdriver instance
 
     """
-    logging.debug('Powering off %s VM', instance)
-    power_off_cmd = 'VBoxManage controlvm %s poweroff' % instance
+    logging.debug('Powering off %s VM', instance.hostname)
+    power_off_cmd = 'VBoxManage controlvm %s poweroff' % instance.hostname
     master.run(power_off_cmd)