[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 590: merge with the branch that support multiple fastmodel intances in one machine

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

Commit Message

Liu Yongqin April 26, 2013, 1:44 a.m.
Merge authors:
  Yongqin Liu (liuyq0307)
Related merge proposals:
  https://code.launchpad.net/~liuyq0307/lava-dispatcher/multiple-fastmoel-instances/+merge/160347
  proposed by: Yongqin Liu (liuyq0307)
  review: Approve - Tyler Baker (tyler-baker)
  review: Needs Fixing - Antonio Terceiro (terceiro)
  https://code.launchpad.net/~liuyq0307/lava-dispatcher/check-adb-at-boot/+merge/155881
  proposed by: Yongqin Liu (liuyq0307)
------------------------------------------------------------
revno: 590 [merge]
committer: Yongqin Liu <yongqin.liu@linaro.org>
branch nick: lava-dispatcher
timestamp: Fri 2013-04-26 09:43:13 +0800
message:
  merge with the branch that support multiple fastmodel intances in one machine
modified:
  lava_dispatcher/client/base.py
  lava_dispatcher/client/targetdevice.py
  lava_dispatcher/config.py
  lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_A15x4-A7x4.conf
  lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_v8.conf


--
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/client/base.py'
--- lava_dispatcher/client/base.py	2013-04-15 16:15:45 +0000
+++ lava_dispatcher/client/base.py	2013-04-23 11:34:45 +0000
@@ -241,7 +241,8 @@ 
         pattern2 = "already connected to (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d{1,5})"
         pattern3 = "unable to connect to"
 
-        cmd = "adb connect %s" % dev_ip
+        adb_port = self._client.config.android_adb_port
+        cmd = "adb connect %s:%s" % (dev_ip, adb_port)
         logging.info("Execute adb command on host: %s" % cmd)
         adb_proc = pexpect.spawn(cmd, timeout=300, logfile=sys.stdout)
         match_id = adb_proc.expect([pattern1, pattern2, pattern3, pexpect.EOF])
@@ -253,7 +254,8 @@ 
 
     def android_adb_over_tcp_disconnect(self):
         dev_ip = self.dev_ip
-        cmd = "adb disconnect %s" % dev_ip
+        adb_port = self._client.config.android_adb_port
+        cmd = "adb disconnect %s:%s" % (dev_ip, adb_port)
         logging.info("Execute adb command on host: %s" % cmd)
         pexpect.run(cmd, timeout=300, logfile=sys.stdout)
 
@@ -507,7 +509,8 @@ 
     def _enable_adb_over_tcp(self):
         logging.info("Enabling ADB over TCP")
         session = AndroidTesterCommandRunner(self)
-        session.run('setprop service.adb.tcp.port 5555')
+        adb_port = self.config.android_adb_port
+        session.run('setprop service.adb.tcp.port %s' % adb_port)
         session.run('stop adbd')
         session.run('start adbd')
 

=== modified file 'lava_dispatcher/client/targetdevice.py'
--- lava_dispatcher/client/targetdevice.py	2013-03-25 20:29:23 +0000
+++ lava_dispatcher/client/targetdevice.py	2013-04-23 09:06:25 +0000
@@ -74,8 +74,9 @@ 
         """Booting android or ubuntu style images don't differ much"""
 
         logging.info('ensuring ADB port is ready')
-        while self.context.run_command("sh -c 'netstat -an | grep 5555.*TIME_WAIT'") == 0:
-            logging.info("waiting for TIME_WAIT 5555 socket to finish")
+        adb_port = self.target_device.config.android_adb_port
+        while self.context.run_command("sh -c 'netstat -an | grep %s.*TIME_WAIT'" % adb_port) == 0:
+            logging.info("waiting for TIME_WAIT %s socket to finish" % adb_port)
             time.sleep(3)
 
         self._boot_linaro_image()

=== modified file 'lava_dispatcher/config.py'
--- lava_dispatcher/config.py	2013-04-22 09:39:22 +0000
+++ lava_dispatcher/config.py	2013-04-23 10:47:45 +0000
@@ -83,6 +83,7 @@ 
     android_disable_suspend = schema.BoolOption(default=True)
     android_adb_over_usb = schema.BoolOption(default=False)
     android_adb_over_tcp = schema.BoolOption(default=True)
+    android_adb_port = schema.StringOption(default="5555")
     android_wait_for_home_screen = schema.BoolOption(default=True)
     android_wait_for_home_screen_activity = schema.StringOption(default="Displayed com.android.launcher/com.android.launcher2.Launcher:")
     android_home_screen_timeout = schema.IntOption(default=1800)

=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_A15x4-A7x4.conf'
--- lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_A15x4-A7x4.conf	2013-01-11 18:25:26 +0000
+++ lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_A15x4-A7x4.conf	2013-04-24 05:15:37 +0000
@@ -19,18 +19,23 @@ 
 
 license_file = 8224@localhost
 sim_bin = /opt/arm/RTSM_A15-A7x14_VE/Linux64_RTSM_VE_Cortex-A15x4-A7x4/RTSM_VE_Cortex-A15x4-A7x4
+android_adb_port = 6555
 
 simulator_version_command = %(sim_bin)s --version | grep "Fast Models" | sed 's/Fast Models \[//' | sed 's/\]//'
 
-simulator_command = sudo -u www-data ARMLMD_LICENSE_FILE="%(license_file)s" %(sim_bin)s -a coretile.cluster0.*={AXF} -C motherboard.mmc.p_mmc_file={IMG} -C motherboard.hostbridge.userNetPorts='5555=5555'
+simulator_command = sudo -u www-data ARMLMD_LICENSE_FILE="%(license_file)s" %(sim_bin)s -a coretile.cluster0.*={AXF} -C motherboard.mmc.p_mmc_file={IMG}
 
 boot_options =
+	motherboard.hostbridge.userNetPorts
 	motherboard.smsc_91c111.enabled
 	motherboard.hostbridge.userNetworking
 	coretile.cache_state_modelled
 	coretile.cluster0.cpu0.semihosting-enable
 	coretile.cluster0.cpu0.semihosting-cmd_line
 
+[motherboard.hostbridge.userNetPorts]
+default="%(android_adb_port)s=%(android_adb_port)s"
+
 [motherboard.smsc_91c111.enabled]
 default = 1
 allowed = 0,1

=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_v8.conf'
--- lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_v8.conf	2013-01-11 17:56:29 +0000
+++ lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_v8.conf	2013-04-23 10:30:27 +0000
@@ -18,6 +18,7 @@ 
 license_file = 8224@localhost
 sim_bin = /opt/arm/RTSMv8_VE/bin/model_shell64
 sim_model = /opt/arm/RTSMv8_VE/models/Linux64_GCC-4.1/RTSM_VE_AEMv8A.so
+android_adb_port = 5555
 
 simulator_version_command = %(sim_bin)s --version | grep "Model Shell" | sed 's/Model Shell //'
 
@@ -39,7 +40,7 @@ 
 	cluster.take_ccfail_undef
 
 [motherboard.hostbridge.userNetPorts]
-default="5555=5555"
+default="%(android_adb_port)s=%(android_adb_port)s"
 
 [motherboard.hostbridge.userNetworking]
 default = 1