[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 643: Fix for 1205193

Message ID 20130726150324.22835.80614.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Tyler Baker July 26, 2013, 3:03 p.m.
Merge authors:
  Tyler Baker (tyler-baker)
Related merge proposals:
  https://code.launchpad.net/~tyler-baker/lava-dispatcher/fix-for-bug-1205193/+merge/177092
  proposed by: Tyler Baker (tyler-baker)
  review: Approve - Antonio Terceiro (terceiro)
------------------------------------------------------------
revno: 643 [merge]
committer: Tyler Baker <tyler.baker@linaro.org>
branch nick: lava-dispatcher
timestamp: Fri 2013-07-26 08:02:01 -0700
message:
  Fix for 1205193
modified:
  lava_dispatcher/device/k3v2.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription

Patch

=== modified file 'lava_dispatcher/device/k3v2.py'
--- lava_dispatcher/device/k3v2.py	2013-07-16 16:03:23 +0000
+++ lava_dispatcher/device/k3v2.py	2013-07-26 06:11:41 +0000
@@ -37,6 +37,7 @@ 
 
     def __init__(self, context, config):
         super(K3V2Target, self).__init__(context, config)
+        self.proc = None
 
     def deploy_android(self, boot, system, userdata):
 
@@ -62,17 +63,17 @@ 
         # So instead we must flash the boot image, and reboot.
         self.fastboot.enter()
         self.fastboot('reboot')
-        proc = connect_to_serial(self.context)
-        proc.expect(self.context.device_config.master_str, timeout=300)
+        if self.proc is None:
+            self.proc = connect_to_serial(self.context)
+        self.proc.expect(self.context.device_config.master_str, timeout=300)
 
-        # The k3v2 does not yet have adb support, so we do not wait for adb.
-        #self._adb('wait-for-device')
+        self._adb('wait-for-device')
 
         self._booted = True
-        proc.sendline("")  # required to put the adb shell in a reasonable state
-        proc.sendline("export PS1='%s'" % self.deployment_data['TESTER_PS1'])
-        self._runner = self._get_runner(proc)
+        self.proc.sendline("")  # required to put the adb shell in a reasonable state
+        self.proc.sendline("export PS1='%s'" % self.deployment_data['TESTER_PS1'])
+        self._runner = self._get_runner(self.proc)
 
-        return proc
+        return self.proc
 
 target_class = K3V2Target