def _do_test(self, profile, exp_phases):
        rtapp = RTA.from_profile(
            self.target, name='test', profile=profile, res_dir=self.res_dir,
            calibration=None, log_stats=True)

        with rtapp:
            with open(rtapp.local_json) as f:
                conf = json.load(f)

            # Check that the configuration looks like we expect it to
            phases = list(conf['tasks']['test']['phases'].values())
            assert len(phases) == len(exp_phases), 'Wrong number of phases'
            for phase, exp_phase in zip(phases, exp_phases):
                assert phase == exp_phase

            # Try running the workload and check that it produces the expected log
            # files
            rtapp.run()

        # rtapp_cmds = [c for c in self.target.executed_commands if 'rt-app' in c]
        # assert rtapp_cmds == [self.get_expected_command(rtapp)]

        self.assert_output_file_exists('stdout.log')
        self.assert_output_file_exists('stderr.log')
        self.assert_output_file_exists('test.json')
        self.assert_output_file_exists('rt-app-test-0.log')
示例#2
0
    def _get_calib_conf(self, calibration):
        profile = {
            "test":
            RTAPhase(prop_wload=PeriodicWload(
                duty_cycle_pct=50,
                period=100e-3,
                duration=1,
            ))
        }
        rtapp = RTA.from_profile(self.target,
                                 name='test',
                                 res_dir=self.res_dir,
                                 profile=profile,
                                 calibration=calibration)

        with open(rtapp.local_json) as fh:
            return json.load(fh)['global']['calibration']