コード例 #1
0
def main(antutu, antutu3d, tr):
    kill_adb_uiautomator_block()
    if antutu.command_timeout("adb wait-for-device", timeout=10):
        os.system("adb root")
        antutu.check_system_app_package("com.antutu.ABenchMark")
        system_operation.screen_on()
        time.sleep(1)
        system_operation.turn_bluetooth('0')
        system_operation.turn_wifi('0')
        time.sleep(2)

        results = run_test(antutu, antutu3d, tr)
        if not results:
            antutu.logout(antutu.my_func_name(),
                          "Error, run test result get error......")
            return False
        if len(results['total_score']) == 0:
            antutu.logout(
                antutu.my_func_name(),
                "Error, run test result get total score error......")
            return False
        rj = open("%s/result.json" % tr.result_dir, 'w+')
        rj.write(json.dumps(results))
        rj.close()
    else:
        antutu.logout(antutu.my_func_name(),
                      "Timeout to wait for device,device is disconnect.")
        return False

    tr.result(results["total_score"])
    tr.add_attachment(tr.result_dir + "/result.json")
    tr.add_attachment(tr.result_dir + "/result.png")
    tr.save()
    clean_app(antutu, antutu3d)
    return True
コード例 #2
0
    def main(self, tr):
        kill_adb_uiautomator_block()
        try:
            system_operation.screen_on()
            time.sleep(1)
            system_operation.turn_airplane('1')
            system_operation.turn_bluetooth_p('0')
            system_operation.turn_wifi('0')
            system_operation.turn_gps('0')
            system_operation.set_display_time()
        except Exception:
            self.mobile_test.logout(self.mobile_test.my_func_name(),
                                    "Error setup load......")
            return False
        time.sleep(2)
        log_dir = tr.result_dir
        if not os.path.exists(log_dir):
            os.mkdir(log_dir)
        result = self.test_jio(log_dir)
        if not result:
            return False
        else:
            for key, velue in result.items():
                tr.sub_score(key, velue)

        tr.result(result["rr_score"])
        tr.add_attachment(log_dir + "/result.png")
        tr.save()
コード例 #3
0
def set_up(geek):
    try:
        system_operation.turn_wifi('0')
        system_operation.turn_bluetooth('0')
    except Exception, e:
        geek.logout(geek.my_func_name(), "set up error %s" % e)
        return False
コード例 #4
0
 def set_settings(self):
     try:
         system_operation.turn_bluetooth('0')
         system_operation.turn_wifi('0')
     except Exception, e:
         self.video_fps_test.logout(self.video_fps_test.my_func_name(),
                                    "preload setting error: %s" % e)
         return False
コード例 #5
0
 def main(self):
     self.daimler.logout(self.daimler.my_func_name(), '...')
     try:
         system_operation.turn_bluetooth('0')
         system_operation.turn_wifi('0')
     except Exception, e:
         self.daimler.logout(self.daimler.my_func_name(),
                             "Setup Failure. %s" % e)
         return False
コード例 #6
0
def main(tr, panning_fps_test, panning_test):

    kill_adb_uiautomator_block()
    try:
        system_operation.turn_bluetooth('0')
        system_operation.turn_wifi('1')
    except Exception, e:
        panning_test.log.error("exception error :%s !!!!" % e)
        return False
コード例 #7
0
 def set_settings(self):
     try:
         system_operation.turn_bluetooth('0')
         system_operation.turn_wifi('0')
         return True
     except Exception, e:
         self.gallery_test.logout(self.gallery_test.my_func_name(),
                                  "preload setup failed :%s" % e)
         return False
コード例 #8
0
def set_up(log_mes):
    log_mes.info(">>>>>>>>>>Set_up<<<<<<<<<<")
    time.sleep(2)
    try:
        system_operation.turn_wifi(0)
        system_operation.turn_bluetooth(0)
    except Exception, e:
        log_mes.error("excption error :%s" % e)
        return False
コード例 #9
0
 def main(self, tr):
     kill_adb_uiautomator_block()
     system_operation.screen_on()
     time.sleep(1)
     try:
         system_operation.turn_bluetooth('0')
         system_operation.turn_wifi('0')
     except Exception, e:
         self.mobile_test.logout(self.mobile_test.my_func_name(), "preload setup is error %s" % e)
         return False
コード例 #10
0
def set_up(geek):
    try:
        system_operation.set_display_time()
        system_operation.turn_gps('0')
        system_operation.turn_wifi('0')
        system_operation.turn_bluetooth_p('0')
        system_operation.turn_airplane('1')
    except Exception, e:
        geek.logout(geek.my_func_name(), "set up error %s" % e)
        return False
