Beispiel #1
0
    def __init__(self, device):
        """
        Initializes this instance.

        @type device: Device
        @param device: The DUT
        """
        IAndroidPackage.__init__(self, device)
        self._path_ref = os.path.join("BENCHMARKS", "CFBENCHMARK")
        self.is_lower_better = False
        self.__pattern = ".*=\"%s\">(?P<result>[0-9\.]+).*<.*"
        self._results = {
            "native_memory_read": [],
            "java_msflops": [],
            "native_disk_read": [],
            "native_score": [],
            "java_efficiency_memory_read": [],
            "native_mips": [],
            "native_mdflops": [],
            "java_score": [],
            "native_memory_write": [],
            "java_memory_write": [],
            "native_mallocs": [],
            "native_msflops": [],
            "java_mips": [],
            "java_efficiency_mdflops": [],
            "overall_score": [],
            "java_memory_read": [],
            "java_efficiency_memory_write": [],
            "java_efficiency_mips": [],
            "java_efficiency_msflops": []
        }
Beispiel #2
0
    def __init__(self, device):
        """
        Initializes this instance.

        :type device: Device
        :param device: The DUT
        """
        IAndroidPackage.__init__(self, device)
        self._path_ref = os.path.join("BENCHMARKS", "CAFFEINEMARK")
        self.is_lower_better = False
        self.__device = device
        self.__cpt_cap = 0
        self._phonesystem = device.get_uecmd("PhoneSystem")
        self._result = None
        self.__screenshot = None
        self.__res_file = None
        self._results = {
            "score": [],
            "sieve": [],
            "loop": [],
            "logic": [],
            "string": [],
            "float": [],
            "method": []
        }
Beispiel #3
0
    def start(self):
        """
        Start application
        """
        test_dic = self.__test_dic[self.__version]
        if self._arguments not in test_dic.keys():
            raise AcsConfigException(
                AcsConfigException.INVALID_PARAMETER,
                "Test %s not in dictionnary for %s" %
                (self._arguments, self.__version))

        self.__test_name = test_dic[self._arguments]
        if self.__version == "glbenchmark21":
            self.__drive_version = self.__drive21
        elif self.__version == "glbenchmark27":
            self.__drive_version = self.__drive27
        elif self.__version == "glbenchmark25":
            self.__drive_version = self.__drive25
        else:
            raise AcsConfigException(
                AcsConfigException.INVALID_PARAMETER,
                "%s version is not supported in ACS" % self.__version)

        if "pro" in self.__test_name.lower():
            self.__regex_test_result = "Pro:\s*\d*\s*frames\s*\((?P<result>[\d*.]*)\s*FPS\)"

        IAndroidPackage.start(self)
Beispiel #4
0
    def uninstall(self):
        """
        Uninstall application
        """
        IAndroidPackage.uninstall(self)

        self.adb_shell("rm /data/angrybirds.sh", 5)
Beispiel #5
0
    def __init__(self, device):
        """
        Initializes this instance.

        Nothing to be done in abstract class.
        """
        IAndroidPackage.__init__(self, device)
Beispiel #6
0
    def __init__(self, device):
        """
        Initializes this instance.

        @type device: Device
        @param device: The DUT
        """
        IAndroidPackage.__init__(self, device)
        self._path_ref = os.path.join("BENCHMARKS", "RLBENCHMARK")
        self.is_lower_better = True
        self.__pattern = ".*=\"%s\" value=\"(?P<result>[0-9\.]+)\".*"
        self._results = {
            "test1": [],
            "test2": [],
            "test3": [],
            "test4": [],
            "test5": [],
            "test6": [],
            "test7": [],
            "test8": [],
            "test9": [],
            "test10": [],
            "test11": [],
            "test12": [],
            "test13": [],
            "overall": []
        }
Beispiel #7
0
    def uninstall(self):
        """
        Uninstall benchmark
        """
        IAndroidPackage.uninstall(self)

        self.adb_shell("rm -r /sdcard/rightware; rm /data/rightware", 10)
