def __init__(self): self._device = g_common_obj.get_device() self._locator = Locator(self._device) config_handle = ConfigHandle() self.id = config_handle.read_configuration('google_account', 'user_name', '/etc/oat/', 'sys.conf') self.pwd = config_handle.read_configuration('google_account', 'password', '/etc/oat/', 'sys.conf')
def install_templerun_app(self, cfg, option="apk_name"): ''' Install Temple run 2. ''' ret = os.system( "adb -s %s shell pm list package | grep com.imangi.templerun2" % self.serial) if ret == 0: print "[Info] ---Temple run 2 already installed." return from testlib.util.repo import Artifactory config_handle = ConfigHandle() cfg["location"] = config_handle.read_configuration( 'artifactory', 'location', '/etc/oat', 'sys.conf') arti_obj = Artifactory(cfg.get("location")) ret_file = arti_obj.get(cfg.get(option)) print "[Info] ---Install Temple run 2." assert os.path.isfile(ret_file) os.system("adb -s %s install -r %s" % (self.serial, ret_file)) time.sleep(2) ret = os.system( "adb -s %s shell pm list package | grep com.imangi.templerun2" % self.serial) assert ret == 0, "Install Temple run 2 failed!"
def setUp(self): print "[Setup]:%s" % self.__class__.__name__ super(HDMITest, self).setUp() self.photosImpl.rm_delete_photos() self.qrcode = "bmppicture" 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') self.retry_num = self.config.read( cfg_file, 'rerun_times').get("hdmi_imagedisplay_png") self.retry_num = int(self.retry_num) cfg = config.read(cfg_file, 'qrcode_marked_image') print self.qrcode self.qrcode = cfg.get("hdmi_png_qrcode") print "[Debug] qrcode:%s" % (self.qrcode) arti = Artifactory(cfg_arti.get('location')) pic_name = cfg.get("hdmi_png_image") file_path = arti.get(pic_name) g_common_obj.adb_cmd_common('push ' + file_path + ' /sdcard/Pictures') self.photosImpl.refresh_sdcard() self.systemui = SystemUiExtendImpl() self.HDMI_switch_card = HDMISwitchCardImpl() self.HDMI_capture_decode = HDMICaptureDecodeImpl() self.HDMI_switch_card.setup() self.HDMI_switch_card.switch_off() self.HDMI_capture_decode.setup() self.systemui.unlock_screen() self.d.screen.on() self.d.orientation = 'natural'
def setUp(self): super(ComposeUI, self).setUp() self._test_name = __name__ print "[Setup]: %s" % self._test_name self._docstogo = DocsToGo() config = TestConfig() cfg_file = 'tests.tablet.composeui.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, 'DocsToGo') arti = Artifactory(cfg_arti.get('location')) binary_name = cfg_apk.get("name") file_path = arti.get(binary_name) result = config_handle.check_apps("com.dataviz.docstogo") if result == 0: g_common_obj.adb_cmd_common('install ' + file_path) arti = Artifactory(cfg_arti.get('location')) cfg_docx = config.read(cfg_file, 'docx') docx_name = cfg_docx.get("name") docx_path = arti.get(docx_name) g_common_obj.adb_cmd_common('push ' + docx_path + ' /sdcard/') cmd = "am broadcast -a android.intent.action.MEDIA_MOUNTED\ -d file:///sdcard/" g_common_obj.adb_cmd(cmd) self.docx = cfg_docx.get("filename") print self.docx
def setUpClass(self): """ install apk """ super(RunImageProcessing, self).setUpClass() 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_imageprocessing') arti = Artifactory(cfg_arti.get('location')) version_array = osversion.get_android_version() androidversion = version_array[0] if androidversion == 7: print "osversion is N" apk_name = cfg.get("name") elif androidversion == 6: print "osversion is M" apk_name = cfg.get("name") elif androidversion == 5: print "osversion is L" apk_name = cfg.get("name_l") else: print "osversion is %s" % (androidversion) apk_name = cfg.get("name_l") file_path = arti.get(apk_name) result = config_handle.check_apps("com.android.rs.image") if result == 0: g_common_obj.adb_cmd_common('install ' + file_path)
def setUpClass(self): """ set environment """ super(ImageViewByWebBrowser, self).setUpClass() self.photos = get_photo_implement() self._qrcode = QRcode() self._chrome = ChromeExtendImpl() self.photos.rm_delete_photos() 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') arti = Artifactory(cfg_arti.get('location')) pic_name = cfg.get("q_webp") self.pic_name = pic_name.split("/")[-1] self.qrcode = cfg.get("q_webp_qrcode") file_path = arti.get(pic_name) self.photos.deploy_photo_content(local_file=file_path) self._chrome.launch() self._chrome.chrome_setup()
def installImageProcessor(self): ''' install from Artifactory ''' 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_imageprocessing') arti = Artifactory(cfg_arti.get('location')) version_array = osversion.get_android_version() androidversion = version_array[0] if androidversion == 7: print "osversion is N" apk_name = cfg.get("name") elif androidversion == 6: print "osversion is M" apk_name = cfg.get("name") elif androidversion == 5: print "osversion is L" apk_name = cfg.get("name_l") else: print "osversion is %s" % (androidversion) apk_name = cfg.get("name_l") file_path = arti.get(apk_name) result = config_handle.check_apps(self.pkg_name) if result == 0: g_common_obj.adb_cmd_common('install ' + str(file_path), 300)
def init_photos(self): """ push some pictures in DUT """ config = TestConfig() cfg_file = 'tests.tablet.basic_render_script.conf' cfg_arti = config.read(cfg_file, 'artifactory') config_handle = ConfigHandle() cfg_arti["location"] = config_handle.read_configuration( 'artifactory', 'location', '/etc/oat/', 'sys.conf') arti = Artifactory(cfg_arti.get('location')) cfg_name = config.read(cfg_file, 'girls') pictures_name = cfg_name.get("name") self.floder_name = cfg_name.get('floder') pictures_path = arti.get(pictures_name) print os.system("cd " + os.path.dirname(pictures_path) + ";tar xzf " + pictures_path) unzip_photos = pictures_path.replace(".tar.gz", "/") cmd = "mkdir -p %s" % self.floder_name g_common_obj.adb_cmd_common(cmd) cmd = "push %s /sdcard/%s" % (unzip_photos, self.floder_name) g_common_obj.adb_cmd_common(cmd) cmd = "am broadcast -a android.intent.action.MEDIA_MOUNTED \ -d file:///sdcard/" g_common_obj.adb_cmd(cmd)
def init_environment(self): """ Init the test environment """ 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_androidvid') self.arti = Artifactory(cfg_arti.get('location')) apk_name = cfg.get("name") file_path = self.arti.get(apk_name) print "%s" % file_path result = config_handle.check_apps(self.pkg_name) if result == 0: g_common_obj.adb_cmd_common('install ' + file_path) video_name = cfg.get("video_arti") video_path = self.arti.get(video_name) g_common_obj.adb_cmd_common('push ' + video_path + ' /sdcard/') cmd = "am broadcast -a \ android.intent.action.MEDIA_MOUNTED -d file:///sdcard/" g_common_obj.adb_cmd(cmd) self.video = cfg.get("filename") bench_files = config.read(cfg_file, 'gfxbench31_files') busybox_path = self.arti.get(bench_files.get("busybox")) busybox_tar_path = bench_files.get("busybox_path") print g_common_obj.push_file(busybox_path, busybox_tar_path) print g_common_obj.adb_cmd_capture_msg("chmod 777 " + busybox_tar_path) self.md5_id = config.read(cfg_file, 'md5_id') self.check_path = self.md5_id.get('check_path')
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 setUp(self): print "[Setup]:%s" % self.__class__.__name__ super(ImageViewing, self).setUp() self.device = g_common_obj.get_device() self.photos = get_photo_implement() self.qrcodeImpl = QRcode() self.wallpaper = WallpaperImpl() self.photos.rm_delete_photos() self.photos.refresh_sdcard() 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_imageview_qrcode") print "[Debug] qrcode:%s" % (self.qrcode) arti = Artifactory(cfg_arti.get('location')) pic_name = cfg.get("screenshot_imageview_image") file_path = arti.get(pic_name) g_common_obj.adb_cmd_common('push ' + file_path + ' /sdcard/Pictures') self.photos.refresh_sdcard()
class Resources(object): def __init__(self): self.device = g_common_obj.get_device() self.config = TestConfig() self.config_handle = ConfigHandle() def get_resource_from_atifactory(self, conf_name, section, resource_name): #usage: et_resource_from_atifactory("tests.tablet.artifactory.conf", "content_picture", "wbmp") cfg_file = conf_name cfg_arti = self.config.read(cfg_file, 'artifactory') cfg_arti["location"] = self.config_handle.read_configuration( 'artifactory', 'location', '/etc/oat/', 'sys.conf') cfg = self.config.read(cfg_file, section) arti = Artifactory(cfg_arti.get('location')) file_name = cfg.get(resource_name) file_path = arti.get(file_name) return file_path def disable_app_verification(self): _cmdstr_disable = "settings put global package_verifier_enable 0" _cmdstr_get_status = "settings get global package_verifier_enable" _status = shell_command( "adb shell settings get global package_verifier_enable" )[1][0].strip() if int(_status): g_common_obj.adb_cmd(_cmdstr_disable)
def get_pictures(): """ download pictures tar folders from artifactory """ if not os.path.isdir("~/Pictures") is True: g_common_obj.shell_cmd("mkdir -p ~/Pictures") 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_picture') arti = Artifactory(cfg_arti.get('location')) pic_name1 = cfg.get("pngtar") file_path1 = arti.get(pic_name1) g_common_obj.shell_cmd("mv " + file_path1 + " ~/Pictures/PNG.tar.gz ") pic_name2 = cfg.get("webptar") file_path2 = arti.get(pic_name2) g_common_obj.shell_cmd("mv " + file_path2 + " ~/Pictures/WEBP.tar.gz ") # assert os.path.isdir("~/Pictures") is True os.system("cd ~/Pictures ") os.system("echo change to dir ~/pictures $?") os.system("tar xzvf ~/Pictures/PNG.tar.gz -C ~/Pictures/ ") os.system("echo unarchive png $?") os.system("tar xzvf ~/Pictures/WEBP.tar.gz -C ~/Pictures/ ") os.system("echo unarchive webp $?")
def __init__(self): configer = TestConfig() self.config = configer.read(self.config_file, "DisplayCableSwitch") config_handle = ConfigHandle() self.config["artifactory_location"] = config_handle.read_configuration('artifactory', 'location', '/etc/oat', 'sys.conf') self.arti = Artifactory(self.config.get('artifactory_location')) self.excuter_path = ''
def __init__(self): self.device = g_common_obj.get_device() self.configer = TestConfig() self.config = self.configer.read(self.CONFIG_FILE, "APIDemoImpl") config_handle = ConfigHandle() self.config["artifactory_location"] = config_handle.read_configuration('artifactory', 'location', '/etc/oat', 'sys.conf') self.arti = Artifactory(self.config.get('artifactory_location'))
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 __init__(self): self.configer = TestConfig() self.config = self.configer.read(self.config_file, "SkiaImpl") config_handle = ConfigHandle() self.config["artifactory_location"] = config_handle.read_configuration( 'artifactory', 'location', '/etc/oat', 'sys.conf') self.arti = Artifactory(self.config.get('artifactory_location')) self.dut_skia_test = self.config.get('dut_skia_test') self.dut_skia_bench = self.config.get('dut_skia_bench')
def __init__(self): self.device = g_common_obj.get_device() self.configer = TestConfig() self.config = self.configer.read(self.config_file, "SpecialActionsImpl") config_handle = ConfigHandle() self.config["artifactory_location"] = config_handle.read_configuration('artifactory', 'location', '/etc/oat', 'sys.conf') self.arti = Artifactory(self.config.get('artifactory_location')) self.dut_res_dir = self.config.get("dut_res_dir") self.actions = []
def set_environment(self): """ init the test environment """ config = TestConfig() cfg_file = 'tests.tablet.chromecast.conf' cfg_cast = config.read(cfg_file, 'chromecast_device') self.nexus_device = cfg_cast.get("device") cmd = "-s %s logcat -d -c" % self.nexus_device g_common_obj.adb_cmd_common(cmd) print "[clear log]" cfg_arti = config.read(cfg_file, 'artifactory') config_handle = ConfigHandle() cfg_arti["location"] = config_handle.read_configuration('artifactory', 'location', '/etc/oat/', 'sys.conf') arti = Artifactory(cfg_arti.get('location')) cfg_apk = config.read(cfg_file, 'netflix') apk_name = cfg_apk.get("name") file_path = arti.get(apk_name) g_common_obj.adb_cmd_common('install ' + file_path) self.id = config_handle.read_configuration('google_account', 'user_name', '/etc/oat/', 'sys.conf') self.pwd = config_handle.read_configuration('google_account', 'password', '/etc/oat/', 'sys.conf')
def __init__(self): GLBenchmarkImpl.__init__(self) self.device = g_common_obj.get_device() self.home = GLBenchmarkExtendImpl.HomeUI(self.device) self.performc = GLBenchmarkExtendImpl.TestList(self.device) self.configer = TestConfig() self.config = self.configer.read(self.CONFIG_FILE, "GLBenchmark") config_handle = ConfigHandle() self.config["artifactory_location"] = config_handle.read_configuration('artifactory', 'location', '/etc/oat', 'sys.conf') self.arti = Artifactory(self.config.get('artifactory_location'))
def __init__(self): self.device = g_common_obj.get_device() self.home = ImageProcessingImpl.HomeUI(self.device) self.configer = TestConfig() self.config = self.configer.read(self.CONFIG_FILE, "ImageProcessingExtendImpl") config_handle = ConfigHandle() self.config["artifactory_location"] = config_handle.read_configuration( 'artifactory', 'location', '/etc/oat', 'sys.conf') self.arti = Artifactory(self.config.get('artifactory_location'))
def get_resource_from_atifactory(conf_name, section, resource_name): # usage: et_resource_from_atifactory("tests.tablet.artifactory.conf", "content_picture", "wbmp") config = TestConfig() cfg_file = conf_name 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, section) arti = Artifactory(cfg_arti.get('location')) pic_name = cfg.get(resource_name) file_path = arti.get(pic_name) return file_path
def __init__(self): super(PhotosExtendImpl, self).__init__() self.configer = TestConfig() self.config = self.configer.read(self.config_file, "Photos") config_handle = ConfigHandle() self.config["artifactory_location"] = config_handle.read_configuration( 'artifactory', 'location', '/etc/oat', 'sys.conf') self.dut_photos_dir = self.config.get("photos_dir") self.dut_video_dir = self.config.get("video_dir") self.arti = Artifactory(self.config.get("artifactory_location")) self._home = PhotosExtendImpl.HomeUI(self.d) self._view = PhotosExtendImpl.ViewUI(self.d) self.qrcodeImpl = QRcode()
def install_adobeAir(self): 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_adobeair') arti = Artifactory(cfg_arti.get('location')) apk_name = cfg.get("name") file_path = arti.get(apk_name) result = config_handle.check_apps("com.adobe.air") if result == 0: g_common_obj.adb_cmd_common('install ' + str(file_path))
def install_apk(self, apk_name): """ Install the apk from artifactory """ config = TestConfig() cfg_file = 'tests.tablet.game.conf' cfg_arti = config.read(cfg_file, 'artifactory') config_handle = ConfigHandle() cfg_arti["location"] = config_handle.read_configuration('artifactory', 'location', '/etc/oat/', 'sys.conf') arti = Artifactory(cfg_arti.get('location')) cfg_apk = config.read(cfg_file, apk_name) apk_name = cfg_apk.get("name") file_path = arti.get(apk_name) g_common_obj.adb_cmd_common('install ' + file_path)
def __init__(self): GLBenchmarkImpl.__init__(self) self.device = g_common_obj.get_device() self.home = Gfxbench30Impl.HomeUI(self.device) self.testlist = Gfxbench30Impl.TestList(self.device) self.configer = TestConfig() self.config = self.configer.read(self.CONFIG_FILE, "Gfxbench30Impl") config_handle = ConfigHandle() self.config["artifactory_location"] = config_handle.read_configuration( 'artifactory', 'location', '/etc/oat', 'sys.conf') self.arti = Artifactory(self.config.get('artifactory_location')) self.apk_cache_dir = self.config.get("apk_cache_dir") self.dut_download = self.config.get("dut_download")
def setup(self): ''' install from Artifactory ''' 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_renderscript_N') arti = Artifactory(cfg_arti.get('location')) apk_name = cfg.get("name") file_path = arti.get(apk_name) g_common_obj.adb_cmd_common('install ' + str(file_path), 300)
def setUpClass(self): """ install apk """ super(AnTuTuTest, self).setUpClass() 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_antutu') arti = Artifactory(cfg_arti.get('location')) apk_name = cfg.get("name") file_path = arti.get(apk_name) g_common_obj.adb_cmd_common('install ' + file_path)
def setUpClass(self): """ install apk """ super(MemTrack, self).setUpClass() 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") file_path = arti.get(apk_name) os.system('adb install -r -g %s' % file_path)
def init_environment(self): """ Init the test environment """ self.config = TestConfig() self.cfg_file = 'tests.hwui.binary.conf' cfg_arti = self.config.read(self.cfg_file, 'artifactory') config_handle = ConfigHandle() cfg_arti["location"] = config_handle.read_configuration( 'artifactory', 'location', '/etc/oat', 'sys.conf') cfg = self.config.read(self.cfg_file, 'binary') arti = Artifactory(cfg_arti.get('location')) binary_name = cfg.get("name") file_path = arti.get(binary_name) self.file_name = file_path.split("/")[-1] print "%s" % file_path g_common_obj.adb_cmd_common('push ' + file_path + ' /data/app/') g_common_obj.adb_cmd('chmod 777 /data/app/' + self.file_name)