Exemplo n.º 1
0
    def initialize(self, context):  # pylint: disable=no-self-use
        if self.target.get_sdk_version() < 23:
            raise WorkloadError("This workload relies on ``dumpsys gfxinfo`` \
                                 only present in Android M and onwards")

        defs_host = context.get_resource(File(self, "defs.sh"))
        Recentfling.defs_target = self.target.install(defs_host)
        recentfling_host = context.get_resource(File(self, "recentfling.sh"))
        Recentfling.recentfling_target = self.target.install(recentfling_host)
Exemplo n.º 2
0
 def _get_raw_json_config(self, resolver):
     if os.path.splitext(self.config)[1] != '.json':
         self.config += '.json'
     if os.path.isfile(self.config):
         return os.path.abspath(self.config)
     partial_path = os.path.join('use_cases', self.config)
     return resolver.get(File(self, partial_path))
Exemplo n.º 3
0
    def initialize(self, context):
        super(Speedometer, self).initialize(context)
        self.archive_server = ArchiveServer()
        if not self.target.is_rooted:
            raise WorkloadError(
                "Device must be rooted for the speedometer workload currently"
            )

        if self.target.adb_server is not None:
            raise WorkloadError(
                "Workload does not support the adb_server parameter, due to the webpage "
                "hosting mechanism."
            )

        # Temporary directory used for storing the Speedometer files, uiautomator
        # dumps, and modified XML chrome config files.
        self.temp_dir = tempfile.TemporaryDirectory()
        self.document_root = os.path.join(self.temp_dir.name, "document_root")

        # Host a copy of Speedometer locally
        tarball = context.get_resource(File(self, "speedometer_archive.tgz"))
        with tarfile.open(name=tarball) as handle:
            handle.extractall(self.temp_dir.name)
        self.archive_server.start(self.document_root, self.target)
        self.webserver_port = self.archive_server.get_port()

        self.speedometer_url = "http://localhost:{}/Speedometer2.0/index.html".format(
            self.webserver_port
        )
Exemplo n.º 4
0
 def initialize(self, context):
     # initialize() runs once per run. setting a class variable to make it
     # available to other instances of the workload
     RtApp.target_working_directory = self.target.path.join(self.target.working_directory,
                                                            'rt-app-working')
     RtApp.host_binary = context.get_resource(Executable(self,
                                                         self.target.abi,
                                                         BINARY_NAME), strict=False)
     RtApp.workgen_script = context.get_resource(File(self, 'workgen'))
     self.target.execute('mkdir -p {}'.format(self.target_working_directory))
     self._deploy_rt_app_binary_if_necessary()
Exemplo n.º 5
0
 def initialize(self, context):  # pylint: disable=unused-argument
     self.host_script = context.get_resource(File(self, 'gather-load.sh'))
     self.target_script = self.target.install(self.host_script)
     self.target_output = self.target.get_workpath('proc-stat-raw.csv')
     self.stop_file = self.target.get_workpath('proc-stat-stop.signal')