From patchwork Mon Jun 25 19:44:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Doan X-Patchwork-Id: 9615 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 386D223F19 for ; Mon, 25 Jun 2012 19:44:14 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id DD7CFA1881D for ; Mon, 25 Jun 2012 19:44:13 +0000 (UTC) Received: by ggnf1 with SMTP id f1so3465607ggn.11 for ; Mon, 25 Jun 2012 12:44:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=YMXVT1H60vNSuKeac0161kb82+kvKFT4D73rGDEI3O8=; b=XHlnZjs59R4ecpJP717/qh+/NuX5kzw25JzNaggDz/Wvojx0jo9ULyhfCG6r7pV85W s8Bvor3hRdb062/HEz9oRGh8U5vyIZwckNy3P6yhHbT5W7w13YVORMb2rMiWzUpmmPRx I9DS8pwnSbIY+ZNM8LAZnIXxdB7/QDlLW+gtoWeU8So77bHIXaqieJbmHTFXoviD6yMH 0WDJX4QFOkhmTUtQexMbenbKOZVXqxNpnuzEZUFDDhq6Z9kmxF1RIzKjspW8ar9yCIsj w3AaiQngrqXo6/Xbj2pcWj6+fENy5ZIrJY5+IJYFXC4/C9P81Eknu5a8BhzTgV4yUTWF T6JQ== Received: by 10.50.57.167 with SMTP id j7mr9224879igq.53.1340653453161; Mon, 25 Jun 2012 12:44:13 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp58194ibb; Mon, 25 Jun 2012 12:44:12 -0700 (PDT) Received: by 10.216.144.216 with SMTP id n66mr6747105wej.107.1340653452124; Mon, 25 Jun 2012 12:44:12 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id cr7si293567wib.1.2012.06.25.12.44.11 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jun 2012 12:44:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1SjFCl-0004DI-K1 for ; Mon, 25 Jun 2012 19:44:11 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 8D424E01FE for ; Mon, 25 Jun 2012 19:44:11 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dispatcher X-Launchpad-Branch: ~linaro-validation/lava-dispatcher/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 332 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 332: fix android support for fast models Message-Id: <20120625194411.15898.20948.launchpad@ackee.canonical.com> Date: Mon, 25 Jun 2012 19:44:11 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15482"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 35d70952f229c8b5a937cb61369778ab5073fdd8 X-Gm-Message-State: ALoCoQlE515AaLp91XKAo91nQKoQbzGdxkWjRSt98MVD+qvUCoTmA9xMXAaUYvwsOLz2NCUV/6zh Merge authors: Andy Doan (doanac) Related merge proposals: https://code.launchpad.net/~doanac/lava-dispatcher/fm-android-support-rev2/+merge/111638 proposed by: Andy Doan (doanac) review: Approve - Michael Hudson-Doyle (mwhudson) ------------------------------------------------------------ revno: 332 [merge] committer: Andy Doan branch nick: lava-dispatcher timestamp: Mon 2012-06-25 14:43:14 -0500 message: fix android support for fast models modified: lava_dispatcher/client/base.py lava_dispatcher/client/fastmodel.py lava_dispatcher/config.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 === modified file 'lava_dispatcher/client/base.py' --- lava_dispatcher/client/base.py 2012-06-21 22:28:48 +0000 +++ lava_dispatcher/client/base.py 2012-06-25 19:42:56 +0000 @@ -182,18 +182,13 @@ pexpect.run(cmd, timeout=300, logfile=sys.stdout) def get_default_nic_ip(self): - # XXX: IP could be assigned in other way in the validation farm - network_interface = self._client.default_network_interface - ip = None + network_interface = self._client.get_android_adb_interface() try: ip = self._get_default_nic_ip_by_ifconfig(network_interface) except: logging.exception("_get_default_nic_ip_by_ifconfig failed") - pass + return None - if ip is None: - self.get_ip_via_dhcp(network_interface) - ip = self._get_default_nic_ip_by_ifconfig(network_interface) return ip def _get_default_nic_ip_by_ifconfig(self, nic_name): @@ -216,18 +211,11 @@ return match_group[0] return None - def get_ip_via_dhcp(self, nic): - try: - self.run('netcfg %s dhcp' % nic, timeout=60) - except: - logging.exception("netcfg %s dhcp failed" % nic) - raise NetworkError("netcfg %s dhcp exception" % nic) - def wait_until_attached(self): for count in range(3): if self.check_device_state(): return - time.sleep(1) + time.sleep(3) raise NetworkError( "The android device(%s) isn't attached" % self._client.hostname) @@ -314,6 +302,11 @@ def lmc_dev_arg(self): return self.device_option("lmc_dev_arg") + @property + def enable_network_after_boot_android(self): + return self.config.getboolean( + 'enable_network_after_boot_android', True) + @contextlib.contextmanager def tester_session(self): """A session that can be used to run commands booted into the test @@ -427,6 +420,9 @@ # Android stuff + def get_android_adb_interface(self): + return self.default_network_interface + def boot_linaro_android_image(self): """Reboot the system to the test android image.""" self._boot_linaro_android_image() @@ -436,14 +432,14 @@ #TODO: set up proxy self._disable_suspend() - if self.config.get("enable_network_after_boot_android"): + if self.enable_network_after_boot_android: time.sleep(1) self._enable_network() self._enable_adb_over_tcpip() def _disable_suspend(self): - """ disable the suspend of images. + """ disable the suspend of images. this needs wait unitl the home screen displayed""" session = AndroidTesterCommandRunner(self) try: @@ -461,7 +457,8 @@ session.run('sqlite3 /data/data/com.android.providers.settings/databases/settings.db "%s"' % (stay_awake)) ## set stay awake session.run('sqlite3 /data/data/com.android.providers.settings/databases/settings.db "%s"' % (screen_sleep)) ## set sleep to none session.run('sqlite3 /data/data/com.android.providers.settings/databases/settings.db "%s"' % (lockscreen)) ##set lock screen to none - session.run('input keyevent 82') ##unlock the home screen + #unlock the home screen 240: for fastmodels, 120 failed, 180 failed some + session.run('input keyevent 82', timeout=240) session.run('service call power 1 i32 26') ##acquireWakeLock FULL_WAKE_LOCK def _enable_network(self): === modified file 'lava_dispatcher/client/fastmodel.py' --- lava_dispatcher/client/fastmodel.py 2012-06-21 04:13:56 +0000 +++ lava_dispatcher/client/fastmodel.py 2012-06-22 16:18:50 +0000 @@ -60,16 +60,22 @@ os.putenv('ARMLMD_LICENSE_FILE', lic_server) self._sim_proc = None + def get_android_adb_interface(self): + return 'lo' + def _customize_android(self): with image_partition_mounted(self._sd_image, self.DATA_PARTITION) as d: wallpaper = '%s/%s' % (d, self.ANDROID_WALLPAPER) # delete the android active wallpaper as slows things down logging_system('sudo rm -f %s' % wallpaper) - #make sure PS1 is what we expect it to be with image_partition_mounted(self._sd_image, self.SYS_PARTITION) as d: + #make sure PS1 is what we expect it to be logging_system( 'sudo sh -c \'echo "PS1=%s ">> %s/etc/mkshrc\'' % (self.tester_str, d)) + # fast model usermode networking does not support ping + logging_system( + 'sudo sh -c \'echo "alias ping=\\\"echo LAVA-ping override 1 received\\\"">> %s/etc/mkshrc\'' %d) def _customize_ubuntu(self): with image_partition_mounted(self._sd_image, self.root_part) as mntdir: @@ -97,7 +103,8 @@ "-C motherboard.hostbridge.userNetworking=1 " "-C motherboard.mmc.p_mmc_file=%s " "-C coretile.cache_state_modelled=0 " - "-C coretile.cluster0.cpu0.semihosting-enable=1 ") % ( + "-C coretile.cluster0.cpu0.semihosting-enable=1 " + "-C motherboard.hostbridge.userNetPorts='5555=5555'") % ( self._sim_binary, self._axf, self._sd_image) def _boot_linaro_image(self): === modified file 'lava_dispatcher/config.py' --- lava_dispatcher/config.py 2012-03-06 01:49:24 +0000 +++ lava_dispatcher/config.py 2012-06-25 19:42:56 +0000 @@ -89,6 +89,11 @@ def getint(self, key): return self.cp.getint("DEFAULT", key) + def getboolean(self, key, default=True): + try: + return self.cp.getboolean("DEFAULT", key) + except ConfigParser.NoOptionError: + return default def get_config(name, config_dir): return ConfigWrapper(_get_config(name, config_dir), config_dir)