diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 372: split up disable adb over USB from restart adb

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

Commit Message

Andy Doan Aug. 15, 2012, 2:38 p.m. UTC
Merge authors:
  Alexander Sack (asac)
Related merge proposals:
  https://code.launchpad.net/~asac/lava-dispatcher/boot_linaro_android_image-refactor/+merge/119494
  proposed by: Alexander Sack (asac)
------------------------------------------------------------
revno: 372 [merge]
committer: Andy Doan <andy.doan@linaro.org>
branch nick: lava-dispatcher
timestamp: Wed 2012-08-15 09:34:54 -0500
message:
  split up disable adb over USB from restart adb
modified:
  lava_dispatcher/client/base.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
diff mbox

Patch

=== modified file 'lava_dispatcher/client/base.py'
--- lava_dispatcher/client/base.py	2012-08-08 22:31:12 +0000
+++ lava_dispatcher/client/base.py	2012-08-15 14:34:54 +0000
@@ -452,12 +452,15 @@ 
         self.proc.expect(self.tester_str, timeout=120)
         #TODO: set up proxy
 
+        # we are tcp'ish adb fans here...
+        self._disable_adb_over_usb()
+
         self._disable_suspend()
         if self.enable_network_after_boot_android:
             time.sleep(1)
             self._enable_network()
+            self._restart_adb_after_netup()
 
-        self._enable_adb_over_tcpip()
 
     def _disable_suspend(self):
         """ disable the suspend of images.
@@ -483,14 +486,18 @@ 
         session.run("ifconfig " + self.default_network_interface, timeout=20)
 
 
-    def _enable_adb_over_tcpip(self):
-        logging.info("Enable adb over TCPIP")
+    def _restart_adb_after_netup(self):
+        logging.info("Restart adb after netup")
         session = TesterCommandRunner(self, wait_for_rc=False)
-        session.run('echo 0>/sys/class/android_usb/android0/enable')
         session.run('setprop service.adb.tcp.port 5555')
         session.run('stop adbd')
         session.run('start adbd')
 
+    def _disable_adb_over_usb(self):
+        logging.info("Disabling adb over USB")
+        session = TesterCommandRunner(self, wait_for_rc=False)
+        session.run('echo 0>/sys/class/android_usb/android0/enable')
+
 
 class SerialIO(file):
     def __init__(self, logfile):