Exemple #1
0
def coremark(filePath, outfp):
    cases = parser_log.parseData(filePath)
    result = []
    for case in cases:
        caseDict = {}
        caseDict[parser_log.BOTTOM] = parser_log.getBottom(case)
        titleGroup = re.search("\[test:([\s\S]+?)\]", case)
        if titleGroup != None:
            caseDict[parser_log.TOP] = titleGroup.group(0)

        tables = []
        tableContent = {}
        centerTopGroup = re.search("log:[\s\S]*?\n([\s\S]+for coremark\.)?\n",
                                   case)
        tableContent[parser_log.CENTER_TOP] = centerTopGroup.groups()[0]
        tableGroup = re.search("for coremark\.\n([\s\S]+)\nMemory location",
                               case)
        if tableGroup is not None:
            tableGroupContent = tableGroup.groups()[0].strip()
            table = parser_log.parseTable(tableGroupContent, ":{1,}")
            tableContent[parser_log.I_TABLE] = table
        tables.append(tableContent)
        caseDict[parser_log.TABLES] = tables
        result.append(caseDict)
    outfp.write(json.dumps(result))
    return result
Exemple #2
0
def sysbench(filePath, outfp):
    cases = parser_log.parseData(filePath)
    result = []
    for case in cases:
        caseDict = {}
        caseDict[parser_log.BOTTOM] = parser_log.getBottom(case)
        titleGroup = re.search('\[([\S\ ]+)\]\n', case)
        if titleGroup != None:
            caseDict[parser_log.TOP] = titleGroup.group(0)
            caseDict[parser_log.BOTTOM] = parser_log.getBottom(case)
        tables = []
        tableContent = {}
        centerTopGroup = re.search("(sysbench\s\d[\S\ ]+\n)", case)
        tableContent[parser_log.CENTER_TOP] = centerTopGroup.groups()[0]
        tableGroup = re.search("Threads started\!([\s\S]+)\/\d+\.\d+\n", case)
        if tableGroup is not None:
            tableGroupContent_temp = tableGroup.groups()[0].strip()
            tableGroupContent = re.sub('\+?sysbench[\-\ ]?0.5[\S\ ]+\n', '',
                                       tableGroupContent_temp)
            tableGroupContent_temp2 = re.sub('\+', '', tableGroupContent)
            table = parser_log.parseTable(tableGroupContent_temp2, ":{1,}")
            tableContent[parser_log.I_TABLE] = table
        tables.append(tableContent)
        caseDict[parser_log.TABLES] = tables
        result.append(caseDict)
    outfp.write(json.dumps(result))
    return result
Exemple #3
0
def fio(filePath, outfp):
    cases = parser_log.parseData(filePath)
    result = []
    for case in cases:
        caseDict = {}
        caseDict[parser_log.BOTTOM] = parser_log.getBottom(case)
        titleGroup = re.search('\[test:([\s\S]+)\.\.\.', case)
        if titleGroup != None:
            caseDict[parser_log.TOP] = titleGroup.group(0)
            caseDict[parser_log.BOTTOM] = parser_log.getBottom(case)
        tables = []
        tableContent = {}
        centerTopGroup = re.search("(fio\-[\s\S]+\s20\d\d\n)", case)
        tableContent[parser_log.CENTER_TOP] = centerTopGroup.groups()[0]

        tableGroup = re.search("\s20\d\d\n([\s\S]+)\[status\]", case)
        if tableGroup is not None:
            tableGroupContent = tableGroup.groups()[0].strip()
            tableGroupContent_temp = re.sub("(clat percentiles[\s\S]+\]\n)",
                                            "", tableGroupContent)
            table = parser_log.parseTable(tableGroupContent_temp, ":{1,}")
            tableContent[parser_log.I_TABLE] = table
        tables.append(tableContent)
        caseDict[parser_log.TABLES] = tables
        result.append(caseDict)
    outfp.write(json.dumps(result))
    return result
def speccpu(filePath, outfp):
    cases = parser_log.parseData(filePath)
    result = []
    for case in cases:
        caseDict = {}
        caseDict[parser_log.BOTTOM] = parser_log.getBottom(case)
        titleGroup = re.search(
            '(\s+Base\s+Base\s+Base\s+Peak\s+Peak\s+Peak\nBenchmarks\s+Ref\.\s+Run Time\s+Ratio\s+Ref\.\s+Run Time\s+Ratio)',
            case)
        if titleGroup != None:
            caseDict[parser_log.TOP] = titleGroup.group(0)
            caseDict[parser_log.BOTTOM] = parser_log.getBottom(case)
        tables = []
        tableContent = {}
        tableContent[parser_log.CENTER_TOP] = ''
        # tableGroup = re.search("(.*)SPECint\(", case)
        tableGroup = re.search(r'=======([\s\S]+)SPECint\(R\)_base2006', case)
        if tableGroup is not None:
            tableGroupContent_temp = tableGroup.groups()[0]
            table = parser_log.parseTable(tableGroupContent_temp, ":{1,}")
            tableContent[parser_log.I_TABLE] = table
        tables.append(tableContent)
        caseDict[parser_log.TABLES] = tables
        result.append(caseDict)
    outfp.write(json.dumps(result))
    return result
