def setUpClass(self):
     print "[setUpClass]: %s" % self.__name__
     super(HDMITest, self).setUpClass()
     self.photosImpl = get_photo_implement()
     self.d = g_common_obj.get_device()
     g_common_obj.root_on_device()
     g_common_obj.remount_device()
Esempio n. 2
0
 def _check_dependency(self):
     g_common_obj.root_on_device()
     g_common_obj.remount_device()
     g_common_obj.adb_cmd_capture_msg("logcat -G 16M")
     g_common_obj.adb_cmd_capture_msg("logcat -c")
     selection = {
         'L': 'apk_l',
         'M': 'apk_m',
         'N': 'apk_n',
         'O': 'apk_o',
         'P': 'apk_p'
     }
     if not pkgmgr.query_package_name(self.package_name):
         try:
             file_path = environment_utils.get_resource_file(
                 'tests.common.dEQP.conf', 'dEQP', selection[self.os_ver])
             pkgmgr.apk_install(file_path)
         except KeyError as e:
             print("DEQP app version not match with android os: %s" %
                   str(e))
         # Need to update above when new version is released.
     for i in self._mustpass_list:
         op = g_common_obj.adb_cmd_capture_msg('ls %s%s' %
                                               (self._mustpass_path, i))
         if 'No such file' in op or op == '':
             file_path = environment_utils.get_resource_file(
                 'tests.common.dEQP.conf', 'dEQP',
                 i.split('-')[0] + '_mustpass')
             if not g_common_obj.push_file(file_path, self._mustpass_path):
                 raise Exception(
                     "Fail to push must pass list, please use script to get resource before test."
                 )
Esempio n. 3
0
    def setUp(self):
        """
        @summary: set up
        @return: None
        """
        super(CameraTest, self).setUp()
        self._test_name = __name__
        self.logger.debug("[Setup]: %s" % self._test_name)

        g_common_obj.root_on_device()
        g_common_obj.remount_device()
        self.camera_common = CameraCommon()
        self.host_path = self.camera_common.getTmpDir()
        self.camera_common.removeDeivceFile()
        self.camera_common.removeFile(self.host_path + "/*")
        self.multimedia_setting = MultiMediaSetting(self.camera_common.DEFAULT_CONFIG_FILE)
        self.multimedia_scale_test_helper = MultiMediaScaleTestHelper(self.host_path)
        self.aosp_camera = AOSPCamera()
        self.aosp_camera.cleanMediaFiles()

        self.multimedia_scale_test_helper.remount_device()
        self.multimedia_scale_test_helper.backup_file("o_image_media_xml_file_dst_path")
        self.multimedia_scale_test_helper.replace_file("o_image_media_xml_file_src_path", "o_image_media_xml_file_dst_path")
        self.multimedia_scale_test_helper.backup_file("o_image_camera3_xml_file_dst_path")[0]
        self.multimedia_scale_test_helper.restore_file("o_image_camera3_xml_file_dst_path", "_hdmi")
        adb32._adb_reboot()
Esempio n. 4
0
 def setUpClass(self):
     """
     install conformance test tool
     """
     super(RundEQP, self).setUpClass()
     if g_common_obj.adb_cmd_capture_msg("ps | grep adbd")[0:4] != "root":
         g_common_obj.root_on_device()
Esempio n. 5
0
 def setUpClass(cls):
     super(VehicleTestBase, cls).setUpClass()
     cls.d = g_common_obj.get_device()
     g_common_obj.root_on_device()
     g_common_obj.remount_device()
     cls.kitchensink_pkg_name = "com.google.android.car.kitchensink"
     cls.kitchensink_activity_name = ".KitchenSinkActivity"
