def test_s0i3_resume_bt_transfer(self): print "[RunTest]: %s" % self.__str__() self.bt.switch_bt("ON") time.sleep(5) assert S0i3().suspend_resume(retry=2), "Not enter S3" time.sleep(5) self.bt_transfer()
def test_enter_s0i3_aosp_camera(self): if self.camera.get_build_version() == O_MR1: self.camera.launch() elif self.camera.get_build_version() == O_MR0: assert False, "Not applicable for this platform" enter_s3 = S0i3().suspend_resume(retry=2) assert enter_s3, "Not enter S0i3"
def setUp(self): self._test_name = __name__ print print "[Setup]: %s" % self._test_name self.s0i3 = S0i3() self.s0i3.adb_root() self.s0i3.unlock_screen()
def setUp(self): self._test_name = __name__ self.s0i3 = S0i3() self.s0i3.adb_root() self.s0i3.set_screen_status("on") self.s0i3.unlock_screen() print "[Setup]: %s" % self._test_name self.thermal = Thermal()
def setUp(self): self._test_name = __name__ print "[Setup]: %s" % self._test_name self.s0i3 = S0i3() self.s0i3.adb_root() self.s0i3.set_screen_status("on") self.s0i3.unlock_screen() #g_common_obj.close_background_apps() super(AutomotivePowerStates, self).setUp()
def check_s0i3_browser(self, url, data_type=None): #WifiSetting().connect_wifi_by_conf("wifi_adb") WifiSetting().switch_wifi("off") self.browser.open_url(url) #if data_type == "audio": # self.browser.play_audio_browser() #elif data_type == "video": # self.browser.play_video_browser() enter_s3 = S0i3().check_enter_s0i3_state() assert enter_s3, "Not enter S0i3 state"
def test_s0i3_resume_mtp_transfer(self): assert S0i3().suspend_resume(retry=2), "Not enter S3" self.s0i3.adb_usb() time.sleep(5) if self.s0i3.get_build_version() == O_MR1: from testlib.em.settings import DeveloperSetting self.dev = DeveloperSetting() self.dev.select_usb_option("MTP") else: self.s0i3.select_usb_option("MTP") mount_status = mount_mtp() assert mount_status
def test_s0i3_resume_ptp_transfer(self): enter_s3 = S0i3().suspend_resume(retry=2) assert enter_s3 self.s0i3.adb_usb() time.sleep(5) if self.s0i3.get_build_version() == O_MR1: from testlib.em.settings import DeveloperSetting self.dev = DeveloperSetting() self.dev.select_usb_option("PTP") else: self.s0i3.select_usb_option("PTP") photo = "Pictures/1.png" self.s0i3.testDevice.adb_cmd("screencap -p /sdcard/%s" % photo) ser = self.s0i3.get_serialno() ptp_mount_dir = get_ptp_mount_dir(ser) photo_on_host = os.path.join(ptp_mount_dir, photo) print photo_on_host assert os.path.isfile(photo_on_host)
def active_idle_monitor_sleep(self, sleep_time): from testlib.em.s0i3 import S0i3 max_freq = self.uibase.ivi_get_cpu_freq(0, "cpuinfo_max_freq") S0i3().suspend_resume(sleep_time=sleep_time, retry=1) cpus = self.uibase.get_cpus() check_num = 10 freq_sum = 0 for i in range(check_num): freqs = self.uibase.ivi_get_cpus_freq(cpus) print freqs freq_sum += sum(freqs) time.sleep(3) freq_rate = float(freq_sum) / (max_freq * len(cpus) * check_num) print "CPU usage:", freq_rate if len(cpus) < 4: high_rate = 0.9 else: high_rate = 0.7 assert freq_rate <= high_rate, "CPU freq too high when idle"
def test_s0i3_resume_bt_on(self): print "[RunTest]: %s" % self.__str__() self.bt.switch_bt("ON") time.sleep(5) assert S0i3().suspend_resume(retry=2), "Not enter S3" assert self.bt.get_bt_status(), "BT is OFF"
def test_s0i3_bt_transfer(self): print "[RunTest]: %s" % self.__str__() self.bt_transfer() assert S0i3().suspend_resume(retry=2), "Not enter S3"
def setUp(self): self._test_name = __name__ print "[Setup]: %s" % self._test_name self.s0i3 = S0i3() self.s0i3.adb_root() super(S0i3PTP, self).setUp()