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()
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." )
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()
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()
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()
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 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"
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()
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)
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()
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
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.rvc_camera = MultiMediaSwitchCameraHelper().camera self.rvc_camera.backHome() self.rvc_camera.init_camera_c_with_canbox()
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.evs_vts_test_config = self.config.read( self.camera_common.DEFAULT_CONFIG_FILE, "evs_vts_test_config") self.multimedia_setting = MultiMediaSetting( self.camera_common.DEFAULT_CONFIG_FILE) adb32.adb_disable_verity() self.prepare_env()
def setUpClass(self): """ install apk """ super(BurstFrequency, self).setUpClass() 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') cfg = config.read(cfg_file, 'content_graphic') arti = Artifactory(cfg_arti.get('location')) # apk_name = cfg.get("name") apk_name = cfg.get("name_270") file_path = arti.get(apk_name) # g_common_obj.adb_cmd_common('install ' + file_path, 600) os.system("adb install -r -g %s" % file_path)
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(VsyncFPSTool, 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') # cfg_apk = config.read(cfg_file, 'content_gears') cfg_apk = config.read(cfg_file, 'content_graphic') arti = Artifactory(cfg_arti.get('location')) binary_name = cfg_apk.get("name") file_path = arti.get(binary_name) # result = config_handle.check_apps("com.wt.fpstest") result = config_handle.check_apps("com.glbenchmark.glbenchmark27") if result == 0: g_common_obj.adb_cmd_common('install ' + file_path)
def setUpClass(self): """ install apk """ super(Render, self).setUpClass() 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') cfg = config.read(cfg_file, 'content_grafika') arti = Artifactory(cfg_arti.get('location')) apk_name = cfg.get("name") file_path = arti.get(apk_name) result = config_handle.check_apps("grafika-debug.apk") if result == 0: g_common_obj.adb_cmd_common('install ' + file_path) video_name = cfg.get("video") self.video_file = video_name.split('/')[-1] self.video_file_path = arti.get(video_name)
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.aosp_camera = AOSPCamera() self.adb_extension = AdbExtension() self.aosp_camera.cleanMediaFiles() self.adb_extension._adb_reboot()
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(ImageProcessingCoreCPUTest, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() g_common_obj.remount_device()
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(TouchScreenDuringDUTDimTest, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() g_common_obj.remount_device()
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(GPUCompositionFallbackMoreLayers, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() g_common_obj.remount_device()
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(APIDemosGraphicsOpenGLESTest, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() g_common_obj.remount_device()
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(WallpaperSetGIFImageTest, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() g_common_obj.remount_device()
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(GFXBenchGLHighLevelTestManhattanES31Test, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() g_common_obj.remount_device()
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(DisplayDynamicRefreshRate, cls).setUpClass() g_common_obj.root_on_device() g_common_obj.remount_device()
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(GLBenchmarkEgyptHD, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() g_common_obj.remount_device()
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(GFXBenchGLLowLevelTestAlphaBlendingOffscreenTest, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() g_common_obj.remount_device()
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(ScreenSizeReportingTest, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() g_common_obj.remount_device()
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(HWCVersionCheck, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() g_common_obj.remount_device()
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(DalvikTest, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() g_common_obj.remount_device()
def setUpClass(cls): print "[setUpClass]: %s" % cls.__name__ super(ScreenOffPowerButtonTest, cls).setUpClass() cls.d = g_common_obj.get_device() g_common_obj.root_on_device() g_common_obj.remount_device()