Esempio n. 6
0
 def system_reboot(self, delaytime=200):
     """ Reboot device (solve the problem:"RPC server not started!")
     reboot device by 'adb reboot', check device startup normally after reboot.
     @parameter: waittime (int)
         seconds to wait reboot complete
     @author:yuhui xu
     @date: 11/10/2014
     """
     self.serial = g_common_obj.globalcontext.device_serial
     print "the self.serial is: ", self.serial
     adbcmdstr = None
     if (self.serial):
         adbcmdstr = "adb -s %s reboot" % (self.serial)
     else:
         adbcmdstr = "adb reboot"
     print 'Execute adb reboot'
     ret = self.shell_cmd(adbcmdstr)
     print ret
     if (self.serial):
         adbcmdstr = "adb -s %s wait-for-device" % (self.serial)
     else:
         adbcmdstr = "adb wait-for-device"
     print 'Waiting for device online'
     ret = self.shell_cmd(adbcmdstr, delaytime + 10)
     print "This is to root device for RPC not start problem"
     print "wait for boot :200s start"
     time.sleep(delaytime)
     print "wait for boot :200s end"
     g_common_obj.root_on_device()
     print "Reboot device success"
     return ret
    def setUp(self):
        super(ComposeUI, self).setUp()
        self._test_name = __name__
        self.device = g_common_obj.get_device()
        print "[Setup]: %s" % self._test_name
        self._composeui = ComposeUiImpl()
        self._imageviewer = ImageDetails()
        self.photos = PhotosExtendImpl()
        self.photosImpl = get_photo_implement()
        self.qrcodeImpl = QRcode()
        g_common_obj.root_on_device()
        g_common_obj.remount_device()
        self.photosImpl.rm_delete_photos()
        self.photosImpl.refresh_sdcard()
        self.photos.clean()

        self.qrcode = "GIFPICTURE"
        config = TestConfig()
        cfg_file = 'tests.tablet.artifactory.conf'
        cfg_arti = config.read(cfg_file, 'artifactory')
        config_handle = ConfigHandle()
        cfg_arti["location"] = config_handle.read_configuration('artifactory', 'location', '/etc/oat/', 'sys.conf')

        cfg = config.read(cfg_file, 'qrcode_marked_image')
        self.qrcode = cfg.get("screenshot_edit_qrcode")
        print "[Debug] qrcode:%s" % (self.qrcode)
        arti = Artifactory(cfg_arti.get('location'))
        pic_name = cfg.get("screenshot_edit_image")
        file_path = arti.get(pic_name)
        g_common_obj.adb_cmd_common('push ' + file_path + ' /sdcard/Pictures')
        self.photosImpl.refresh_sdcard()
        special_actions.setup()
        self.photos.setup()
Esempio n. 8
0
    def setUp(self):
        """
        @summary: set up
        @return: None
        """
        super(CameraTest, self).setUp()
        self._test_name = __name__
        self.logger.debug("[Setup]: %s" % self._test_name)

        g_common_obj.root_on_device()
        self.camera_common = CameraCommon()

        self.host_path = self.camera_common.getTmpDir()

        self.rvc_camera = MultiMediaSwitchCameraHelper().camera

        self.camera_common.removeDeivceFile()
        self.camera_common.removeFile(self.host_path + "/*")
        self.camera_common.unlockScreen()
        self.rvc_camera.skipAccountLoginLyout()
        self.rvc_camera.backHome()
        self.d = g_common_obj.get_device()
        if self.d(text="Got it").exists:
            self.d(text="Got it").click.wait()

        self.multimedia_setting = MultiMediaSetting(self.camera_common.DEFAULT_CONFIG_FILE)
        need_install_result = self.multimedia_setting.install_apk("multi_camera_apk")
        if need_install_result:
            self.reboot_device()
        self.multi_camera_package_name, _ = self.multimedia_setting.get_package_and_activity_name("multi_camera_apk")
        MULTI_CAMERA_PERMISSION_LIST = ["android.permission.CAMERA"]
        self.camera_common.grantPermission(self.multi_camera_package_name, MULTI_CAMERA_PERMISSION_LIST)