Beispiel #8
0
    def __init__(self, device):
        """
        Initializes this instance.

        :type device: Device
        :param device: The DUT
        """
        IAndroidPackage.__init__(self, device)
        self.is_lower_better = False
        self.__attempt = 1
        self._path_ref = os.path.join("BENCHMARKS", "ANTUTU")
        self.__data_path = "/data/data/com.antutu.ABenchMark"
        self.__pattern = "AnTuTuBenchmarkScore:\s*%s\s*:\s*"
        self._results = {
            "memory": [],
            "integer": [],
            "float": [],
            "2d": [],
            "3d": [],
            "database": [],
            "sdwrite": [],
            "sdread": [],
            "score": []
        }
        self._result_v4 = {
            "memory": [],
            "integer": [],
            "float": [],
            "2d": [],
            "3d": [],
            "database": [],
            "score": [],
            "multitask": [],
            "ram": [],
            "dalvik": [],
            "renderscript": [],
            "storage": []
        }
        self._result_v5 = {
            "memory": [],
            "integer": [],
            "float": [],
            "2d": [],
            "3d": [],
            "database": [],
            "multitask": [],
            "score": [],
            "integersingle": [],
            "floatsingle": [],
            "dalvik": [],
            "renderscript": [],
            "storage": [],
            "ram": []
        }

        self.__available_tests = [
            "CPU_MEMORY", "2D", "3D", "DATABASE_IO", "SDCARD_IO", None
        ]
        self.__run_num = 0
Beispiel #9
0
 def drive(self):
     """
     Drive application
     """
     IAndroidPackage.start(self)
     time.sleep(3)
     cmd_list = ["ENTER", "ENTER"]
     self._keyevent.scenario(cmd_list, 2.0)
Beispiel #10
0
 def uninstall(self):
     """
     Uninstall the application
     """
     IAndroidPackage.uninstall(self)
     version = self._get_version()
     if "1.2.4" in version:
         self.adb_shell("rm /data/CFM.dex", 3)
Beispiel #11
0
 def start(self):
     """
     Start application
     """
     self._logger.info("++ start")
     IAndroidPackage.start(self)
     time.sleep(5)
     cmd_list = ["MOVE_HOME", "TAB"]
     self._keyevent.scenario(cmd_list, 2)
Beispiel #12
0
 def start(self):
     """
     Start application
     """
     self._logger.info("++ wait 10 secs before running benchmark")
     time.sleep(10)
     self._logger.info("++ start")
     IAndroidPackage.start(self)
     time.sleep(3)
Beispiel #13
0
 def start(self):
     """
     Start application
     """
     self._logger.info("++ start")
     IAndroidPackage.start(self)
     # Added DPAD_UP to cmd_list to place the focus on 'Full Benchmark' text.
     cmd_list = ["MOVE_HOME", "DPAD_UP", "DPAD_DOWN", "DPAD_DOWN"]
     self._keyevent.scenario(cmd_list, 1)
     time.sleep(2)
Beispiel #14
0
 def __init__(self, device):
     """
     Initializes this instance.
     @type device: Device
     @param device: The DUT
     """
     IAndroidPackage.__init__(self, device)
     self._path_ref = os.path.join("BENCHMARKS", "GEEKBENCH")
     self.__device = device
     self.__count = 0
Beispiel #15
0
    def start(self):
        """
        Start application
        """
        self.adb_shell("rm -rf /data/data/gr.androiddev.BenchmarkPi/*", 3)
        IAndroidPackage.start(self)

        time.sleep(2)
        cmd_list = ["MOVE_HOME", "ENTER"]
        self._keyevent.scenario(cmd_list)
Beispiel #16
0
 def drive(self):
     """
     Start the application
     """
     self._logger.debug("Caffeinemark: drive")
     version = self._get_version()
     if "1.2.4" in version:
         cmd = "dalvikvm -cp /data/CFM.dex CaffeineMarkEmbeddedApp"
         self._result = self.adb_shell(cmd, 60)
     else:
         IAndroidPackage.start(self)
Beispiel #17
0
 def start(self):
     """
     Start application
     """
     self._logger.info("++ start")
     IAndroidPackage.start(self)
     time.sleep(2)
     if PCCGUtilities.find_view(attr="text",
                                value="Vellamo EULA",
                                clear_dump=False):
         PCCGUtilities.tap(attr="text", value="Accept", get_dump=False)
         self._logger.debug("Accepted Vellamo EULA")