def tinymembench(filePath, outfp):
    cases = parser_log.parseData(filePath)
    result = []
    for case in cases:
        caseDict = {}
        caseDict[parser_log.BOTTOM] = parser_log.getBottom(case)
        titleGroup = re.search("\[test:([\s\S]+?)\]", case)
        if titleGroup != None:
            caseDict[parser_log.TOP] = titleGroup.group(0)

        tables = []
        tableContent = {}

        tableContent2 = re.findall("={4,}\n==[\s\S]+?[\n\r]{3,}", case)
        for centerTop2 in tableContent2:
            top = re.search("={4,}\n[\s\S]+?={4,}", centerTop2)
            if top is not None:
                tableContent[parser_log.CENTER_TOP] = top.group(0)
            table2 = re.search("={4,}[\n\r]{2,}([\s\S]+?)[\n\r]{3,}",
                               centerTop2)
            if table2 is not None:
                table2Content = re.sub("---", "", table2.groups()[0])
                tableContent[parser_log.I_TABLE] = parser_log.parseTable(
                    table2Content, ":")
            tables.append(copy.deepcopy(tableContent))

        leftStr = re.sub("={4,}\n==[\s\S]+?[\n\r]{3,}", "", case)

        tableContent1 = re.findall("={4,}\n[\s\S]+?\[status\]", leftStr)
        for centerTop1 in tableContent1:
            top = re.search("={4,}\n[\s\S]+?={4,}", centerTop1)
            if top is not None:
                tableContent[parser_log.CENTER_TOP] = top.group(0)
            table1 = re.search("={4,}[\n\r]{2,}([\s\S]+?)[\n\r]{3,}",
                               centerTop1)
            if table1 is not None:
                table1Content = re.sub("---", "", table1.groups()[0])
                tableContent[parser_log.I_TABLE] = parser_log.parseTable(
                    table1Content, ":")
            tables.append(copy.deepcopy(tableContent))
        caseDict[parser_log.TABLES] = tables
        result.append(caseDict)
    outfp.write(json.dumps(result))
    return result
def cachebench(filePath, outfp):
    cases = parser_log.parseData(filePath)
    result = []
    for case in cases:
        caseDict = {}
        caseDict[parser_log.BOTTOM] = parser_log.getBottom(case)
        titleGroup = re.search("\[test:([\s\S]+?)\]", case)
        if titleGroup != None:
            caseDict[parser_log.TOP] = titleGroup.group(0)

        tables = []
        tableContent = {}
        tableContent[parser_log.CENTER_TOP] = ''
        tableGroup = re.search("log:[\s\S]*?\n([\s\S]+)\[status\]", case)
        if tableGroup is not None:
            tableGroupContent = tableGroup.groups()[0].strip()
            table = parser_log.parseTable(tableGroupContent, "\\s{1,}")
            tableContent[parser_log.I_TABLE] = table
        tables.append(tableContent)
        caseDict[parser_log.TABLES] = tables
        result.append(caseDict)
    outfp.write(json.dumps(result))
    return result