Esempio n. 9
0
    def setUp(self):
        """
        @summary: set up
        @return: None
        """
        super(CameraTest, self).setUp()
        self._test_name = __name__
        self.logger.debug("[Setup]: %s" % self._test_name)

        g_common_obj.root_on_device()
        self.camera_common = CameraCommon()

        self.host_path = self.camera_common.getTmpDir()

        self.rvc_camera = ""
        self.aosp_camera = ""
        self.ref_camera = ""
        self.case_result = -1

        self.camera_common.removeDeivceFile()
        self.camera_common.removeFile(self.host_path + "/*")
        self.get_rvc_camera_class().stopCameraApp()
        self.camera_common.unlockScreen()
        self.get_rvc_camera_class().skipAccountLoginLyout()
        self.get_rvc_camera_class().backHome()
        self.d = g_common_obj.get_device()
        if self.d(text="Got it").exists:
            self.d(text="Got it").click.wait()
Esempio n. 10
0
 def check_dmesg_info(self, matchCase=True, keyword=None, assertword=None):
     g_common_obj.root_on_device()
     para = 'I' if matchCase else 'i'
     cmd = "dmesg | grep -%sE %s" % (para, keyword)
     result = g_common_obj.adb_cmd_capture_msg(cmd)
     print "-----Get dmesg info-----:\n %s" % result
     return True if assertword in result else False
Esempio n. 11
0
 def adb_disable_verity(self):
     """
     M: remount /system instead of disable-verity.
     O: Need to flash vbmeta_img in fastboot mode.
     """
     if self.ANDROID_VERSION == "M":
         g_common_obj.root_on_device()
         cmd = "busybox mount -o rw, remount /system"
         busybox_obj.setup()
         busybox_obj.adb_busybox_cmd(cmd)
         self._adb_reboot()
         g_common_obj.root_on_device()
         time.sleep(3)
         g_common_obj.remount_device()
         time.sleep(3)
     else:
         if 'remount succeeded' not in self._remount_result() or \
                         len(self._remount_result()) != 1:
             self._adb_reboot_fastboot()
             remote_vbmeta_path = TestConfig().read(
                 "tests.tablet.artifactory.conf",
                 "framebuffer_dependency_o").get("vbmeta")
             arti = Artifactory(
                 TestConfig().read(section='artifactory').get('location'))
             vbmetaimg = arti.get(remote_vbmeta_path)
             self.fastboot_flash_vbmeta(vbmetaimg)
             time.sleep(3)
             assert 'remount succeeded' in self._remount_result(
             ), "Disable-verity failed."
             time.sleep(3)
    def setUp(self):
        """
        @summary: set up
        @return: None
        """
        super(CameraTest, self).setUp()
        self._test_name = __name__
        self.logger.debug("[Setup]: %s" % self._test_name)
        self.case_result = -1

        g_common_obj.root_on_device()
        g_common_obj.remount_device()
        self.camera_common = CameraCommon()
        self.multimedia_setting = MultiMediaSetting(self.camera_common.DEFAULT_CONFIG_FILE)

        self.host_path = self.camera_common.getTmpDir()
        self.multimedia_scale_test_helper = MultiMediaScaleTestHelper(self.host_path)
        self.multimedia_checkiq_helper = MultiMediaCheckiqHelper(self.host_path)
        self.android_version = MultiMediaSwitchCameraHelper(skip_import_camera=True).android_version.lower()

        self.multimedia_scale_test_helper.scale_test_prepare()

        self.camera_common.removeDeivceFile()
        self.camera_common.removeDeivceFile(self.multimedia_scale_test_helper.movies_folder_device_path + "*")
        self.camera_common.removeFile(self.host_path + "/*.mp4")

        self.camera_common.unlockScreen()
        self.d = g_common_obj.get_device()
        self.skipAccountLoginLyout()
        g_common_obj.back_home()
        if self.d(text="Got it").exists:
            self.d(text="Got it").click.wait()
Esempio n. 13
0
 def setUp(self):
     super(Hal, self).setUp()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     self._hal = HalImpl()
     g_common_obj.root_on_device()
     g_common_obj.remount_device()
     self._hal.init_environment()
Esempio n. 14
0
 def _remount_result(self):
     # return exit code, 0 for succeed, 1 for error
     g_common_obj.root_on_device()
     time.sleep(3)
     LOG.debug('Execute adb remount')
     ret = [i.strip() for i in shell_command('adb remount')[1]]
     LOG.debug('Got remount result: %s' % ret)
     return ret
