~mwhudson/lava-dispatcher/trunk

« back to all changes in this revision

Viewing changes to lava_dispatcher/client/base.py

  • Committer: Andy Doan
  • Date: 2012-08-15 14:34:54 UTC
  • mfrom: (370.1.1 lava-dispatcher)
  • Revision ID: andy.doan@linaro.org-20120815143454-63c19tveagzvu0ew
split up disable adb over USB from restart adb

Show diffs side-by-side

added added

removed removed

Lines of Context:
452
452
        self.proc.expect(self.tester_str, timeout=120)
453
453
        #TODO: set up proxy
454
454
 
 
455
        # we are tcp'ish adb fans here...
 
456
        self._disable_adb_over_usb()
 
457
 
455
458
        self._disable_suspend()
456
459
        if self.enable_network_after_boot_android:
457
460
            time.sleep(1)
458
461
            self._enable_network()
 
462
            self._restart_adb_after_netup()
459
463
 
460
 
        self._enable_adb_over_tcpip()
461
464
 
462
465
    def _disable_suspend(self):
463
466
        """ disable the suspend of images.
483
486
        session.run("ifconfig " + self.default_network_interface, timeout=20)
484
487
 
485
488
 
486
 
    def _enable_adb_over_tcpip(self):
487
 
        logging.info("Enable adb over TCPIP")
 
489
    def _restart_adb_after_netup(self):
 
490
        logging.info("Restart adb after netup")
488
491
        session = TesterCommandRunner(self, wait_for_rc=False)
489
 
        session.run('echo 0>/sys/class/android_usb/android0/enable')
490
492
        session.run('setprop service.adb.tcp.port 5555')
491
493
        session.run('stop adbd')
492
494
        session.run('start adbd')
493
495
 
 
496
    def _disable_adb_over_usb(self):
 
497
        logging.info("Disabling adb over USB")
 
498
        session = TesterCommandRunner(self, wait_for_rc=False)
 
499
        session.run('echo 0>/sys/class/android_usb/android0/enable')
 
500
 
494
501
 
495
502
class SerialIO(file):
496
503
    def __init__(self, logfile):