コード例 #11
0
def main(rl, tr):

    rl.logout(rl.my_func_name(), '...')
    kill_adb_uiautomator_block()

    try:
        system_operation.turn_bluetooth('0')
        system_operation.turn_wifi('0')
    except Exception, e:
        rl.logout(rl.my_func_name(), "Setup Failure. %s" % e)
        return False
コード例 #12
0
 def set_settings(self):
     try:
         # system_operation.set_display_time()
         system_operation.turn_airplane('1')
         system_operation.turn_bluetooth_p('0')
         system_operation.turn_wifi('0')
         system_operation.turn_gps('0')
     except Exception, e:
         self.video_fps_test.logout(self.video_fps_test.my_func_name(),
                                    "preload setting error: %s" % e)
         return False
コード例 #13
0
def set_up(log_mes):
    log_mes.info(">>>>>>>>>>Set_up<<<<<<<<<<")
    time.sleep(2)
    try:
        system_operation.turn_wifi(0)
        system_operation.turn_bluetooth_p(0)
        system_operation.turn_gps(0)
        system_operation.turn_airplane(1)
        system_operation.set_display_time()
    except Exception, e:
        log_mes.error("excption error :%s" % e)
        return False
コード例 #14
0
 def main(self):
     self.daimler.logout(self.daimler.my_func_name(), '...')
     try:
         kill_adb_uiautomator_block()
        # system_operation.set_display_time()
         system_operation.turn_airplane('1')
         system_operation.turn_bluetooth_p('0')
         system_operation.turn_wifi('0')
         system_operation.turn_gps('0')
     except Exception, e:
         self.daimler.logout(self.daimler.my_func_name(), "Setup Failure. %s" % e)
         return False
コード例 #15
0
def main(tr, panning_fps_test, panning_test):
    
    kill_adb_uiautomator_block()
    try:
        system_operation.turn_airplane('1')
        system_operation.turn_bluetooth_p('0')
        system_operation.turn_wifi('1')
        system_operation.turn_gps('0')
        system_operation.set_display_time()
    except Exception,e:
        panning_test.log.error("exception error :%s !!!!"%e)
        return False
コード例 #16
0
 def main(self, tr):
     os.system("adb root")
     self.clear_data()
     system_operation.screen_on()
     time.sleep(1)
     try:
         system_operation.turn_bluetooth('0')
         system_operation.turn_wifi('0')
     except Exception, e:
         self.mobile_test.logout(self.mobile_test.my_func_name(),
                                 "failed %s" % e)
         return False
コード例 #17
0
 def main(self, tr):
     kill_adb_uiautomator_block()
     try:
         system_operation.screen_on()
         time.sleep(1)
         system_operation.turn_airplane('1')
         system_operation.turn_bluetooth('0')
         system_operation.turn_wifi('0')
         system_operation.turn_gps('0')
         system_operation.set_display_time()
     except Exception, e:
         self.mobile_test.logout(self.mobile_test.my_func_name(), "Error setup load......")
         return False
コード例 #18
0
def main(andebench, timeout=80):
    tr = TestResult(sys.argv)
    log_dir = tr.result_dir
    if not os.path.exists(log_dir):
        os.mkdir(log_dir)

    try:
        system_operation.turn_wifi('0')
        system_operation.turn_bluetooth('0')
        clear_all(andebench)
    except Exception, e:
        andebench.logout(andebench.my_func_name(), "Setup Failure. %s" % e)
        return False
コード例 #19
0
def set_settings():
    logger.info(">>>>>>Setup settings<<<<<<")
    time.sleep(2)
    kill_adb_uiautomator_block()
    try:
        os.system("adb root")
        system_operation.turn_wifi('0')
        system_operation.turn_bluetooth('0')
        time.sleep(1)
        os.system("adb root")
        time.sleep(2)
    except Exception, e:
        logger.error("set_settings error")
        return False
コード例 #20
0
    def main(self):
       kill_adb_uiautomator_block()
       time.sleep(1)
       try:
           system_operation.turn_bluetooth('0')
           system_operation.turn_wifi('0')
       except Exception:
           return False
        time.sleep(2)

        result = self.run_test()
        if not result:
            return False

        print result
        self.result = result
        return True
コード例 #21
0
    def main(self):
        system_operation.screen_on()
        time.sleep(1)
        try:
            system_operation.turn_bluetooth_p('0')
            system_operation.turn_wifi('0')
            os.system("adb shell input keyevent 26")
            time.sleep(3)
        except Exception:
            return False
        time.sleep(2)

        result = self.run_test()
        if not result:
            return False

        self.result = result
        return True