Esempio n. 15
0
    def setUpClass(cls):
        print "[setUpClass]: %s" % cls.__name__
        super(DisplayAllAppsOnHomeScreen, cls).setUpClass()
        cls.d = g_common_obj.get_device()
        g_common_obj.root_on_device()
        g_common_obj.remount_device()
        config = TestConfig()
        cfg_file = 'tests.tablet.artifactory.conf'
        cfg_arti = config.read(cfg_file, 'artifactory')
        config_handle = ConfigHandle()
        cfg_arti["location"] = config_handle.read_configuration(
            'artifactory', 'location', '/etc/oat/', 'sys.conf')
        # Change to photoGrid app since meitupic is not support for x86 cpu
        cfg_picasatool = config.read(cfg_file, 'content_photogrid')
        arti = Artifactory(cfg_arti.get('location'))
        binary_name = cfg_picasatool.get("name")
        file_path = arti.get(binary_name)
        print "[Setup]: install photogrid"
        result = config_handle.check_apps("com.roidapp.photogrid")
        if result == 0:
            g_common_obj.adb_cmd_common('install ' + file_path)

        cfg_picsart = config.read(cfg_file, 'content_picsart')
        arti = Artifactory(cfg_arti.get('location'))
        binary_name = cfg_picsart.get("name")
        file_path = arti.get(binary_name)
        print "[Setup]: install picsart"
        result = config_handle.check_apps("com.picsart.studio")
        if result == 0:
            g_common_obj.adb_cmd_common('install ' + file_path)

        cfg_picsay = config.read(cfg_file, 'content_picsay')
        arti = Artifactory(cfg_arti.get('location'))
        binary_name = cfg_picsay.get("name")
        file_path = arti.get(binary_name)
        print "[Setup]: install picsay"
        result = config_handle.check_apps("com.shinycore.picsayfree")
        if result == 0:
            g_common_obj.adb_cmd_common('install ' + file_path)

        cfg_sketchbook = config.read(cfg_file, 'content_sketchbook')
        arti = Artifactory(cfg_arti.get('location'))
        binary_name = cfg_sketchbook.get("name")
        file_path = arti.get(binary_name)
        print "[Setup]: install sketchbook"
        result = config_handle.check_apps("com.adsk.sketchbookhdexpress")
        if result == 0:
            g_common_obj.adb_cmd_common('install ' + file_path)

        cfg_skitch = config.read(cfg_file, 'content_skitch')
        arti = Artifactory(cfg_arti.get('location'))
        binary_name = cfg_skitch.get("name")
        file_path = arti.get(binary_name)
        print "[Setup]: install skitch"
        result = config_handle.check_apps("com.evernote.skitch")
        if result == 0:
            g_common_obj.adb_cmd_common('install ' + file_path)
Esempio n. 16
0
 def setUp(self):
     super(HWComposer2, self).setUp()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     g_common_obj.root_on_device()
     self.d = g_common_obj.get_device()
     wifi_ctrl.turn_off()
     self.systemTouch = SystemTouch()
     self.develop_settings = DevelopmentSettingsImpl()
Esempio n. 17
0
 def reboot_device(self):
     self.rvc_camera.pressPowerKey(10)
     time.sleep(5)
     self.rvc_camera.pressPowerKey(2)
     time.sleep(30)
     g_common_obj.root_on_device()
     self.camera_common.unlockScreen()
     self.rvc_camera.backHome()
     self.check_home_or_lock_layout()
Esempio n. 18
0
 def setUp(self):
     self._test_name = __name__
     print
     print "[Setup]: %s" % self._test_name
     g_common_obj.root_on_device()
     touch.install_artifactory_app("chrome_google", "com.android.chrome")
     touch.launch_chrome_skip_accept()
     g_common_obj.close_background_apps()
     super(GestureZoom, self).setUp()
Esempio n. 19
0
 def setUp(self):
     super(HWComposer, self).setUp()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     g_common_obj.root_on_device()
     self.d = g_common_obj.get_device()
     self._extendcamera = CameraExtendImpl()
     self.photoImpl = get_photo_implement()
     self.develop_settings = DevelopmentSettingsImpl()
     self.develop_settings.set_disable_hw_overlays(switch='ON')