Beispiel #18
0
    def __init__(self, device):
        """
        Initializes this instance.

        :type device: Device
        :param device: The DUT
        """
        IAndroidPackage.__init__(self, device)
        self._path_ref = os.path.join("BENCHMARKS", "BENCHMARKPI")
        self.is_lower_better = True
        self.__run_no = 0
        self._results = {"score": []}
    def __init__(self, device):
        """
        Initializes this instance.

        :type device: Device
        :param device: The DUT
        """

        IAndroidPackage.__init__(self, device)
        self._results = {"score": []}
        self.__device = device
        self._result = None
Beispiel #20
0
    def __init__(self, device):
        """
        Initializes this instance.

        :type device: Device
        :param device: The DUT
        """
        IAndroidPackage.__init__(self, device)
        self._path_ref = os.path.join("BENCHMARKS", "0XBENCH")
        self.is_lower_better = False

        self.__pattern = "Benchmark: XML:"
        self._results = {"score": []}
Beispiel #21
0
    def __init__(self, device):
        """
        Initializes this instance.

        :type device: Device
        :param device: The DUT
        """
        IAndroidPackage.__init__(self, device)
        self._path_ref = os.path.join("BENCHMARKS", "SMARTBENCH")
        self._results = {"score": []}
        self.__device = device
        self._benchType = None
        self._result = None
Beispiel #22
0
    def __init__(self, device):
        """
        Initializes this instance.

        @type device: Device
        @param device: The DUT
        """
        IAndroidPackage.__init__(self, device)
        self._path_ref = os.path.join("BENCHMARKS", "SMARTBENCH")
        self.is_lower_better = False
        self.__pattern = "value%s=(?P<result>\d+)"
        self.__end_log = "SBGLJellyfish:onStop()"
        self._results = {"Prod": [], "Game": []}
Beispiel #23
0
 def start(self):
     """
     Start application
     """
     self._logger.debug("Andebench - \'start\' begin")
     IAndroidPackage.start(self)
     time.sleep(5)
     if "java" in self._arguments.lower():
         cmd_list = ["BUTTON_MODE", "DPAD_LEFT", "ENTER", "TAB", "TAB", "TAB", "TAB", "ENTER", "BACK"]
     else:
         cmd_list = ["BUTTON_MODE", "DPAD_LEFT", "ENTER", "TAB", "TAB", "TAB", "ENTER", "BACK"]
     self._keyevent.scenario(cmd_list, 1)
     self._logger.debug("Andebench - \'start\' end")
Beispiel #24
0
    def __init__(self, device):
        """
        Initializes this instance.

        @type device: Device
        @param device: The DUT
        """

        IAndroidPackage.__init__(self, device)
        self._path_ref = os.path.join("BENCHMARKS", "ANDEBENCH")
        self.is_lower_better = False
        self.__pattern = "AndEMark\s*%s\s*\d*.\d*\s*:\s*"
        self._results = {"score": []}
        self.__available_tests = ["JAVA", "NATIVE"]
Beispiel #25
0
    def __init__(self, device):
        """
        Initializes this instance.

        :type device: Device
        :param device: The DUT
        """
        IAndroidPackage.__init__(self, device)
        self._path_ref = os.path.join("BENCHMARKS", "GLBENCHMARK")
        self.is_lower_better = False

        self._run_no = 0
        self._results = {"score": []}

        self.__data_path = None
        self.__drive_version = None
        self.__version = None
        self.__selected_tests_xml = None
        self.__main_menu = None
        self.__result_file = None

        self.__tests = {}
        self.__report_path = None
        self.__glb_start_command = [
            "move_home", "dpad_center", "dpad_right", "enter"
        ]
        self.__regex_test_result = "FinishCurrentTest.*\(.*frames\s(?P<result>[\d]*).*FPS"
        self.__test_name = None
        self.__test_dic = {
            "glbenchmark21": {
                "EgyptStandard": "Egypt_Standard",
                "EgyptOffScreen": "Egypt_OffScreen",
                "ProStandard": "Pro_Standard",
                "ProOffScreen": "Pro_OffScreen"
            },
            "glbenchmark25": {
                "EgyptHD": "EgyptHD_C24Z16_ETC1",
                "EgyptHDOffScreen": "EgyptHD_C24Z16_ETC1_OffScreen",
                "EgyptStandard": "EgyptHD_C16Z16_ETC1",
                "EgyptOffScreen": "EgyptHD_C16Z16_ETC1_OffScreen"
            },
            "glbenchmark27": {
                "TRexHD": "TRexHD_C24Z16_ETC1_OnScreen",
                "TRexHDOffScreen": "TRexHD_C24Z16_ETC1_OffScreen",
                "EgyptHD": "EgyptHD_C24Z16_OnScreen",
                "EgyptHDOffScreen": "EgyptHD_C24Z16_OffScreen"
            }
        }