def lmbench(filePath, outfp):
    cases = parser_log.parseData(filePath)
    result = []
    for case in cases:
        caseDict = {}
        caseDict[parser_log.BOTTOM] = parser_log.getBottom(case)
        tables = []
        content_dict = {}
        titleGroup = re.search("\[test:([\s\S]+?)\]", case)
        if titleGroup != None:
            caseDict[parser_log.TOP] = titleGroup.group(0)
            tool = titleGroup.groups()[0].strip()
            if tool == "lmbench lat":
                tableGroup = re.search(
                    "Simple syscall([\s\S]+)lat_pagefault:[\s\S]+?\n", case)
                if tableGroup is not None:
                    centerTopGroup = re.search(
                        "\[lmbench([\s\S]+)\[VERSION([\s\S]+?)\]", case)
                    if centerTopGroup != None:
                        content_dict[
                            parser_log.CENTER_TOP] = centerTopGroup.group(0)
                    tableGroupContent = tableGroup.group(0)
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        tableGroupContent, ":")
                    tables.append(copy.deepcopy(content_dict))

                mappingGroup = re.search("\"mappings([\s\S]+?)\"File", case)
                if mappingGroup is not None:
                    content_dict[parser_log.CENTER_TOP] = "mappings"
                    mappingGroupContent = mappingGroup.groups()[0]
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        mappingGroupContent, " ")
                    tables.append(copy.deepcopy(content_dict))

                fsLatencyGroup = re.search(
                    "\"File system latency([\s\S]+?)UDP latency", case)
                if fsLatencyGroup is not None:
                    content_dict[parser_log.CENTER_TOP] = "File system latency"
                    fsLatencyGroupContent = fsLatencyGroup.groups()[0]
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        fsLatencyGroupContent, "\\s{1,}|\t")
                    tables.append(copy.deepcopy(content_dict))
                    # UDP latency
                udpLatencyGroup = re.search("UDP latency([\s\S]+?)[\n\r]{3,}",
                                            case)
                if udpLatencyGroup is not None:
                    content_dict[parser_log.CENTER_TOP] = ""
                    udpLatencyGroupContent = udpLatencyGroup.group(0)
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        udpLatencyGroupContent, ":")
                    tables.append(copy.deepcopy(content_dict))

                sizeGroups = re.findall("\"(size=[\s\S]+?\n)([\s\S]+?)\\n{2,}",
                                        case)
                for sizeGroup in sizeGroups:
                    content_dict[parser_log.CENTER_TOP] = sizeGroup[0]
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        sizeGroup[1], " ")
                    tables.append(copy.deepcopy(content_dict))

                # Memory load parallelism
                memoryLoadGroup = re.search(
                    "STREAM copy[\s\S]+STREAM2[\s\S]+?\n", case)
                if memoryLoadGroup is not None:
                    content_dict[
                        parser_log.CENTER_TOP] = "Memory load parallelism"
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        memoryLoadGroup.group(0), ":")
                    tables.append(copy.deepcopy(content_dict))
                # Memory load latency
                mlLatencyContentGroups = re.search(
                    "Memory load latency([\s\S]+?)[\n\r]{3,}", case)
                if mlLatencyContentGroups is not None:
                    mlLatencyContent = mlLatencyContentGroups.group(0)
                    mlLatencyGroups = re.findall(
                        "\"(stride=[\s\S]+?\n)([\s\S]+?)[\n\r]{2,}",
                        mlLatencyContent)
                    for index, mlLatencyGroup in enumerate(mlLatencyGroups):
                        if index == 0:
                            content_dict[
                                parser_log.
                                CENTER_TOP] = "Memory load latency\n" + mlLatencyGroup[
                                    0]
                        else:
                            content_dict[
                                parser_log.CENTER_TOP] = mlLatencyGroup[0]
                        content_dict[
                            parser_log.I_TABLE] = parser_log.parseTable(
                                mlLatencyGroup[1], " ")
                        tables.append(copy.deepcopy(content_dict))
                # Random load latency
                rlLatencyContentGroups = re.search(
                    "Random load latency([\s\S]+?)[\n\r]{3,}", case)
                if rlLatencyContentGroups is not None:
                    rlLatencyContent = rlLatencyContentGroups.group(0)
                    rlLatencyGroups = re.findall(
                        "\"(stride=[\s\S]+?\n)([\s\S]+?)[\n\r]{2,}",
                        rlLatencyContent)
                    for index, rlLatencyGroup in enumerate(rlLatencyGroups):
                        if index == 0:
                            content_dict[
                                parser_log.
                                CENTER_TOP] = "Random load latency\n" + rlLatencyGroup[
                                    0]
                        else:
                            content_dict[
                                parser_log.CENTER_TOP] = rlLatencyGroup[0]
                        content_dict[
                            parser_log.I_TABLE] = parser_log.parseTable(
                                rlLatencyGroup[1], " ")
                        tables.append(copy.deepcopy(content_dict))
                caseDict[parser_log.TABLES] = tables
            if tool == "lmbench bandwidth":
                tableGroup = re.search("File([\s\S]+)lat_pagefault:[\s\S]+?\n",
                                       case)
                if tableGroup is not None:
                    centerTopGroup = re.search(
                        "\[lmbench([\s\S]+)\[VERSION([\s\S]+?)\]", case)
                    if centerTopGroup != None:
                        content_dict[
                            parser_log.CENTER_TOP] = centerTopGroup.group(0)
                    tableGroupContent = tableGroup.group(0)
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        tableGroupContent, ":")
                    tables.append(copy.deepcopy(content_dict))
                mappingGroup = re.search("\"mappings([\s\S]+?)\"File", case)
                if mappingGroup is not None:
                    content_dict[parser_log.CENTER_TOP] = "mappings"
                    mappingGroupContent = mappingGroup.groups()[0]
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        mappingGroupContent, " ")
                    tables.append(copy.deepcopy(content_dict))

                fsLatencyGroup = re.search(
                    "\"File system latency([\s\S]+?)[\n\r]{2,}", case)
                if fsLatencyGroup is not None:
                    content_dict[parser_log.CENTER_TOP] = "File system latency"
                    fsLatencyGroupContent = fsLatencyGroup.groups()[0]
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        fsLatencyGroupContent, "\\s{1,}|\t")
                    tables.append(copy.deepcopy(content_dict))
                # UDP latency
                udpLatencyGroup = re.search("UDP latency([\s\S]+?)[\n\r]{2,}",
                                            case)
                if udpLatencyGroup is not None:
                    content_dict[parser_log.CENTER_TOP] = ""
                    udpLatencyGroupContent = udpLatencyGroup.group(0)
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        udpLatencyGroupContent, ":")
                    tables.append(copy.deepcopy(content_dict))

                # Socket bandwidth using localhost
                sbGroups = re.search(
                    "Socket bandwidth using localhost([\s\S]+?)[\n\r]{2,}",
                    case)
                if sbGroups is not None:
                    sbGroupContent = sbGroups.groups()[0]
                    content_dict[parser_log.CENTER_TOP] = "11111"
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        sbGroupContent, "\\s{1,}", 1)
                    tables.append(copy.deepcopy(content_dict))
                # Avg xfer
                sbGroups = re.search("Avg xfer([\s\S]+?)[\n\r]{2,}", case)
                if sbGroups is not None:
                    sbGroupContent = sbGroups.group(0)
                    content_dict[parser_log.CENTER_TOP] = ""
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        sbGroupContent, ":")
                    tables.append(copy.deepcopy(content_dict))

                sizeGroups = re.findall(
                    "\"(read[\s\S]+?\n)([\s\S]+?)[\n\r]{2,}", case)
                for sizeGroup in sizeGroups:
                    content_dict[parser_log.CENTER_TOP] = sizeGroup[0]
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        sizeGroup[1], " ")
                    tables.append(copy.deepcopy(content_dict))

                sizeGroups = re.findall(
                    "\"(Mmap[\s\S]+?\n)([\s\S]+?)[\n\r]{2,}", case)
                for sizeGroup in sizeGroups:
                    content_dict[parser_log.CENTER_TOP] = sizeGroup[0]
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        sizeGroup[1], " ")
                    tables.append(copy.deepcopy(content_dict))

                sizeGroups = re.findall(
                    "\"(libc[\s\S]+?\n)([\s\S]+?)[\n\r]{2,}", case)
                for sizeGroup in sizeGroups:
                    content_dict[parser_log.CENTER_TOP] = sizeGroup[0]
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        sizeGroup[1], " ")
                    tables.append(copy.deepcopy(content_dict))

                sizeGroups = re.findall(
                    "(Memory[\s\S]+?\n)([\s\S]+?)[\n\r]{2,}", case)
                for sizeGroup in sizeGroups:
                    content_dict[parser_log.CENTER_TOP] = sizeGroup[0]
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        sizeGroup[1], " ")
                    tables.append(copy.deepcopy(content_dict))

                sizeGroups = re.findall(
                    "\"(unrolled[\s\S]+?\n)([\s\S]+?)[\n\r]{2,}", case)
                for sizeGroup in sizeGroups:
                    content_dict[parser_log.CENTER_TOP] = sizeGroup[0]
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        sizeGroup[1], " ")
                    tables.append(copy.deepcopy(content_dict))
                caseDict[parser_log.TABLES] = tables
            if tool == "lmbench latency local_die_1_core":
                groups = re.search(
                    "Local memory[\s\S]+\"stride=([\s\S]+?)[\n]", case)
                if groups is not None:
                    content_dict[parser_log.CENTER_TOP] = groups.group(0)
                sizeGroups = re.findall(
                    "\"(stride[\s\S]+?\n)([\s\S]+?)[\n\r]{2,}", case)
                for sizeGroup in sizeGroups:
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        sizeGroup[1], " ")
                    tables.append(copy.deepcopy(content_dict))
                caseDict[parser_log.TABLES] = tables

            if tool == "lmbench latency local_die_4_core":
                groups = re.search(
                    "Local memory[\s\S]+\"stride=([\s\S]+?)[\n]", case)
                if groups is not None:
                    content_dict[parser_log.CENTER_TOP] = groups.group(0)
                sizeGroups = re.findall(
                    "\"(stride[\s\S]+?\n)([\s\S]+?)[\n\r]{2,}", case)
                for sizeGroup in sizeGroups:
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        sizeGroup[1], " ")
                    tables.append(copy.deepcopy(content_dict))
                caseDict[parser_log.TABLES] = tables

            if tool == "lmbench bandwidth local_die_1_core" or tool == "lmbench bandwidth local_die_4_core" \
                    or tool == "lmbench bandwidth local_die_16_core" or tool == "lmbench bandwidth local_die_32_core" \
                    or tool == "lmbench bandwidth local_die_64_core":
                sizeGroups = re.findall(
                    "\"([\s\S]+?\\nCommand[\s\S]+?\\n)([\s\S]+?\\n)", case)
                for sizeGroup in sizeGroups:
                    content_dict[parser_log.CENTER_TOP] = sizeGroup[0]
                    content_dict[parser_log.I_TABLE] = parser_log.parseTable(
                        sizeGroup[1], " ")
                    tables.append(copy.deepcopy(content_dict))
                caseDict[parser_log.TABLES] = tables
        result.append(caseDict)
    outfp.write(json.dumps(result))
    return result
