コード例 #1
0
ファイル: power_on_off.py プロジェクト: zenghui0-0/tempfile
 def set_mixedmode(self, status):
     from testlib.em.settings import AirplaneModeSetting, WifiSetting, \
         BTSetting, LocationSetting
     AirplaneModeSetting().switch_airplane(status)
     WifiSetting().switch_wifi(status)
     BTSetting().switch_bt(status)
     LocationSetting().switch_GPS(status)
コード例 #2
0
    def test_suspend_resume_50_times(self):
        cycles = 50
        self.bt = BTSetting()
        self.wifi = WifiSetting()
        self.camera = Camera()
        self.music = CleanMusic()
        self.camera.grant_permissions()
        self.music.install()
        self.music.grant_permissions()
        music_file = self.music.push_artifactory_resource(
            "long_music", "/mnt/sdcard/Music")

        alias = self.bt.get_host_alias()
        self.bt.host_setup()
        self.bt.switch_bt("ON")
        self.bt.bt_search(alias)
        self.bt.bt_pair(alias)
        self.wifi.connect_wifi_by_conf("wifisetting")
        assert self.wifi.check_wifi_connect()
        for i in range(1, 1 + cycles):
            print "Cycle: %s/%s" % (i, cycles)
            assert self.s0i3.suspend_resume(sleep_time=120,
                                            retry=1), "Not enter S0i3"
            time.sleep(100)
            assert self.bt.get_bt_status(), "BT is OFF"
            assert self.bt.get_paired_status(alias), "BT is not paired"
            assert self.wifi.check_wifi_connect(), "WiFi is not connected"
            if self.s0i3.get_product() == BXT_M:
                self.camera.launch()
                self.camera.click_shutter_button()
            self.music.play_audio("file://" + music_file)
            time.sleep(200)
コード例 #3
0
 def test_get_location_after_resume(self):
     from testlib.em.settings import WifiSetting
     from testlib.em.apps import GeoLocation
     from testlib.em.settings import LocationSetting
     from testlib.em.tools import get_geo_location
     ls = LocationSetting()
     ls.switch_GPS("ON")
     ls.set_mode("High accuracy")
     actual_location = get_geo_location()
     geo = GeoLocation()
     geo.install()
     geo.grant_permissions()
     wifi = WifiSetting()
     wifi.connect_wifi_by_conf("wifisetting")
     assert wifi.check_wifi_connect()
     enter_s3 = self.s0i3.suspend_resume(retry = 2)
     assert enter_s3
     location = geo.get_latitude_longitude()
     if location:
         diff_lati = abs(actual_location[0] - location[0])
         diff_long = abs(actual_location[1] - location[1])
         assert diff_lati < 0.1
         assert diff_long < 0.1
     else:
         assert False, "Can not get location info"
コード例 #4
0
ファイル: system_resume.py プロジェクト: zenghui0-0/tempfile
 def test_system_resume_wifi_on(self):
     print "[RunTest]: %s" % self.__str__()
     from testlib.em.settings import WifiSetting
     wifi = WifiSetting()
     wifi.switch_wifi("ON")
     stat_inc = self.s0ix.suspend_resume()
     assert stat_inc > 0, "Not enter S3"
     assert wifi.get_wifi_status()
コード例 #5
0
ファイル: thermal_check.py プロジェクト: zenghui0-0/tempfile
 def test_thermal_30min_idle(self):
     """
     Thermal check Idle 30 minutes
     """
     print "[RunTest]: %s" % self.__str__()
     from testlib.em.settings import WifiSetting
     WifiSetting().switch_wifi("ON")
     time.sleep(1800)
     self.check_thermal()
コード例 #6
0
 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"
コード例 #7
0
    def test_ivi_thermal_video_streaming(self):
        print "[RunTest]: %s" % self.__str__()
        from testlib.em.apps import VideoPlayer
        from testlib.em.settings import WifiSetting
        WifiSetting().connect_wifi_by_conf("wifi_adb")
        self.player = VideoPlayer()
        self.ivi_capture_thermal_data()
        video_url = "http://" + get_server_ip() + get_config_value(
            "webpage", "video_streaming")

        self.player.play_http_video(video_url)
        self.verify_thermal_in_scenarial("Video_streaming")
コード例 #8
0
 def test_enter_s0i3_wifi_bt_gps_on(self):
     from testlib.em.settings import WifiSetting, BTSetting, LocationSetting
     wifi = WifiSetting()
     bt = BTSetting()
     gps = LocationSetting()
     wifi.switch_wifi("ON")
     bt.switch_bt("ON")
     gps.switch_GPS("ON")
     time.sleep(2)
     stat_inc = self.s0ix.suspend_resume()
     bt.switch_bt("OFF")
     gps.switch_GPS("OFF")
     assert stat_inc > 0, "Not enter S3"
コード例 #9
0
ファイル: power_on_off.py プロジェクト: zenghui0-0/tempfile
 def test_power_off_downloadingfrombrowser(self):
     from testlib.em.apps import EMToolsDownload
     from testlib.em.tools import get_server_ip, get_config_value
     from testlib.em.settings import WifiSetting
     url = "http://" + get_server_ip() + get_config_value(
         "webpage", "big_file")
     # connect wifi
     wifi = WifiSetting()
     wifi.connect_wifi_by_conf("wifi_adb")
     em = EMToolsDownload()
     em.install()
     em.grant_permissions()
     em.download_file(url)
     time.sleep(5)
     assert em.get_download_file_status()
     self.common_reboot()
コード例 #10
0
ファイル: garage.py プロジェクト: zenghui0-0/tempfile
 def setUp(self):
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     #self.relay = get_relay_obj()
     self.s0ix = get_s0ix_obj()
     self.serverip = get_server_ip()
     assert self.serverip != ""
     self.garage = GarageModeTest()
     self.garage.adb_root()
     self.garage.install()
     self.garage.clean_download_folder()
     self.garage.grant_permissions()
     self.wifi = WifiSetting()
     self.wifi.connect_wifi_by_conf("wifi_adb")
     assert self.wifi.check_wifi_connect()
     self.ds = DateSetting()
     self.ds.set_property()
     super(Garage, self).setUp()
コード例 #11
0
 def connect_wifi(self):
     wifi = WifiSetting()
     wifi.connect_wifi_by_conf("wifi_adb")
     assert wifi.check_wifi_connect()