=== modified file 'lava_dispatcher/client/base.py'
@@ -457,15 +457,7 @@
else:
logging.info("Skip raising exception on the home screen has not displayed for health check jobs")
- stay_awake = "delete from system where name='stay_on_while_plugged_in'; insert into system (name, value) values ('stay_on_while_plugged_in','3');"
- screen_sleep = "delete from system where name='screen_off_timeout'; insert into system (name, value) values ('screen_off_timeout','-1');"
- lockscreen = "delete from secure where name='lockscreen.disabled'; insert into secure (name, value) values ('lockscreen.disabled','1');"
- 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
- #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
+ session.run('/system/bin/disablesuspend.sh')
def _enable_network(self):
session = TesterCommandRunner(self, wait_for_rc=False)
=== modified file 'lava_dispatcher/client/fastmodel.py'
@@ -49,13 +49,15 @@
PORT_PATTERN = 'terminal_0: Listening for serial connection on port (\d+)'
ANDROID_WALLPAPER = 'system/wallpaper_info.xml'
- SYS_PARTITION = 2
+ SYS_PARTITION = 2
DATA_PARTITION = 5
def __init__(self, context, config):
super(LavaFastModelClient, self).__init__(context, config)
self._sim_binary = config.get('simulator_binary', None)
lic_server = config.get('license_server', None)
+ self.git_url_disablesuspend_sh = config.get('git_url_disablesuspend_sh',
+ None)
if not self._sim_binary or not lic_server:
raise RuntimeError("The device type config for this device "
"requires settings for 'simulator_binary' and 'license_server'")
@@ -73,12 +75,20 @@
logging_system('sudo rm -f %s' % wallpaper)
with image_partition_mounted(self._sd_image, self.SYS_PARTITION) as d:
+ script_path = '%s/%s' % (d, '/system/bin/disablesuspend.sh')
+ if self.git_url_disablesuspend_sh:
+ logging_system('sudo wget %s -O %s' % (
+ self.git_url_disablesuspend_sh,
+ script_path))
+ logging_system('sudo chmod +x %s' % script_path)
+ logging_system('sudo chown :2000 %s' % script_path)
+
#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)
+ '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:
@@ -111,7 +121,7 @@
with image_partition_mounted(self._sd_image, self.boot_part) as mntdir:
src = '%s/linux-system-ISW.axf' % mntdir
self._axf = \
- '%s/%s' % (os.path.dirname(self._system),os.path.split(src)[1])
+ '%s/%s' % (os.path.dirname(self._system), os.path.split(src)[1])
shutil.copyfile(src, self._axf)
self._customize_android()
=== modified file 'lava_dispatcher/client/master.py'
@@ -220,7 +220,8 @@
_deploy_tarball_to_board(session, systemtbz2, '/mnt/lava', timeout=600)
if session.has_partition_with_label('userdata') and \
- session.has_partition_with_label('sdcard'):
+ session.has_partition_with_label('sdcard') and \:
+ session.is_file_exist('/mnt/lava/system/etc/vold.fstab'):
# If there is no userdata partition on the sdcard(like iMX and Origen),
# then the sdcard partition will be used as the userdata partition as
# before, and so cannot be used here as the sdcard on android
@@ -229,12 +230,25 @@
"/mnt/sdcard %s /devices/platform/omap/omap_hsmmc.0/"
"mmc_host/mmc0") % sdcard_part_lava
session.run(
- 'sed -i "%s" /mnt/lava/system/etc/vold.fstab' % sed_cmd)
+ 'sed -i "%s" /mnt/lava/system/etc/vold.fstab' % sed_cmd,
+ failok=True)
+
+ script_path = '%s/%s' % ('/mnt/lava', '/system/bin/disablesuspend.sh')
+ if not session.is_file_exist(script_path):
+ git_url = session._client.device_option("git_url_disablesuspend_sh")
+ lava_proxy = session._client.context.lava_proxy
+ session.run("sh -c 'export http_proxy=%s'" % lava_proxy)
+ session.run('wget %s -O %s' % (git_url, script_path))
+ session.run('chmod +x %s' % script_path)
+ session.run('chown :2000 %s' % script_path)
+
session.run(
'sed -i "s/^PS1=.*$/PS1=\'root@linaro: \'/" /mnt/lava/system/etc/mkshrc',
failok=True)
+
session.run('umount /mnt/lava/system')
+
def _purge_linaro_android_sdcard(session):
logging.info("Reformatting Linaro Android sdcard filesystem")
session.run('mkfs.vfat /dev/disk/by-label/sdcard -n sdcard')
@@ -305,8 +319,12 @@
if not label:
return False
- cmd = 'ls /dev/disk/by-label/%s' % label
- rc = self.run(cmd, timeout=2, failok=True)
+ path = '/dev/disk/by-label/%s' % label
+ return self.is_file_exist(path)
+
+ def is_file_exist(self, path):
+ cmd = 'ls %s' % path
+ rc = self.run(cmd, failok=True)
if rc == 0:
return True
return False
=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf'
@@ -113,3 +113,6 @@
# This is for android build where the network is not up by default. 1 or 0
enable_network_after_boot_android = 1
+# the url of disablesusepend.sh script in android git repository
+git_url_disablesuspend_sh = "http://android.git.linaro.org/gitweb?p=device/linaro/common.git;a=blob_plain;f=disablesuspend.sh;hb=refs/heads/linaro-ics"
+
=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel.conf'
@@ -3,3 +3,6 @@
# The license server must also be specified. eg:
#license_server = 8224@192.168.1.10
+
+# the url of disablesusepend.sh script in android git repository
+git_url_disablesuspend_sh = "http://android.git.linaro.org/gitweb?p=device/linaro/common.git;a=blob_plain;f=disablesuspend.sh;hb=refs/heads/linaro-ics"