summaryrefslogtreecommitdiff
path: root/validation/test
diff options
context:
space:
mode:
authorJean-Philippe NOEL2012-09-25 18:54:15 +0200
committerJean-Philippe NOEL2012-10-05 09:46:06 +0200
commit23b70de9dc43f7a02b7f7de04e62fbadfb5b0e38 (patch)
treedab35d60d4974f3506b27dedbf7d0e24bee0b299 /validation/test
parente0bb75bfe3290e6e95bd0f41212293eafe2049a8 (diff)
validation: customize stats display for BLE, refs #3363
Diffstat (limited to 'validation/test')
-rw-r--r--validation/test/P2P_throughput_report/P2P_throughput_report.py65
-rw-r--r--validation/test/P2P_throughput_report/config.py12
2 files changed, 36 insertions, 41 deletions
diff --git a/validation/test/P2P_throughput_report/P2P_throughput_report.py b/validation/test/P2P_throughput_report/P2P_throughput_report.py
index 9e4874e7fc..5454abfb81 100644
--- a/validation/test/P2P_throughput_report/P2P_throughput_report.py
+++ b/validation/test/P2P_throughput_report/P2P_throughput_report.py
@@ -22,20 +22,12 @@ config = None
#Peak to Average Ratio of the power, in OFDM
par_db = 10
-#String displayed for the maximum throughput test
-str_max_throughput = "Maximum throughput"
#Units of the "values" for each type of test
units = {"attenuation":"dB",
"SNR":"dB",
"SJR":"dB",
"frame_size":"bytes",
- "dynamic_jammer":"seconds",
- "Maximum throughput":"Mbit/s",
- "Restart BER":"no unit",
- "Restart PB error rate":"no unit",
- "Restart peer request":"no unit",
- "Restart tone map update":"no unit",
- "Restart ber margin update":"no unit"
+ "dynamic_jammer":"seconds"
}
def update_config(new_config):
@@ -97,13 +89,13 @@ def report(new_config):
for (test_protocol, test_type, test_params) in config["fixtures"]:
datarates = extract_datarates(test_protocol, test_type, test_params)
dump_and_draw(test_protocol, test_type, test_params, datarates,
- str_max_throughput)
+ str_max_throughput())
if test_type != "dynamic_jammer":
- for stat_name in config["displayed_diff_CE_stats"]:
- stats = extract_stats(test_protocol, test_type, test_params,
- stat_name)
- dump_and_draw(test_protocol, test_type, test_params, stats,
- stat_name)
+ for ce_stat_name in config["displayed_CE_stats"]:
+ ce_stats = extract_ce_stats(test_protocol, test_type,
+ test_params, ce_stat_name)
+ dump_and_draw(test_protocol, test_type, test_params, ce_stats,
+ ce_stat_name)
# Build the rst file
build_rst_file(fig_name)
@@ -129,6 +121,8 @@ def check_config():
attenuation_offset = get_attenuation_offset()
attenuation_range_db = attenuator.attenuation_range_db()
power_range_dbm = waveform_generator.power_range_dbm()
+ ce_stats = config["displayed_CE_stats"]
+ [ iperf.unit(ce_stat) for ce_stat in ce_stats]
for fixture in fixtures:
(test_protocol, test_type, test_params) = fixture
curves = config[test_type]["curves"]
@@ -265,9 +259,9 @@ def rst_results():
"\n"
results = []
for fixture in config["fixtures"] :
- results = results + [rst_result(fixture, str_max_throughput)] + \
- [rst_result(fixture, stat_name)
- for stat_name in config["displayed_diff_CE_stats"]]
+ results = results + [rst_result(fixture, str_max_throughput())] + \
+ [rst_result(fixture, ce_stat)
+ for ce_stat in config["displayed_CE_stats"]]
return title + rst_page_break().join(results)
def rst_title_break(character):
@@ -303,7 +297,7 @@ def rst_result((test_protocol, test_type, test_params), figure_name):
else:
test_params_title = ""
- if str_max_throughput in figure_name:
+ if figure_name == str_max_throughput():
return test_protocol + " - " + test_type + test_params_title + \
rst_title_break("-") + \
rst_params([("Duration of each measurement (seconds)",
@@ -316,10 +310,8 @@ def rst_result((test_protocol, test_type, test_params), figure_name):
return ""
return figure_name + " - " + test_protocol + " - " + test_type + \
test_params_title + rst_title_break("~") + \
- rst_params([("Y-axis value", "difference between the statistics " \
- "retrieved before and after each measurement " \
- "(a value of (-1) means that the statistics " \
- "are invalid)")]) + \
+ rst_params([("Y-axis value",
+ iperf.ce_stat_description(figure_name))]) + \
rst_figure(test_protocol, test_type, test_params, figure_name) + \
rst_picture_scale()
@@ -460,7 +452,7 @@ def make_measurement(test_protocol, test_type, test_params, test_value):
curves = config[test_type]["curves"]
prefix = file_prefix(test_protocol, test_type, test_params, test_value)
if test_type in ["attenuation", "SNR", "SJR", "dynamic_jammer"]:
- udp_throughputs = config["udp_throughputs_mbit_per_s"]
+ udp_throughputs = config["udp_throughputs_mbits_per_sec"]
(unidir_udp_throughput, bidir_udp_throughput) = udp_throughputs
udp_parameters = ((iperf.default_frame_size, unidir_udp_throughput),
(iperf.default_frame_size, bidir_udp_throughput))
@@ -480,26 +472,26 @@ def extract_datarates(test_protocol, test_type, test_params):
datarates[direction] = \
extract_values_from_report(test_protocol, test_type,
test_params, None,
- direction, str_max_throughput)[0]
+ direction, str_max_throughput())[0]
else:
datarates[direction] = \
[ extract_values_from_report(test_protocol, test_type,
test_params, test_value, direction,
- str_max_throughput)[1]
+ str_max_throughput())[1]
for test_value in test_values ]
return datarates
-def extract_stats(test_protocol, test_type, test_params, stat_name):
- """Extract the statistics from the measurement files"""
- stats = {}
+def extract_ce_stats(test_protocol, test_type, test_params, ce_stat_name):
+ """Extract the CE statistics from the measurement files"""
+ ce_stats = {}
for direction in get_all_directions(test_type):
test_values = get_test_values(test_type)
- stats[direction] = \
+ ce_stats[direction] = \
[ extract_values_from_report(test_protocol, test_type,
test_params, test_value,
- direction, stat_name)
+ direction, ce_stat_name)
for test_value in test_values ]
- return stats
+ return ce_stats
def extract_values_from_report(test_protocol, test_type, test_params,
test_value, direction, name):
@@ -512,10 +504,10 @@ def extract_values_from_report(test_protocol, test_type, test_params,
else:
assert False, test_type
duration_s = config[test_type]["duration_s"]
- if str_max_throughput in name:
+ if name == str_max_throughput():
fun = iperf.extract_datarates_from_report
else:
- fun = iperf.extract_statistic_from_report
+ fun = iperf.extract_ce_stat_from_report
return fun(test_protocol, frame_size, prefix, direction, duration_s, name)
def dump_and_draw(test_protocol, test_type, test_params, values, yname):
@@ -530,7 +522,7 @@ def dump_and_draw(test_protocol, test_type, test_params, values, yname):
iperf.dump_measurement(directions, test_type, test_values,
file_name_base + ".txt", values)
xlabel = test_type + " (" + units[test_type] + ")"
- ylabel = yname + " (" + units[yname] + ")"
+ ylabel = yname + " (" + iperf.unit(yname) + ")"
iperf.draw(title, xlabel, ylabel, directions, test_type, test_values,
config["show"], file_name_base + ".png", values)
@@ -653,6 +645,9 @@ def flatten(items, acc = None):
acc.append(first_item)
return flatten(items, acc)
+def str_max_throughput():
+ return iperf.str_max_throughput
+
if __name__ == "__main__":
assert {"ppsd_dbm_per_hz":-50,
diff --git a/validation/test/P2P_throughput_report/config.py b/validation/test/P2P_throughput_report/config.py
index 990ab5ece5..5c8e2b86b7 100644
--- a/validation/test/P2P_throughput_report/config.py
+++ b/validation/test/P2P_throughput_report/config.py
@@ -13,11 +13,11 @@
"get_CE_stats":True,
#CE stats which difference, before and after each serie of measurements,
#is displayed in the report
- "displayed_diff_CE_stats": ["Restart BER",
- "Restart PB error rate",
- "Restart peer request",
- "Restart tone map update",
- "Restart ber margin update"],
+ "displayed_CE_stats": ["Restart BER",
+ "Restart PB error rate",
+ "Restart peer request",
+ "Restart tone map update",
+ "Restart ber margin update"],
#True|False
#If True, the measurements are reset, made and then the report is generated
#If False, the report is generated from the previous measurements
@@ -136,7 +136,7 @@
#Typical values are the following:
# - (100, 85) in AV with an SPR310 and
# - (142, 85) for EoC with an SPK300g
- "udp_throughputs_mbit_per_s": (142, 85),
+ "udp_throughputs_mbits_per_sec": (142, 85),
#Configuration passed to the 'attenuator' module
"attenuator" : {
"name":"att",