Esempio n. 20
0
 def setUp(self):
     super(ImageView, self).setUp()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     g_common_obj.root_on_device()
     self.d = g_common_obj.get_device()
     self.photosImpl = get_photo_implement()
     self.qr = QRcode()
     self.photosImpl.rm_delete_photos()
     self.photosImpl.stop_photos_am()
 def TestOEMDefalt_Locale_M(self):
     self.func.setup_connection()
     self.func.unlock_screen()
     self.func.factory_reset()
     self.func.check_reset()
     self.func.wait_for_android_os()
     g_common_obj.root_on_device()
     self.func.mount_device()
     self.func.setup_connection()
     self.oem.local_chinese()
     g_common_obj.adb_cmd_capture_msg("rm -rf /oem/oem.prop")
 def tearDown(self):
     print "[Teardown]: %s" % self._test_name
     super(TestOEMDefaltLocale_M, self).tearDown()
     self.wifi = None
     g_common_obj.adb_cmd("mv /oem/oem.prop.bak  /oem/oem.prop")
     self.func.factory_reset_local()
     self.func.check_reset()
     self.func.wait_for_android_os()
     g_common_obj.root_on_device()
     self.func.setup_connection()
     self.func.skip_initial_screen_after_factory_reset()
Esempio n. 23
0
 def adb_shell_start(self):
     g_common_obj.root_on_device()
     if self.ANDROID_VERSION == "M":
         g_common_obj.adb_cmd("start")
         time.sleep(3)
         self._check_display_status("on", self.SET_TIMEOUT)
     else:
         g_common_obj.adb_cmd("start")
         time.sleep(6)
         g_common_obj.adb_cmd("start hwcomposer-2-1")
         time.sleep(6)
         self._check_display_status("on", self.SET_TIMEOUT)
Esempio n. 24
0
 def reboot_device(self):
     self.pressPowerKey(10)
     time.sleep(5)
     self.pressPowerKey(2)
     time.sleep(40)
     g_common_obj.root_on_device()
     g_common_obj.remount_device()
     os.system("adb shell uiautomator dump /data/local/tmp/uidump.xml"
               )  #get layout, 20170822 has bug, can't find layout!
     g_common_obj.adb_cmd("setprop evs.state 0")
     self.backHome()
     self.check_home_or_lock_layout()
Esempio n. 25
0
    def reboot_device(self):
        self.pressPowerKey(10)
        time.sleep(5)
        self.pressPowerKey(2)
#         from testlib.common.common import g_common_obj2
#         g_common_obj2.system_reboot(30)
        time.sleep(40)
        g_common_obj.root_on_device()
#         g_common_obj.remount_device()
        os.system("adb shell uiautomator dump /data/local/tmp/uidump.xml")#get layout, 20170822 has bug, can't find layout!
        self.camera_common.unlockScreen()
        self.backHome()
        self.check_home_or_lock_layout()
    def setUpClass(cls):
        super(ChromeCastTestBase, cls).setUpClass()
        cls.d = g_common_obj.get_device()
        g_common_obj.root_on_device()
        g_common_obj.remount_device()

        config_file = 'tests.chromecast.device.conf'
        test_conf = cls.config.read(config_file, "TEST_CONF")
        cls.cast_model = test_conf.get('cast_model')
        if cls.cast_model == 'Nexus Player':
            cls.IChromeCastImpl = ChromeCastNexusPlayerImpl
        elif cls.cast_model == 'Chromecast':
            pass
