Beispiel #1
0
def test_summary(aParameters):
    forrest_log = aParameters.forrest_log
    msg_level = aParameters.msg_lev
    if msg_level is not None:
        Msg.set_level(Msg.translate_levelstr(msg_level))

    print("Forrest log file is: %s" % forrest_log)

    work_dir, my_tmp = PathUtils.split_path(forrest_log)
    frun_path = PathUtils.append_path(
        PathUtils.include_trailing_path_delimiter(work_dir), "_def_frun.py")

    # test - timeout
    summary_queue_args = {
        "frun-path":
        frun_path,
        "process-log":
        forrest_log,
        "process-result": (
            0,
            None,
            "Process Timeout Occurred",
            1555792446.313606,
            1555792446.313606,
            SysUtils.PROCESS_TIMEOUT,
        ),
    }
    summary_queue_item = SummaryQueueItem(summary_queue_args)
    summary_item = SummaryItem({})
    summary_item.load(summary_queue_item)
    def load_message_levels(self, arg_msg_lev, arg_def_lev):

        # load from the command line if specified or use the default
        my_lev_str = self.option_def(arg_msg_lev, arg_def_lev)

        # if a (+) or a (-) is found then the command line will be appended to or demoted by
        if (my_lev_str[0] == '+') or (my_lev_str[0] == '-'):
            # use the default string to build a format string, then append the passed in value
            my_fmt_str = "%s%s%s" % (arg_def_lev, "\%", "s")
            my_lev_str = my_fmt_str % (my_lev_str)

        my_level = Msg.translate_levelstr(my_lev_str)

        Msg.set_level(my_level)
Beispiel #3
0
    def load_message_levels(self, arg_msg_lev, arg_def_lev):
        # load from the command line if specified or use the default
        my_lev_str = self.option_def(arg_msg_lev, arg_def_lev)
        #my_def = "crit+err+warn+info+noinfo"

        #my_lev_str = self.option_def( "all", my_def, "-l"  )

        # if a (+) or a (-) is found then the command line will be appended to or demoted by
        if (my_lev_str[0] == '+') or (my_lev_str[0] == '-'):
            # use the default string to build a format string, then append the passed in value
            my_fmt_str = "%s%s%s" % (arg_def_lev, "\%", "s")
            my_lev_str = my_fmt_str % (my_lev_str)

        # print( my_lev_str )
        # finally no matter what set the levels that are to be active

        my_level = Msg.translate_levelstr(my_lev_str)
        # print( "Before: %x" % my_level )

        Msg.set_level(my_level)