def cleanupFoopy(device=None): errcode = checkStalled(device) if errcode == 2: log.error("processes from previous run were detected and cleaned up") elif errcode == 3: pidDir = os.path.join('/builds/', device) errorFile = os.path.join(pidDir, 'error.flg') setFlag(errorFile, "Remote Device Error: process from previous test run present") return RETCODE_KILLSTALLED return RETCODE_SUCCESS
if not dm.fileExists('/system/etc/hosts'): print "restoring /system/etc/hosts file" try: dm.sendCMD(['exec mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system']) data = "127.0.0.1 localhost" dm.verifySendCMD(['push /mnt/sdcard/hosts ' + str(len(data)) + '\r\n', data], newline=False) dm.verifySendCMD(['exec dd if=/mnt/sdcard/hosts of=/system/etc/hosts']) except devicemanager.DMError, e: print "Exception hit while trying to restore /system/etc/hosts: %s" % str(e) setFlag(errorFile, "failed to restore /system/etc/hosts") sys.exit(1) if not dm.fileExists('/system/etc/hosts'): setFlag(errorFile, "failed to restore /system/etc/hosts") sys.exit(1) else: print "successfully restored hosts file, we can test!!!" errcode = checkStalled(os.environ['SUT_NAME']) if errcode > 1: if errcode == 2: print "processes from previous run were detected and cleaned up" elif errocode == 3: setFlag(errorFile, "Remote Device Error: process from previous test run present") sys.exit(2) for p in processNames: if dm.dirExists('/data/data/%s' % p): print dm.uninstallAppAndReboot(p) waitForDevice(dm)
#!/usr/bin/env python import os import sys import site site.addsitedir(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../lib/python")) import sut_lib if __name__ == '__main__': if (len(sys.argv) != 2): print "usage: tegra_checkstalled.py <tegra name>" sys.exit(1) if sut_lib.checkStalled(sys.argv[1]) in (1, 2, 3): sys.exit(0) print "Unknown Error" sys.exit(1)
#!/usr/bin/env python import os import sys import site site.addsitedir( os.path.join(os.path.dirname(os.path.realpath(__file__)), "../lib/python")) import sut_lib if __name__ == '__main__': if (len(sys.argv) != 2): print "usage: tegra_checkstalled.py <tegra name>" sys.exit(1) if sut_lib.checkStalled(sys.argv[1]) in (1, 2, 3): sys.exit(0) print "Unknown Error" sys.exit(1)