def execute_command(self, final_command=False, vm=None): write_output = final_command or self.is_gate cmd = self.command if final_command and vm is not None: # only apply the command manipulation hooks when running the final image cmd = mx.apply_command_mapper_hooks(cmd, vm.command_mapper_hooks) self.exit_code = self.config.bmSuite.run_stage( self.current_stage, cmd, self.stdout(write_output), self.stderr(write_output), self.cwd, False) if "image" not in self.current_stage and self.config.bmSuite.validateReturnCode( self.exit_code): self.exit_code = 0
def run_launcher(self, cmd, args, cwd): """Run the 'cmd' command in the 'bin' directory.""" args = self.post_process_launcher_command_line_args(args) self.extract_vm_info(args) mx.log("Running '{}' on '{}' with args: '{}'".format( cmd, self.name(), " ".join(args))) out = mx.TeeOutputCapture(mx.OutputCapture()) command = [os.path.join(self.home(), 'bin', cmd)] + args command = mx.apply_command_mapper_hooks(command, self.command_mapper_hooks) code = mx.run(command, out=out, err=out, cwd=cwd, nonZeroIsFatal=False) out = out.underlying.data dims = self.dimensions(cwd, args, code, out) return code, out, dims
def run_java(self, args, out=None, err=None, cwd=None, nonZeroIsFatal=False): """Run 'java' workloads.""" self.extract_vm_info(args) cmd = self.generate_java_command(args) cmd = mx.apply_command_mapper_hooks(cmd, self.command_mapper_hooks) return mx.run(cmd, out=out, err=err, cwd=cwd, nonZeroIsFatal=nonZeroIsFatal)
def apply_command_mapper_hooks(self, cmd, vm): return mx.apply_command_mapper_hooks(cmd, vm.command_mapper_hooks)