Beispiel #26
0
    def start(self):
        """
        Start application
        """
        # Clean cache before starting
        cmd = "find %s -maxdepth 1 -mindepth 1"\
              "|grep -v lib|grep -v shared_prefs"\
              "|xargs rm -r && echo 0" % self.__data_path
        self.adb_shell(cmd, 10)
        version = self._get_version()
        if "4.0.3" in version:
            self._results = self._result_v4
        elif "5.6" in version:
            self._results = self._result_v5

        IAndroidPackage.start(self)
Beispiel #27
0
    def __launch_basemark(self):
        """
        Launch basemark
        """
        self._logger.debug("Basemark - launch test case")
        egl_not_available = "requested EGL_DEPTH_SIZE not available"
        self._get_device_logger().add_trigger_message(egl_not_available)

        IAndroidPackage.start(self)

        if self._get_device_logger().is_message_received(egl_not_available, 5):
            self.__disable_egl = True

        self._get_device_logger().remove_trigger_message(egl_not_available)

        return self.__wait_app_init()
Beispiel #28
0
    def post_install(self):
        """
        Post-installation actions
        """
        self._logger.debug("++ clear logcat buffer")
        PCCGUtilities.clear_logcat()

        self._logger.info("++ start app")
        IAndroidPackage.start(self)

        self._logger.info("++ wait till [OK, let's go! button] is displayed")
        # 10 minutes max timeout
        for _ in range(600):
            time.sleep(1)
            ok_shown = PCCGUtilities.find_in_logcat(
                pat='onProductModelChange',
                l_opt='BaseWebViewFragmentActivity:I *:S')
            if isinstance(ok_shown, str):
                self._logger.info("++ OK button displayed")
                time.sleep(5)
                break
        else:
            raise DeviceException(
                "Could not find OK button on the welcome window")

        self._logger.info("++ press OK button")
        command = ["DPAD_DOWN", "ENTER"]
        self._keyevent.scenario(command, 2.0)

        self._logger.info("++ wait while searching .dlc files")
        # 30 minutes max timeout
        for _ in range(1800):
            time.sleep(1)
            dlc_inst = PCCGUtilities.find_in_logcat(
                pat='dlcState\\":\\"INSTALLED',
                l_opt='BaseWebViewFragment:E *:S')
            if isinstance(dlc_inst, str):
                self._logger.info("++ dlc files installed")
                time.sleep(10)
                break
        else:
            raise DeviceException("Application failed to install .dlc files")

        self._logger.info("++ go to Home screen")
        self._keyevent.scenario(["BACK", "BACK", "BACK", "HOME"], 2.0)

        self.clear_cache()
Beispiel #29
0
    def __init__(self, device):
        """
        Initializes this instance.

        Nothing to be done in abstract class.
        """
        IAndroidPackage.__init__(self, device)
        self._path_ref = os.path.join("BENCHMARKS", "BASEMARK")
        self.is_lower_better = False

        self.__disable_egl = False
        self._result = None
        self.__basemark_test = None
        self.__score = None
        self.__tests = ["TAIJI", "HOVERJET"]
        self._results = {"score": []}
        self.__app_log = "/sdcard/rightware/basemarkes2v1/fm_mobile_app_log.txt"
Beispiel #30
0
    def __init__(self, device):
        """
        Initializes this instance.

        @type device: Device
        @param device: The DUT
        """
        IAndroidPackage.__init__(self, device)
        self.is_lower_better = False
        self.__count = 0
        self.html5_cords = 0
        self.__device = device
        self.TIMEOUT = 10
        self.__pattern = ".*=\"%s\" value=\"(?P<result>[0-9\.]+)\".*"
        self._results = {"chapter-html5-score": []}
        self.result_file_name = "/data/data/com.quicinc.vellamo/shared_prefs/v2sp.xml"
        self._path_ref = os.path.join("BENCHMARKS", "VELLAMO")