Ejemplo n.º 1
0
    def commit_generate( self ):

        self.force_result = SysUtils.ifthen( SysUtils.success( self.force_retcode ), "PASS", "FAIL" )
        self.force_level = SummaryLevel.Any

        if SysUtils.failed( self.force_retcode ):
            self.force_level = SummaryLevel.Fail

        Msg.lout( self, "user" , "Performance Summary Item Commit Generate" )
        if SysUtils.success( self.force_retcode ):
            self.instruction_counts( )
            Msg.info( "Instructions: %d, Default: %d, Secondary: %d, Elapsed Time: %0.5f Seconds\n\n" % ( self.count, self.default, self.secondary, self.force_end - self.force_start ))
            return 1

        return 0
Ejemplo n.º 2
0
    def report( self ):

        if self.default    is None: self.default    = 0
        if self.secondary is None: self.secondary = 0
        if self.total     is None: self.total     = 0

        Msg.info( "Task Id: %s, Task Index: %d" % ( self.task_id, self.task_index ))
        my_msg = "Process Log Contains "
        if self.detail_flags & SummaryDetail.AnyDetail   == SummaryDetail.Nothing    : my_msg = "Process No Found or is Empty"
        else:
            if self.detail_flags & SummaryDetail.ForceCmd    == SummaryDetail.ForceCmd   : my_msg += "ForceCommand, "
            if self.detail_flags & SummaryDetail.ForceResult == SummaryDetail.ForceResult: my_msg += "ForceResult, "
            if self.detail_flags & SummaryDetail.IssCmd      == SummaryDetail.IssCmd     : my_msg += "IssCommand, "
            if self.detail_flags & SummaryDetail.IssResult   == SummaryDetail.IssResult  : my_msg += "IssResult, "
            my_msg = my_msg[:-2]

        # Msg.user( my_msg )

        # Msg.info( "Originating Control File: %s"  % ( self.parent_fctrl ))
        # Msg.info( "Control File Item: %s"  % ( str(  self.fctrl_item )))
        # Msg.info( "F-Run Control File: %s" % ( self.frun_path ))
        Msg.dbg( "Force Ret Code: %s" % ( str( self.force_retcode )))
        Msg.info( "[%s], Generate Command: %s" % ( SysUtils.ifthen( SysUtils.success( self.force_retcode ), "SUCCESS", "FAILED" ), str( self.force_cmd )))
        Msg.info( "Instructions Generated - Default: %d, Secondary: %d, Total: %d" % ( self.default, self.secondary, self.total ))

        if self.iss_cmd is not None:
            if self.iss_success():
                Msg.info( "[SUCCESS], ISS Command: %s" % ( str( self.iss_cmd   )))
            else:
                Msg.info( "[FAILED], ISS Command: %s" % ( str( self.iss_cmd   )))
            #Msg.fout( self.iss_log, "user" )
        Msg.blank()
Ejemplo n.º 3
0
    def exec_gen(self, arg_task_file):

        # Msg.dbg( "ExecuteController::exec_gen( %s )" % ( arg_task_file ) )

        # NOTE: Do not change force_cmd may need to reuse!!
        # my_task_file = self.ctrl_item.file_path()

        # my_cmd = self.force_cmd % ( my_testfile, arg_testname.replace( ".py", ".gen.log" ))
        my_log = "gen.log"  # arg_testname.replace( ".py", ".gen.log" )
        my_elog = "gen.err"  # arg_testname.replace( ".py", ".gen.log" )

        my_cmd = self.force_cmd % (arg_task_file)  # , my_log )
        # Msg.dbg( "Generate Command Line: %s" % ( my_cmd ))

        # if self.ctrl_item.mode == "mock":
        #     Msg.info( "Mock Generate: " +  my_cmd )
        # else:
        Msg.info(
            "ForceCommand = " + str({
                "force-command": my_cmd,
                "force-log": my_log,
                "force-elog": my_elog,
                "max-instr": self.ctrl_item.max_instr,
                "min-instr": self.ctrl_item.min_instr
            }), True)
        Msg.flush()
        #     if self.ctrl_item.summary is not None:
        #         # update the current test with the generate cmd and the generate log file.
        #         self.ctrl_item.summary.set_gen_info( arg_task_name, arg_ndx, my_cmd, my_log )
        my_result = SysUtils.exec_process(my_cmd, my_log, my_elog,
                                          self.ctrl_item.timeout, True)

        # Msg.user( str( my_result[0] ) + ", type: " + str( type( my_result[0] )))
        my_ret_code = int(my_result[0])
        my_std_out = str(my_result[1])
        my_std_err = str(my_result[2])
        my_start = str(my_result[3])
        my_end = str(my_result[4])

        my_time_elapsed = SysUtils.ifthen(my_result[3] is not None,
                                          float(my_result[3]), 0.0)

        Msg.info("ForceResult = " + str({
            "force-retcode": my_ret_code,
            "force-stdout": my_std_out,
            "force-stderr": my_std_err,
            "force-start": my_start,
            "force-end": my_end
        }))

        return SysUtils.success(my_result[0])
Ejemplo n.º 4
0
    def commit_simulate( self ):

        self.instr_count, self.iss_message = self.extract_iss_info()
        Msg.user( "Instr Count: %d, Message: %s" % (self.instr_count, self.iss_message ))
        try:

            # check the return code for error
            if SysUtils.success( self.iss_retcode ):
                # Check to see for instruction overrun
                if int( self.instr_count ) < self.max_instr:
                    if int( self.instr_count ) >= self.min_instr:
                        self.iss_result = "PASS"
                        self.iss_level  = SummaryLevel.Any
                        return 1

            self.iss_result = "FAIL"
            self.iss_level  = SummaryLevel.Fail
            return 0
        finally:
            pass