コード例 #22
0
 def main(self, tr):
     self.mobile_test.logout(self.mobile_test.my_func_name(), '...')
     self.check_corporate()
     time.sleep(2)
     kill_adb_uiautomator_block()
     time.sleep(1)
     system_operation.screen_on()
     time.sleep(1)
     try:
         system_operation.turn_airplane('1')
         system_operation.turn_bluetooth_p('0')
         system_operation.turn_wifi('0')
         system_operation.turn_gps('0')
         system_operation.set_display_time()
     except Exception, e:
         self.mobile_test.logout(self.mobile_test.my_func_name(),
                                 "preload setup is error %s" % e)
         return False
コード例 #23
0
    def main(self):
        kill_adb_uiautomator_block()
        self.mobile_test.check_system_app_package("glbenchmark27.corporate")
        system_operation.screen_on()
        time.sleep(1)
        try:
            system_operation.turn_bluetooth('0')
            system_operation.turn_wifi('0')
        except Exception:
            return False
        time.sleep(2)

        result = self.run_test()
        if not result:
            return False

        self.mobile_test.logout(self.mobile_test.my_func_name(),
                                "Test result is : %s" % result)
        self.result = result
        self.mobile_test.app_uninstall()
        return True
コード例 #24
0
def main(antutu, antutu3d):
    tr = TestResult(sys.argv)
    kill_adb_uiautomator_block()
    if antutu.command_timeout("adb wait-for-device", timeout=10):
        os.system("adb root")
        antutu.check_system_app_package("antutu.ABenchMark")
        system_operation.screen_on()
        time.sleep(1)
        system_operation.turn_airplane('1')
        system_operation.turn_bluetooth('0')
        system_operation.turn_wifi('0')
        system_operation.turn_gps('0')
        time.sleep(2)
        log_dir = tr.result_dir
        if not os.path.exists(log_dir):
            os.mkdir(log_dir)
        results = run_test(log_dir, antutu, antutu3d)
        if not results:
            return False
        if len(results[0]) == 0:
            return False
        else:
            d_result = {'total_score': results[0]}
            if len(results[1]) > 0:
                d_result['marooned_score'] = results[1]
            if len(results[2]) > 0:
                d_result['garden_score'] = results[2]
        rj = open("%sresult.json" % log_dir, 'w+')
        rj.write(json.dumps(d_result))
        rj.close()
    else:
        antutu.logout(antutu.my_func_name(),
                      "Timeout to wait for device,device is disconnect.")
        raise Exception("Device is disconnect...")

    tr.result('Antutu_6_1_4_total_result', results[0], 'score')
    tr.add_attachment(log_dir + "/result.json")
    tr.add_attachment(log_dir + "/result.png")
    tr.save()
    clean_app(antutu, antutu3d)
コード例 #25
0
def main(tr):
    kill_adb_uiautomator_block_old()
    if dmark.command_timeout("adb wait-for-device", timeout=10):
        os.system("adb root")
        time.sleep(1)
        system_operation.screen_on()
        time.sleep(1)
        try:
            system_operation.turn_airplane('1')
            system_operation.turn_bluetooth('0')
            system_operation.turn_wifi('0')
            system_operation.turn_gps('0')
            system_operation.set_display_time()
        except Exception, e:
            dmark.logout(dmark.my_func_name(), 'preload failse %s' % e)
            return False
        time.sleep(2)

        log_dir = os.path.join(tr.result_dir)
        if not os.path.exists(log_dir):
            os.mkdir(log_dir)
        results = run_test(log_dir, tr)
        if not results:
            return False

        d_result = {
            'total_score': results[0],
            'physics_test': results[1],
            'physics_score': results[2],
            'graphics_score': results[3],
            'graphics_test1': results[4],
            'g raphics_test2': results[5]
        }
        rj = open("%sresult.json" % log_dir, 'w+')
        cpu_watt = dmark.ui_operation.watt_operate.get_watt_average()
        if not cpu_watt == False:
            d_result['cpu_watt'] = cpu_watt
        rj.write(json.dumps(d_result))
        rj.close()
コード例 #26
0
def setsystem():
    system_operation.turn_wifi(0)
    system_operation.turn_bluetooth(0)
コード例 #27
0
def setsystem():
    system_operation.turn_airplane(0)
    system_operation.turn_wifi(0)
    system_operation.turn_bluetooth_p(0)
    system_operation.turn_gps(0)