def iperf(filePath, outfp):
    cases = parser_log.parseData(filePath)
    result = []
    for case in cases:
        caseDict = {}
        caseDict[parser_log.BOTTOM] = parser_log.getBottom(case)
        titleGroup = re.search("\[test:([\s\S]+?)\]", case)
        testcase = ""
        if titleGroup != None:
            testcase = titleGroup.groups()[0].strip()
            caseDict[parser_log.TOP] = titleGroup.group(0)

        tables = []
        tableContent = {}
        if testcase == "iperf TCP_sin_1_tx" or testcase == "iperf TCP_sin_1_rx":
            center_top = re.search("Connecting[\s\S]+?\n", case)
            if center_top is not None:
                tableContent[parser_log.CENTER_TOP] = center_top.group(0)
            tc = re.search("(\[ ID\][\s\S]+\n)(- ){3,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                merges = [[2, 3], [4, 5], [6, 7], [9, 10]]
                tableContent[parser_log.TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges, [1])
                tables.append(copy.deepcopy(tableContent))

            tc = re.search("- - -\n(\[ ID\][\s\S]+\n)[\n\r]{1,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                merges = [[2, 3], [4, 5], [6, 7]]
                tableContent[parser_log.TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges, [1], [[1, 6], [3, 5]])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))
        if testcase == "iperf TCP_sin_3_tx" or testcase == "iperf TCP_sin_3_rx":
            center_top = re.search("Connecting[\s\S]+?\n", case)
            if center_top is not None:
                tableContent[parser_log.CENTER_TOP] = center_top.group(0)
            tc = re.search("(\[ ID\][\s\S]+?\n)(- ){3,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                merges = [[2, 3], [4, 5], [6, 7], [9, 10]]
                tableContent[parser_log.TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges, [1], [[5, 6]])
                tables.append(copy.deepcopy(tableContent))
            split_content = re.sub("\[  4\][\s\S]+?\[  8\][\s\S]+?\n", "",
                                   case, 1)
            tc_groups = re.findall("(\[  4\][\s\S]+?\n\[SUM\][\s\S]+?\n)- - -",
                                   split_content)
            for tc in tc_groups:
                content = re.sub("\(omitted\)|\[|\]", "", tc)
                merges = [[2, 3], [4, 5], [6, 7], [9, 10]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges, adds=[[4, 6]])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))
            nowContent = re.sub("(\[ ID\][\s\S]+?\n)(- ){3,}", "",
                                split_content)
            tc_groups = re.search("(\[ ID\] [\s\S]+\n\[SUM\][\s\S]+?\n)",
                                  nowContent)
            if tc_groups is not None:
                content = re.sub("\(omitted\)|\[|\]", "",
                                 tc_groups.groups()[0])
                merges = [[2, 3], [4, 5], [6, 7]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content,
                    "\\s{1,}",
                    merges, [1],
                    adds=[[3, 5], [5, 5], [7, 5], [9, 5]])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))

        if testcase == "iperf TCP_sin_4_tx" or testcase == "iperf TCP_sin_4_rx":
            center_top = re.search("Connecting[\s\S]+?\n", case)
            if center_top is not None:
                tableContent[parser_log.CENTER_TOP] = center_top.group(0)
            tc = re.search("(\[ ID\][\s\S]+?\n)(- ){3,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                merges = [[2, 3], [4, 5], [6, 7], [9, 10]]
                tableContent[parser_log.TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges, [1], [[6, 6]])
                tables.append(copy.deepcopy(tableContent))
            split_content = re.sub("\[  4\][\s\S]+?\[  8\][\s\S]+?\n", "",
                                   case, 1)
            tc_groups = re.findall("(\[  4\][\s\S]+?\n\[SUM\][\s\S]+?\n)- - -",
                                   split_content)
            for tc in tc_groups:
                content = re.sub("\(omitted\)|\[|\]", "", tc)
                merges = [[2, 3], [4, 5], [6, 7], [9, 10]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges, adds=[[5, 6]])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))
            nowContent = re.sub("(\[ ID\][\s\S]+?\n)(- ){3,}", "",
                                split_content)
            tc_groups = re.search("(\[ ID\] [\s\S]+\n\[SUM\][\s\S]+?\n)",
                                  nowContent)
            if tc_groups is not None:
                content = re.sub("\(omitted\)|\[|\]", "",
                                 tc_groups.groups()[0])
                merges = [[2, 3], [4, 5], [6, 7]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content,
                    "\\s{1,}",
                    merges, [1],
                    adds=[[3, 5], [5, 5], [7, 5], [9, 5]])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))

        if testcase == "iperf TCP_sin_5_tx" or testcase == "iperf TCP_sin_5_rx":
            center_top = re.search("Connecting[\s\S]+?\n", case)
            if center_top is not None:
                tableContent[parser_log.CENTER_TOP] = center_top.group(0)
            tc = re.search("(\[ ID\][\s\S]+?\n)(- ){3,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                merges = [[2, 3], [4, 5], [6, 7], [9, 10]]
                tableContent[parser_log.TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges, [1], [[7, 6]])
                tables.append(copy.deepcopy(tableContent))
            split_content = re.sub("\[  4\][\s\S]+?\[  8\][\s\S]+?\n", "",
                                   case, 1)
            tc_groups = re.findall("(\[  4\][\s\S]+?\n\[SUM\][\s\S]+?\n)- - -",
                                   split_content)
            for tc in tc_groups:
                content = re.sub("\(omitted\)|\[|\]", "", tc)
                merges = [[2, 3], [4, 5], [6, 7], [9, 10]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges, adds=[[6, 6]])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))
            nowContent = re.sub("(\[ ID\][\s\S]+?\n)(- ){3,}", "",
                                split_content)
            tc_groups = re.search("(\[ ID\] [\s\S]+\n\[SUM\][\s\S]+?\n)",
                                  nowContent)
            if tc_groups is not None:
                content = re.sub("\(omitted\)|\[|\]", "",
                                 tc_groups.groups()[0])
                merges = [[2, 3], [4, 5], [6, 7]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content,
                    "\\s{1,}",
                    merges, [1],
                    adds=[[3, 5], [5, 5], [7, 5], [9, 5], [11, 5], [13, 5]])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))
        if testcase == "iperf TCP_sin_10_tx" or testcase == "iperf TCP_sin_10_rx":
            center_top = re.search("Connecting[\s\S]+?\n", case)
            if center_top is not None:
                tableContent[parser_log.CENTER_TOP] = center_top.group(0)
            tc = re.search("(\[ ID\][\s\S]+?\n)(- ){3,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                merges = [[2, 3], [4, 5], [6, 7], [9, 10]]
                tableContent[parser_log.TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges, [1], [[12, 6]])
                tables.append(copy.deepcopy(tableContent))
            split_content = re.sub("\[  4\][\s\S]+?\[  8\][\s\S]+?\n", "",
                                   case, 1)
            tc_groups = re.findall("(\[  4\][\s\S]+?\n\[SUM\][\s\S]+?\n)- - -",
                                   split_content)
            for tc in tc_groups:
                content = re.sub("\(omitted\)|\[|\]", "", tc)
                merges = [[2, 3], [4, 5], [6, 7], [9, 10]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges, adds=[[11, 6]])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))
            nowContent = re.sub("(\[ ID\][\s\S]+?\n)(- ){3,}", "",
                                split_content)
            tc_groups = re.search("(\[ ID\] [\s\S]+\n\[SUM\][\s\S]+?\n)",
                                  nowContent)
            if tc_groups is not None:
                content = re.sub("\(omitted\)|\[|\]", "",
                                 tc_groups.groups()[0])
                merges = [[2, 3], [4, 5], [6, 7]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content,
                    "\\s{1,}",
                    merges, [1],
                    adds=[[3, 5], [5, 5], [7, 5], [9, 5], [11, 5], [13, 5],
                          [15, 5], [17, 5], [19, 5], [21, 5], [23, 5]])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))

        if testcase == "iperf UDP_sin_1_tx":
            center_top = re.search("Connecting[\s\S]+?\n", case)
            if center_top is not None:
                tableContent[parser_log.CENTER_TOP] = center_top.group(0)
            tc = re.search("(\[ ID\][\s\S]+\n)(- ){3,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                title_merges = [[5, 6]]
                merges = [[2, 3], [4, 5], [6, 7]]
                tableContent[
                    parser_log.TABLE] = parser_log.parseMergeTitleTable(
                        content, "\\s{1,}", merges, title_merges)
                tables.append(copy.deepcopy(tableContent))

            tc = re.search("- - -\n(\[ ID\][\s\S]+\n)[\n\r]{1,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                title_merges = [[6, 7]]
                merges = [[2, 3], [4, 5], [6, 7], [8, 9]]
                tableContent[
                    parser_log.TABLE] = parser_log.parseMergeTitleTable(
                        content, "\\s{1,}", merges, title_merges, [3])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))

        if testcase == "iperf UDP_sin_1_rx":
            center_top = re.search("Connecting[\s\S]+?\n", case)
            if center_top is not None:
                tableContent[parser_log.CENTER_TOP] = center_top.group(0)
            tc = re.search("(\[ ID\][\s\S]+\n)(- ){3,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                title_merges = [[6, 7]]
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[
                    parser_log.TABLE] = parser_log.parseMergeTitleTable(
                        content, "\\s{1,}", merges, title_merges)
                tables.append(copy.deepcopy(tableContent))

            tc = re.search("- - -\n(\[ ID\][\s\S]+\n)[\n\r]{1,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                title_merges = [[6, 7]]
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[
                    parser_log.TABLE] = parser_log.parseMergeTitleTable(
                        content, "\\s{1,}", merges, title_merges, [3, 5, 7])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))

        if testcase == "iperf UDP_sin_3_tx":
            center_top = re.search("Connecting[\s\S]+?\n", case)
            if center_top is not None:
                tableContent[parser_log.CENTER_TOP] = center_top.group(0)
            tc = re.search("(\[ ID\][\s\S]+?\n)(- ){3,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                title_merges = [[5, 6]]
                merges = [[2, 3], [4, 5], [6, 7]]
                tableContent[
                    parser_log.TABLE] = parser_log.parseMergeTitleTable(
                        content,
                        "\\s{1,}",
                        merges,
                        title_merges,
                    )
                tables.append(copy.deepcopy(tableContent))
            split_content = re.sub("\[  4\][\s\S]+?\[  8\][\s\S]+?\n", "",
                                   case, 1)
            tc_groups = re.findall("(\[  4\][\s\S]+?\n\[SUM\][\s\S]+?\n)- - -",
                                   split_content)
            for tc in tc_groups:
                content = re.sub("\(omitted\)|\[|\]", "", tc)
                merges = [[2, 3], [4, 5], [6, 7]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges)
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))
            nowContent = re.sub("(\[ ID\][\s\S]+?\n)(- ){3,}", "",
                                split_content)
            tc_groups = re.search("(\[ ID\] [\s\S]+\n\[SUM\][\s\S]+?\n)",
                                  nowContent)
            if tc_groups is not None:
                content = re.sub("\(omitted\)|\[|\]", "",
                                 tc_groups.groups()[0])
                title_merges = [[6, 7]]
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[parser_log.TABLE] = ""
                tableContent[
                    parser_log.I_TABLE] = parser_log.parseMergeTitleTable(
                        content, "\\s{1,}", merges, title_merges, [3, 5, 7])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))

        if testcase == "iperf UDP_sin_3_rx":
            center_top = re.search("Connecting[\s\S]+?\n", case)
            if center_top is not None:
                tableContent[parser_log.CENTER_TOP] = center_top.group(0)
            tc = re.search("(\[ ID\][\s\S]+?\n)(- ){3,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                title_merges = [[6, 7]]
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[
                    parser_log.TABLE] = parser_log.parseMergeTitleTable(
                        content,
                        "\\s{1,}",
                        merges,
                        title_merges,
                    )
                tables.append(copy.deepcopy(tableContent))
            split_content = re.sub("\[  4\][\s\S]+?\[  8\][\s\S]+?\n", "",
                                   case, 1)
            tc_groups = re.findall("(\[  4\][\s\S]+?\n\[SUM\][\s\S]+?\n)- - -",
                                   split_content)
            for tc in tc_groups:
                content = re.sub("\(omitted\)|\[|\]", "", tc)
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges)
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))
            nowContent = re.sub("(\[ ID\][\s\S]+?\n)(- ){3,}", "",
                                split_content)
            tc_groups = re.search("(\[ ID\] [\s\S]+\n\[SUM\][\s\S]+?\n)",
                                  nowContent)
            if tc_groups is not None:
                content = re.sub("\(omitted\)|\[|\]", "",
                                 tc_groups.groups()[0])
                title_merges = [[6, 7]]
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[parser_log.TABLE] = ""
                tableContent[
                    parser_log.I_TABLE] = parser_log.parseMergeTitleTable(
                        content, "\\s{1,}", merges, title_merges, [3, 5, 7])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))

        if testcase == "iperf UDP_sin_5_tx":
            center_top = re.search("Connecting[\s\S]+?\n", case)
            if center_top is not None:
                tableContent[parser_log.CENTER_TOP] = center_top.group(0)
            tc = re.search("(\[ ID\][\s\S]+?\n)(- ){3,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                title_merges = [[5, 6]]
                merges = [[2, 3], [4, 5], [6, 7]]
                tableContent[
                    parser_log.TABLE] = parser_log.parseMergeTitleTable(
                        content,
                        "\\s{1,}",
                        merges,
                        title_merges,
                    )
                tables.append(copy.deepcopy(tableContent))
            split_content = re.sub("\[  4\][\s\S]+?\[  8\][\s\S]+?\n", "",
                                   case, 1)
            tc_groups = re.findall("(\[  4\][\s\S]+?\n\[SUM\][\s\S]+?\n)- - -",
                                   split_content)
            for tc in tc_groups:
                content = re.sub("\(omitted\)|\[|\]", "", tc)
                merges = [[2, 3], [4, 5], [6, 7]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges)
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))
            nowContent = re.sub("(\[ ID\][\s\S]+?\n)(- ){3,}", "",
                                split_content)
            tc_groups = re.search("(\[ ID\] [\s\S]+\n\[SUM\][\s\S]+?\n)",
                                  nowContent)
            if tc_groups is not None:
                content = re.sub("\(omitted\)|\[|\]", "",
                                 tc_groups.groups()[0])
                title_merges = [[6, 7]]
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[parser_log.TABLE] = ""
                tableContent[
                    parser_log.I_TABLE] = parser_log.parseMergeTitleTable(
                        content, "\\s{1,}", merges, title_merges,
                        [3, 5, 7, 11])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))

        if testcase == "iperf UDP_sin_5_rx":
            center_top = re.search("Connecting[\s\S]+?\n", case)
            if center_top is not None:
                tableContent[parser_log.CENTER_TOP] = center_top.group(0)
            tc = re.search("(\[ ID\][\s\S]+?\n)(- ){3,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                title_merges = [[6, 7]]
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[
                    parser_log.TABLE] = parser_log.parseMergeTitleTable(
                        content,
                        "\\s{1,}",
                        merges,
                        title_merges,
                    )
                tables.append(copy.deepcopy(tableContent))
            split_content = re.sub("\[  4\][\s\S]+?\[  8\][\s\S]+?\n", "",
                                   case, 1)
            tc_groups = re.findall("(\[  4\][\s\S]+?\n\[SUM\][\s\S]+?\n)- - -",
                                   split_content)
            for tc in tc_groups:
                content = re.sub("\(omitted\)|\[|\]", "", tc)
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges)
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))
            nowContent = re.sub("(\[ ID\][\s\S]+?\n)(- ){3,}", "",
                                split_content)
            tc_groups = re.search("(\[ ID\] [\s\S]+\n\[SUM\][\s\S]+?\n)",
                                  nowContent)
            if tc_groups is not None:
                content = re.sub("\(omitted\)|\[|\]", "",
                                 tc_groups.groups()[0])
                title_merges = [[6, 7]]
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[parser_log.TABLE] = ""
                tableContent[
                    parser_log.I_TABLE] = parser_log.parseMergeTitleTable(
                        content, "\\s{1,}", merges, title_merges,
                        [3, 5, 7, 11])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))

        if testcase == "iperf UDP_sin_10_tx":
            center_top = re.search("Connecting[\s\S]+?\n", case)
            if center_top is not None:
                tableContent[parser_log.CENTER_TOP] = center_top.group(0)
            tc = re.search("(\[ ID\][\s\S]+?\n)(- ){3,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                title_merges = [[5, 6]]
                merges = [[2, 3], [4, 5], [6, 7]]
                tableContent[
                    parser_log.TABLE] = parser_log.parseMergeTitleTable(
                        content,
                        "\\s{1,}",
                        merges,
                        title_merges,
                    )
                tables.append(copy.deepcopy(tableContent))
            split_content = re.sub("\[  4\][\s\S]+?\[  8\][\s\S]+?\n", "",
                                   case, 1)
            tc_groups = re.findall("(\[  4\][\s\S]+?\n\[SUM\][\s\S]+?\n)- - -",
                                   split_content)
            for tc in tc_groups:
                content = re.sub("\(omitted\)|\[|\]", "", tc)
                merges = [[2, 3], [4, 5], [6, 7]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges)
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))
            nowContent = re.sub("(\[ ID\][\s\S]+?\n)(- ){3,}", "",
                                split_content)
            tc_groups = re.search("(\[ ID\] [\s\S]+\n\[SUM\][\s\S]+?\n)",
                                  nowContent)
            if tc_groups is not None:
                content = re.sub("\(omitted\)|\[|\]", "",
                                 tc_groups.groups()[0])
                title_merges = [[6, 7]]
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[parser_log.TABLE] = ""
                tableContent[
                    parser_log.I_TABLE] = parser_log.parseMergeTitleTable(
                        content, "\\s{1,}", merges, title_merges,
                        [3, 5, 7, 11, 13, 15, 17, 19, 21, 23])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))

        if testcase == "iperf UDP_sin_10_rx":
            center_top = re.search("Connecting[\s\S]+?\n", case)
            if center_top is not None:
                tableContent[parser_log.CENTER_TOP] = center_top.group(0)
            tc = re.search("(\[ ID\][\s\S]+?\n)(- ){3,}", case)
            if tc is not None:
                content = re.sub("\(omitted\)|\[|\]", "", tc.groups()[0])
                title_merges = [[6, 7]]
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[
                    parser_log.TABLE] = parser_log.parseMergeTitleTable(
                        content,
                        "\\s{1,}",
                        merges,
                        title_merges,
                    )
                tables.append(copy.deepcopy(tableContent))
            split_content = re.sub("\[  4\][\s\S]+?\[  8\][\s\S]+?\n", "",
                                   case, 1)
            tc_groups = re.findall("(\[  4\][\s\S]+?\n\[SUM\][\s\S]+?\n)- - -",
                                   split_content)
            for tc in tc_groups:
                content = re.sub("\(omitted\)|\[|\]", "", tc)
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[parser_log.TABLE] = ""
                tableContent[parser_log.I_TABLE] = parser_log.parseMergeTable(
                    content, "\\s{1,}", merges)
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))
            nowContent = re.sub("(\[ ID\][\s\S]+?\n)(- ){3,}", "",
                                split_content)
            tc_groups = re.search("(\[ ID\] [\s\S]+\n\[SUM\][\s\S]+?\n)",
                                  nowContent)
            if tc_groups is not None:
                content = re.sub("\(omitted\)|\[|\]", "",
                                 tc_groups.groups()[0])
                title_merges = [[6, 7]]
                merges = [[2, 3], [4, 5], [6, 7], [8, 9], [10, 11]]
                tableContent[parser_log.TABLE] = ""
                tableContent[
                    parser_log.I_TABLE] = parser_log.parseMergeTitleTable(
                        content, "\\s{1,}", merges, title_merges,
                        [3, 5, 7, 11, 13, 15, 17, 19, 21, 23])
                tableContent[parser_log.CENTER_TOP] = ""
                tables.append(copy.deepcopy(tableContent))

        caseDict[parser_log.TABLES] = tables
        result.append(caseDict)
    outfp.write(json.dumps(result))
    return result
