- # Generate tables:
- # All tests in csv:
- tbl_names = ["{0}-ndr-1t1c-full{1}".format(table["output-file"],
- table["output-file-ext"]),
- "{0}-ndr-2t2c-full{1}".format(table["output-file"],
- table["output-file-ext"]),
- "{0}-ndr-4t4c-full{1}".format(table["output-file"],
- table["output-file-ext"]),
- "{0}-pdr-1t1c-full{1}".format(table["output-file"],
- table["output-file-ext"]),
- "{0}-pdr-2t2c-full{1}".format(table["output-file"],
- table["output-file-ext"]),
- "{0}-pdr-4t4c-full{1}".format(table["output-file"],
- table["output-file-ext"])
- ]
- for file_name in tbl_names:
- logging.info(" Writing file: '{0}'".format(file_name))
- with open(file_name, "w") as file_handler:
- file_handler.write(header_str)
- for test in tbl_lst:
- if (file_name.split("-")[-3] in test[0] and # NDR vs PDR
- file_name.split("-")[-2] in test[0]): # cores
- test[0] = "-".join(test[0].split("-")[:-1])
- file_handler.write(",".join([str(item) for item in test]) +
- "\n")
-
- # All tests in txt:
- tbl_names_txt = ["{0}-ndr-1t1c-full.txt".format(table["output-file"]),
- "{0}-ndr-2t2c-full.txt".format(table["output-file"]),
- "{0}-ndr-4t4c-full.txt".format(table["output-file"]),
- "{0}-pdr-1t1c-full.txt".format(table["output-file"]),
- "{0}-pdr-2t2c-full.txt".format(table["output-file"]),
- "{0}-pdr-4t4c-full.txt".format(table["output-file"])
- ]
-
- for i, txt_name in enumerate(tbl_names_txt):
- logging.info(" Writing file: '{0}'".format(txt_name))
- convert_csv_to_pretty_txt(tbl_names[i], txt_name)
-
- # Selected tests in csv:
- input_file = "{0}-ndr-1t1c-full{1}".format(table["output-file"],
- table["output-file-ext"])
- with open(input_file, "r") as in_file:
- lines = list()
- for line in in_file:
- lines.append(line)
-
- output_file = "{0}-ndr-1t1c-top{1}".format(table["output-file"],
- table["output-file-ext"])
- logging.info(" Writing file: '{0}'".format(output_file))
- with open(output_file, "w") as out_file:
- out_file.write(header_str)
- for i, line in enumerate(lines[1:]):
- if i == table["nr-of-tests-shown"]:
- break
- out_file.write(line)
-
- output_file = "{0}-ndr-1t1c-bottom{1}".format(table["output-file"],
- table["output-file-ext"])
- logging.info(" Writing file: '{0}'".format(output_file))
- with open(output_file, "w") as out_file:
- out_file.write(header_str)
- for i, line in enumerate(lines[-1:0:-1]):
- if i == table["nr-of-tests-shown"]:
- break
- out_file.write(line)
-
- input_file = "{0}-pdr-1t1c-full{1}".format(table["output-file"],
- table["output-file-ext"])
- with open(input_file, "r") as in_file:
- lines = list()
- for line in in_file:
- lines.append(line)
-
- output_file = "{0}-pdr-1t1c-top{1}".format(table["output-file"],
- table["output-file-ext"])
- logging.info(" Writing file: '{0}'".format(output_file))
- with open(output_file, "w") as out_file:
- out_file.write(header_str)
- for i, line in enumerate(lines[1:]):
- if i == table["nr-of-tests-shown"]:
- break
- out_file.write(line)
-
- output_file = "{0}-pdr-1t1c-bottom{1}".format(table["output-file"],
- table["output-file-ext"])
- logging.info(" Writing file: '{0}'".format(output_file))
- with open(output_file, "w") as out_file:
- out_file.write(header_str)
- for i, line in enumerate(lines[-1:0:-1]):
- if i == table["nr-of-tests-shown"]:
- break
- out_file.write(line)
-
-
-def table_performance_comparison_mrr(table, input_data):
- """Generate the table(s) with algorithm: table_performance_comparison_mrr
+ # Generate csv tables:
+ csv_file = "{0}.csv".format(table["output-file"])
+ with open(csv_file, "w") as file_handler:
+ file_handler.write(header_str)
+ for test in tbl_lst:
+ file_handler.write(",".join([str(item) for item in test]) + "\n")
+
+ txt_file_name = "{0}.txt".format(table["output-file"])
+ convert_csv_to_pretty_txt(csv_file, txt_file_name)
+
+ if footnote:
+ with open(txt_file_name, 'a') as txt_file:
+ txt_file.writelines([
+ "\nFootnotes:\n",
+ "[1] CSIT-1908 changed test methodology of dot1q tests in "
+ "2n-skx testbeds, dot1q encapsulation is now used on both "
+ "links of SUT.\n",
+ " Previously dot1q was used only on a single link with the "
+ "other link carrying untagged Ethernet frames. This change "
+ "results\n",
+ " in slightly lower throughput in CSIT-1908 for these "
+ "tests. See release notes."
+ ])
+
+
+def table_nics_comparison(table, input_data):
+ """Generate the table(s) with algorithm: table_nics_comparison