예제 #1
0
    def initialize(self, context):
        if not self.target.is_rooted:
            raise WorkloadError('stress-ng requires root premissions to run')

        resource = Executable(self, self.target.abi, 'stress-ng')
        host_exe = context.get_resource(resource)
        StressNg.binary = self.target.install(host_exe)
예제 #2
0
    def initialize(self, context):
        if not self.target.is_rooted and self.as_root:
            raise ConfigError(
                'The target is not rooted, cannot run poller as root.')
        host_poller = context.get_resource(
            Executable(self, self.target.abi, "poller"))
        target_poller = self.target.install(host_poller)

        expanded_paths = []
        for path in self.files:
            if "*" in path:
                for p in self.target.list_directory(path):
                    expanded_paths.append(p)
            else:
                expanded_paths.append(path)
        self.files = expanded_paths
        if not self.labels:
            self.labels = self._generate_labels()

        self.target_output_path = self.target.path.join(
            self.target.working_directory, 'poller.csv')
        self.target_log_path = self.target.path.join(
            self.target.working_directory, 'poller.log')
        marker_option = ''
        if self.align_with_ftrace:
            marker_option = '-m'
            signal.connect(self._adjust_timestamps,
                           signal.AFTER_JOB_OUTPUT_PROCESSED)
        self.command = '{} -t {} {} -l {} {} > {} 2>{}'.format(
            target_poller, self.sample_interval * 1000, marker_option,
            ','.join(self.labels), ' '.join(self.files),
            self.target_output_path, self.target_log_path)
예제 #3
0
 def initialize(self, context):
     self.exe_name = '{}_bench'.format(self.test)
     if self.exe_name not in self.installed:
         resource = Executable(self, self.target.abi, self.exe_name)
         host_exe = context.get_resource(resource)
         self.target.killall(self.exe_name)
         self.installed[self.exe_name] = self.target.install(host_exe)
     self.target_exe = self.installed[self.exe_name]
예제 #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()
예제 #5
0
    def setup(self, context):

        abi = self.target.abi
        if self.force_abi:
            abi = self.force_abi

        # self.test has been pre-validated, so this _should_ only fail if there's an abi mismatch
        host_exe = context.resolver.get(Executable(self, abi, self.test))
        self.target_exe = self.target.install(host_exe)
        self.commands = []

        setup_test = getattr(self, '_setup_{}'.format(self.test))
        setup_test()
예제 #6
0
 def initialize(self, context):
     if self.use_system_binary:
         try:
             cmd = '{0} md5sum < $({0} which openssl)'
             output = self.target.execute(cmd.format(self.target.busybox))
             md5hash = output.split()[0]
             version = self.target.execute('openssl version').strip()
             context.update_metadata('hashes', 'openssl', md5hash)
             context.update_metadata('versions', 'openssl', version)
         except TargetError:
             msg = 'Openssl does not appear to be installed on target.'
             raise WorkloadError(msg)
         Openssl.target_exe = 'openssl'
     else:
         resource = Executable(self, self.target.abi, 'openssl')
         host_exe = context.get_resource(resource)
         Openssl.target_exe = self.target.install(host_exe)
예제 #7
0
 def initialize(self, context):
     exe = Executable(self, self.target.abi, 'sysbench')
     host_binary = context.get_resource(exe)
     Sysbench.target_binary = self.target.install(host_binary)
예제 #8
0
 def initialize(self, context):
     host_exe = context.get_resource(
         Executable(self, self.target.abi, BINARY))
     HWUITest.target_exe = self.target.install(host_exe)
예제 #9
0
 def _install_executable(self, context):
     resource = Executable(self, self.target.abi, 'meabo')
     host_exe = context.get_resource(resource)
     Meabo.target_exe = self.target.install(host_exe)
예제 #10
0
 def initialize(self, context):
     self.binary_name = 'memcpy'
     resource = Executable(self, self.target.abi, self.binary_name)
     host_binary = context.get_resource(resource)
     Memcpy.target_exe = self.target.install_if_needed(host_binary)
예제 #11
0
 def initialize(self, context):
     host_binary = context.get_resource(
         Executable(self, self.target.abi, self.binary_name))
     Hackbench.target_binary = self.target.install(host_binary)
예제 #12
0
 def initialize(self, context):
     resource = Executable(self, self.target.abi, 'dhrystone')
     host_exe = context.get_resource(resource)
     Dhrystone.target_exe = self.target.install(host_exe)