Exemple #9
0
def openssl(filePath, outfp):
    cases = parser_log.parseData(filePath)
    result = []
    for case in cases:
        caseDict = {}
        caseDict[parser_log.BOTTOM] = parser_log.getBottom(case)
        titleGroup = re.search("\[test:([\s\S]+?)\]", case)
        if titleGroup != None:
            caseDict[parser_log.TOP] = titleGroup.group(0)

        tables = []
        tableContent = {}
        tc = re.search("(The 'numbers'[\s\S]+?\n)([\s\S]+k\n)", case)
        if tc is not None:
            tableContent[parser_log.CENTER_TOP] = tc.groups()[0]
            tableContent[parser_log.TABLE] = parser_log.parseTable(tc.groups()[1], "\\s{2,}")
            tables.append(copy.deepcopy(tableContent))

        tc1 = re.findall("(sign\\s{1,}verify\\s{1,}sign/s\\s{1,}verify/s\n)([\s\S]+?\n)\\s{5,}", case)
        for group in tc1:
            table = []
            td_title = []
            td_title.append("")
            for table_title in re.split("\\s{1,}", group[0]):
                if table_title.strip() != "":
                    td_title.append(table_title)
            table.append(td_title)
            for line in group[1].splitlines():
                td1_group = re.search("[\s\S]+?bits|[\s\S]+?\)", line)
                td1 = td1_group.group(0)
                now = line.replace(td1, "")
                td = []
                td.append(td1)
                for cell in re.split("\\s{1,}", now):
                    if cell.strip() != "":
                        td.append(cell)
                if len(td) > 0:
                    table.append(td)
            tableContent[parser_log.CENTER_TOP] = ""
            tableContent[parser_log.TABLE] = table
            tables.append(copy.deepcopy(tableContent))

        op = re.findall("(op\\s{1,}op/s\n)([\s\S]+?\n)\[status\]", case)
        for op_group in op:
            table = []
            td_title = []
            td_title.append("")
            for table_title in re.split("\\s{1,}", op_group[0]):
                if table_title.strip() != "":
                    td_title.append(table_title)
            table.append(td_title)
            for line in op_group[1].splitlines():
                td1_group = re.search("[\s\S]+?\)", line)
                td1 = td1_group.group(0)
                now = line.replace(td1, "")
                td = []
                td.append(td1)
                for cell in re.split("\\s{1,}", now):
                    if cell.strip() != "":
                        td.append(cell)
                if len(td) > 0:
                    table.append(td)
            tableContent[parser_log.CENTER_TOP] = ""
            tableContent[parser_log.TABLE] = table
            tables.append(copy.deepcopy(tableContent))
        caseDict[parser_log.TABLES] = tables
        result.append(caseDict)
    result = json.dumps(result)
    outfp.write(result)
    return result