Esempio n. 27
0
    def checkProvision(self):
        self.case_name = sys._getframe().f_back.f_code.co_name
        logger.debug("case_name=%s" % self.case_name)
        self.appPrepare(0)
        if "false" == self.cfg.get("test"):
            logger.debug("Case %s is skip auto test!" % self.case_name)
            return
        num = self.getDeviceTypeMapNum()
        if num == 1:
            g_common_obj.root_on_device()
            self.disableVerityDUT()
            adb.reboot_device()
            self.wait_boot_completed()
        g_common_obj.root_on_device()
        self.remountDUT()
        time.sleep(3)
        bin_src_path = self.getDeviceTypeMapCfg().get("%s_bin_src_path" %
                                                      (num))
        bin_dst_path = self.getDeviceTypeMapCfg().get("%s_bin_src_path" %
                                                      (num))
        bin_src_path = self.multimedia_setting.download_file_to_host(
            bin_src_path)
        bin_src_folder = os.path.split(bin_src_path)[0]
        bin_dst_filename = os.path.split(bin_dst_path)[1]
        unzip_cmd = self.getDeviceTypeMapCfg().get("unzip_command")
        self.executeCommandWithPopen(unzip_cmd %
                                     (bin_src_path, bin_src_folder))
        bin_src_path = os.path.join(bin_src_folder, bin_dst_filename)
        bin_dst_path = self.multimedia_setting.push_file_to_dut(
            bin_src_path, bin_dst_path)

        tools_src_path = self.getDeviceTypeMapCfg().get("%s_tool_src_path" %
                                                        (num))
        tools_dst_path = self.getDeviceTypeMapCfg().get("%s_tool_dst_path" %
                                                        (num))
        tools_dst_path = self.multimedia_setting.push_file_new(
            tools_src_path, tools_dst_path)
        g_common_obj.adb_cmd_capture_msg("chmod 777 %s" % tools_dst_path)
        time.sleep(5)
        i = 1
        while "%s_execute_command_%s" % (num, i) in self.getDeviceTypeMapCfg():
            cmd = self.getDeviceTypeMapCfg().get("%s_execute_command_%s" %
                                                 (num, i))
            fdp = self.executeCommandWithPopen(cmd)
            time.sleep(3)
            stdout_log = fdp.stdout.read()
            assert "cannot" not in stdout_log and "error" not in stdout_log and "fail" not in stdout_log and "not found" not in stdout_log, "(%s) cmd error: %s" % (
                cmd, stdout_log)
            i += 1
        logger.debug("Case %s is pass!" % self.case_name)
 def Testsetwallpaperproperty(self):
     self.func.setup_connection()
     self.func.unlock_screen()
     self.func.factory_reset()
     self.func.check_reset()
     self.func.wait_for_android_os()
     g_common_obj.root_on_device()
     self.func.mount_device()
     cmdstr = "adb shell getprop | grep ro.config.wallpaper"
     print cmdstr
     cmd = os.popen(cmdstr).read()
     print cmd
     cmd_search = cmd.count('/oem/media/default_wallpaper.jpg')
     assert cmd_search > 0, "[ERROR]"
     g_common_obj.adb_cmd_capture_msg("rm -rf /oem/oem.prop")
 def TestSetwallpaperCOMproperty(self):
     self.func.setup_connection()
     self.func.unlock_screen()
     self.func.factory_reset()
     self.func.check_reset()
     self.func.wait_for_android_os()
     g_common_obj.root_on_device()
     self.func.mount_device()
     cmdstr = "adb shell getprop | grep ro.config.wallpaper_component"
     print cmdstr
     cmd = os.popen(cmdstr).read()
     print cmd
     cmd_search = cmd.count('com.android.galaxy4/.Galaxy4Wallpaper')
     assert cmd_search > 0, "[ERROR]"
     g_common_obj.adb_cmd_capture_msg("rm -rf /oem/oem.prop")
Esempio n. 30
0
 def Testsetregionproperty(self):
     self.func.setup_connection()
     self.func.unlock_screen()
     self.func.factory_reset()
     self.func.check_reset()
     self.func.wait_for_android_os()
     g_common_obj.root_on_device()
     self.func.mount_device()
     cmdstr = "adb shell getprop | grep ro.product.locale.region"
     print cmdstr
     cmd = os.popen(cmdstr).read()
     print cmd
     cmd_search = cmd.count('CN')
     assert cmd_search > 0, "[ERROR]"
     g_common_obj.adb_cmd_capture_msg("rm -rf /oem/oem.prop")