summaryrefslogtreecommitdiff
path: root/validation/test
diff options
context:
space:
mode:
authorJean-Philippe NOEL2012-09-14 16:23:32 +0200
committerJean-Philippe NOEL2012-10-05 09:46:03 +0200
commit57e9bd732e42b0fb4f0ffeabb7d4f9e1a6ebfb1d (patch)
treef6e25be6391e3a7e14d8766dd8908ea5063c89cc /validation/test
parentf0827498849c5006a177229eeefa66b5ddac85a4 (diff)
validation/test/P2P_throughput_report: give config as an input file, refs #3363
Diffstat (limited to 'validation/test')
-rw-r--r--validation/test/P2P_throughput_report/P2P_throughput_report.py187
-rw-r--r--validation/test/P2P_throughput_report/P2P_throughput_report_caller.py53
-rw-r--r--validation/test/P2P_throughput_report/config.py177
3 files changed, 239 insertions, 178 deletions
diff --git a/validation/test/P2P_throughput_report/P2P_throughput_report.py b/validation/test/P2P_throughput_report/P2P_throughput_report.py
index 540c26011b..77034e9a6d 100644
--- a/validation/test/P2P_throughput_report/P2P_throughput_report.py
+++ b/validation/test/P2P_throughput_report/P2P_throughput_report.py
@@ -17,183 +17,7 @@ import validlib.power_strip as power_strip
import validlib.spc300 as spc300
import validlib.iperf as iperf
-config = {
- #True|False
- #If True, each image is displayed on the screen when it is generated
- #If False, the PDF report is directly generated without showing the image
- "show":False,
- #True|False
- #If True, the plugs are restarted before each serie of measurements
- #If False, the plugs are not restarted before a serie of measurements
- "restart_plugs":False,
- #If True and if the 2 plugs are MSTAR, the 'vs_get_ce_stats' MME is sent
- #before and after each serie of measurements
- #If False or if one of the 2 plugs is not MSTAR, no MME is sent
- "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"],
- #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
- "make_measurements":False,
- "attenuation":{
- "values":numpy.arange(30, 100, 5).tolist(),
- "duration_s":20,
- #["a_b_uni"|"b_a_uni"|"bi"]
- #see iperf.measurement_specs() for the meaning of the values
- "curves":["a_b_uni", "b_a_uni", "bi"]},
- "SNR": {
- "values":numpy.arange(40, -10, -5).tolist(),
- "duration_s":20,
- #["a_b_uni"|"b_a_uni"|"bi"]
- #see iperf.measurement_specs() for the meaning of the values
- "curves":["a_b_uni", "b_a_uni"]},
- "SJR":{
- "values":numpy.arange(0, -55, -5).tolist(),
- "duration_s":20,
- #["a_b_uni"]
- #see iperf.measurement_specs() for the meaning of the values
- "curves":["a_b_uni"]},
- "frame_size":{
- #[(frame_size, max_throughput_M)]
- #The frame size and the max throughput includes the Ethernet,
- #IP and TCP/UDP headers
- "values":[
- (68, 18),
- (128, 34),
- (256, 65),
- (512, 105),
- (768, 125),
- (1024, 142),
- (1280, 142),
- (1514, 142),
- (1515, 142),
- (1550, 142),
- (1600, 142),
- (1700, 142),
- (2000, 142)
- ],
- "duration_s":20,
- #["a_b_uni"|"b_a_uni"|"bi"]
- #see iperf.measurement_specs() for the meaning of the values
- "curves":["a_b_uni", "b_a_uni", "bi"]
- },
- "dynamic_jammer":{
- #Must be ["time"]
- "values":["time"],
- #Must be seconds
- "duration_s":15,
- #["a_b_uni"|"b_a_uni"|"bi"]
- #see iperf.measurement_specs() for the meaning of the values
- "curves":["a_b_uni"]},
- #[("UDP"|"TCP",
- # "attenuation"|"SNR"|"frame_size"|"SJR"|"dynamic_jammer",
- # (jammer frequency(MHz), AM form ("SINusoid"|"SQUare"),
- # AM frequency (kHz), AM depth(%)) for "SJR",
- # (SJR (dBm), sweep start frequency (MHz), sweep stop frequency (MHz),
- # sweep time (seconds)) for "dynamic_jammer"
- # and None otherwise)]
- "fixtures":[
-# ("UDP", "attenuation", None),
-# ("TCP", "attenuation", None),
-# ("UDP", "SNR", None),
-# ("TCP", "SNR", None),
-# ("UDP", "SJR", (13.5, None)),
-# ("UDP", "SJR", (18.5, None)),
-# ("UDP", "SJR", (23.5, None)),
-# ("UDP", "SJR", (4, ("SINusoid", 1, 80))),
-# ("UDP", "SJR", (15, ("SINusoid", 1, 80))),
-# ("UDP", "SJR", (26, ("SINusoid", 1, 80))),
-# ("UDP", "SJR", (27.345, ("SINusoid", 1, 80))),
-# ("UDP", "frame_size", None),
-# ("UDP", "dynamic_jammer", (10, 2, 30, 60)),
-# ("UDP", "dynamic_jammer", (0, 2, 30, 60)),
-# ("UDP", "dynamic_jammer", (-10, 2, 30, 60)),
-# ("UDP", "dynamic_jammer", (-20, 2, 30, 60)),
-# ("UDP", "dynamic_jammer", (-30, 2, 30, 60))
- ],
- #Duration after the channel modification during which we generate traffic
- #to let the CE converge
- "ce_sync_time_s":2,
- #Directory where the report is generated
- "reports_directory":"reports",
- #True|False
- #If True, the AMN attenuation is taken into account when determining the
- #noise or the attenuation to be applied on the devices
- #True should be used in AV
- #False should be used in EoC
- "amn":False,
- #Bandwidth of the useful signal
- #Typical values are (2, 28) in AV and (1, 38) in EoC
- "signal_band_mhz":(1, 38),
- #Power Spectral Density
- #Typical values are -50 in AV and -63 in EoC
- "ppsd_dbm_per_hz":-63,
- #We want to reach a very low SJR, but the output power of the
- #waveform generator is limited. Therefore, we set the signal to
- #a low value, actually the lowest for which the throughput
- #would not be impacted without noise. This value should be deduced from
- #the results obtained in the 'attenuation' test. If the curve starts going
- #down at 55 dB and if the minimal attenuation of the bench is 38,
- #sjr_attenuator_attenuation_db must be equal to (55 - 38) dB = 17 dB
- "sjr_attenuator_attenuation_db": 29,
- #Signal attenuation on each side of the bench, to avoid any dazzling
- #between the plugs. A typical value is 10.
- "signal_attenuation_db": 10,
- #(unidir, bidir) throughput targets for UDP tests
- #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),
- #Configuration passed to the 'attenuator' module
- "attenuator" : {
- "name":"att",
- "buttons":{1:1, 2:2, 3:4, 4:4, 5:10, 6:20, 7:40, 8:0},
- "user":"spidcom",
- "host":"tursan"
- },
- #Configuration passed to the 'waveform_generator' module
- "waveform_generator" : {
- "name":"gbf",
- "user":"spidcom",
- "host":"tursan",
- "noise_band_mhz":(0, 50),
- "power_range_dbm":(-40, 24)
- },
- #Configuration passed to the 'power_strip' module
- "power_strip":{1: ("192.168.0.10", "admin", "anel")},
- #Configuration passed to the 'spc300' module
- "spc300":{
- "eth_netmask": "192.168.5.",
- "plc_netmask": "unused",
- #Empty dictionnary means that no MSTAR plugs are used
- "plugs":
- {
- (1, 1): ("100", "unused", "unused"),
- (1, 5): ("101", "unused", "unused")
- }
- },
- #Configuration passed to the 'iperf' module
- "iperf" : {
- "host_a":{"non_plc_ip_address":"tursan",
- "user":"spidcom",
- "plc_ip_address":"192.168.5.254",
- "power_strip_key":(1, 1),
- "device":("SPK300g-master", "eoc-0.7.9")
- },
- "host_b":{"non_plc_ip_address":"spidcom-lab1",
- "user":"spidcom",
- "plc_ip_address":"192.168.5.52",
- "power_strip_key":(1, 5),
- "device":("SPK300g-slave", "eoc-0.7.9")
- },
- }
- }
+config = None
#Peak to Average Ratio of the power, in OFDM
par_db = 10
@@ -219,11 +43,18 @@ units = {"attenuation":"dB",
"Restart ber margin update":"no unit"
}
-def report():
+def update_config(new_config):
+ """Update the configuration"""
+ global config
+ config = new_config
+
+def report(new_config):
"""Generates the PDF report as specified in the configuration.
It requires to set up first the test bench as detailed in the test bench
description."""
+ update_config(new_config)
+
# Configure the 'attenuator' module
attenuator.update_config(config["attenuator"])
diff --git a/validation/test/P2P_throughput_report/P2P_throughput_report_caller.py b/validation/test/P2P_throughput_report/P2P_throughput_report_caller.py
new file mode 100644
index 0000000000..e346905e8f
--- /dev/null
+++ b/validation/test/P2P_throughput_report/P2P_throughput_report_caller.py
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+
+"""Module allowing to call P2P_throughput_report, with the adequate
+configuration"""
+
+import numpy
+import P2P_throughput_report
+import sys
+import os
+
+def evaluate(file_name):
+ config_file = open(file_name, "r")
+ config_string = config_file.read()
+ config_file.close()
+ config = eval(config_string)
+ return config
+
+def report():
+
+ args = sys.argv
+ example_file_name = os.path.join(os.path.dirname(__file__), "config.py")
+ example_config = evaluate(example_file_name)
+ config_is_ok = False
+
+ try:
+ file_name = args[1]
+ config = evaluate(file_name)
+ assert config.keys() == example_config.keys()
+ config_is_ok = True
+ except IndexError:
+ print "Error: no argument is passed."
+ except IOError:
+ print "Error: the configuration file cannot be read."
+ except SyntaxError:
+ print "Error: the configuration cannot be evaluated."
+ except AttributeError:
+ print "Error: the configuration is not a dictionnary."
+ except AssertionError:
+ print "Error: the parameters of the configuration are not " \
+ "the same as the parameters of the " \
+ "configuration file template (" + example_file_name + ")."
+ except Exception as error:
+ print "Unknown error.", type(error)
+
+ if config_is_ok is False:
+ print "The first argument passed to the function must be " \
+ "the path of a file containing the same parameters as the " \
+ "configuration file template (" + example_file_name + ")."
+ sys.exit(1)
+
+ P2P_throughput_report.report(config)
+
+report()
diff --git a/validation/test/P2P_throughput_report/config.py b/validation/test/P2P_throughput_report/config.py
new file mode 100644
index 0000000000..e0efe4a84d
--- /dev/null
+++ b/validation/test/P2P_throughput_report/config.py
@@ -0,0 +1,177 @@
+{
+ #True|False
+ #If True, each image is displayed on the screen when it is generated
+ #If False, the PDF report is directly generated without showing the image
+ "show":False,
+ #True|False
+ #If True, the plugs are restarted before each serie of measurements
+ #If False, the plugs are not restarted before a serie of measurements
+ "restart_plugs":False,
+ #If True and if the 2 plugs are MSTAR, the 'vs_get_ce_stats' MME is sent
+ #before and after each serie of measurements
+ #If False or if one of the 2 plugs is not MSTAR, no MME is sent
+ "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"],
+ #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
+ "make_measurements":False,
+ "attenuation":{
+ "values":numpy.arange(30, 100, 5).tolist(),
+ "duration_s":20,
+ #["a_b_uni"|"b_a_uni"|"bi"]
+ #see iperf.measurement_specs() for the meaning of the values
+ "curves":["a_b_uni", "b_a_uni", "bi"]},
+ "SNR": {
+ "values":numpy.arange(40, -10, -5).tolist(),
+ "duration_s":20,
+ #["a_b_uni"|"b_a_uni"|"bi"]
+ #see iperf.measurement_specs() for the meaning of the values
+ "curves":["a_b_uni", "b_a_uni"]},
+ "SJR":{
+ "values":numpy.arange(0, -55, -5).tolist(),
+ "duration_s":20,
+ #["a_b_uni"]
+ #see iperf.measurement_specs() for the meaning of the values
+ "curves":["a_b_uni"]},
+ "frame_size":{
+ #[(frame_size, max_throughput_M)]
+ #The frame size and the max throughput includes the Ethernet,
+ #IP and TCP/UDP headers
+ "values":[
+ (68, 18),
+ (128, 34),
+ (256, 65),
+ (512, 105),
+ (768, 125),
+ (1024, 142),
+ (1280, 142),
+ (1514, 142),
+ (1515, 142),
+ (1550, 142),
+ (1600, 142),
+ (1700, 142),
+ (2000, 142)
+ ],
+ "duration_s":20,
+ #["a_b_uni"|"b_a_uni"|"bi"]
+ #see iperf.measurement_specs() for the meaning of the values
+ "curves":["a_b_uni", "b_a_uni", "bi"]
+ },
+ "dynamic_jammer":{
+ #Must be ["time"]
+ "values":["time"],
+ #Must be seconds
+ "duration_s":15,
+ #["a_b_uni"|"b_a_uni"|"bi"]
+ #see iperf.measurement_specs() for the meaning of the values
+ "curves":["a_b_uni"]},
+ #[("UDP"|"TCP",
+ # "attenuation"|"SNR"|"frame_size"|"SJR"|"dynamic_jammer",
+ # (jammer frequency(MHz), AM form ("SINusoid"|"SQUare"),
+ # AM frequency (kHz), AM depth(%)) for "SJR",
+ # (SJR (dBm), sweep start frequency (MHz), sweep stop frequency (MHz),
+ # sweep time (seconds)) for "dynamic_jammer"
+ # and None otherwise)]
+ "fixtures":[
+# ("UDP", "attenuation", None),
+# ("TCP", "attenuation", None),
+# ("UDP", "SNR", None),
+# ("TCP", "SNR", None),
+# ("UDP", "SJR", (13.5, None)),
+# ("UDP", "SJR", (18.5, None)),
+# ("UDP", "SJR", (23.5, None)),
+# ("UDP", "SJR", (4, ("SINusoid", 1, 80))),
+# ("UDP", "SJR", (15, ("SINusoid", 1, 80))),
+# ("UDP", "SJR", (26, ("SINusoid", 1, 80))),
+# ("UDP", "SJR", (27.345, ("SINusoid", 1, 80))),
+# ("UDP", "frame_size", None),
+# ("UDP", "dynamic_jammer", (10, 2, 30, 60)),
+# ("UDP", "dynamic_jammer", (0, 2, 30, 60)),
+# ("UDP", "dynamic_jammer", (-10, 2, 30, 60)),
+# ("UDP", "dynamic_jammer", (-20, 2, 30, 60)),
+# ("UDP", "dynamic_jammer", (-30, 2, 30, 60))
+ ],
+ #Duration after the channel modification during which we generate traffic
+ #to let the CE converge
+ "ce_sync_time_s":2,
+ #Directory where the report is generated
+ "reports_directory":"reports",
+ #True|False
+ #If True, the AMN attenuation is taken into account when determining the
+ #noise or the attenuation to be applied on the devices
+ #True should be used in AV
+ #False should be used in EoC
+ "amn":False,
+ #Bandwidth of the useful signal
+ #Typical values are (2, 28) in AV and (1, 38) in EoC
+ "signal_band_mhz":(1, 38),
+ #Power Spectral Density
+ #Typical values are -50 in AV and -63 in EoC
+ "ppsd_dbm_per_hz":-63,
+ #We want to reach a very low SJR, but the output power of the
+ #waveform generator is limited. Therefore, we set the signal to
+ #a low value, actually the lowest for which the throughput
+ #would not be impacted without noise. This value should be deduced from
+ #the results obtained in the 'attenuation' test. If the curve starts going
+ #down at 55 dB and if the minimal attenuation of the bench is 38,
+ #sjr_attenuator_attenuation_db must be equal to (55 - 38) dB = 17 dB
+ "sjr_attenuator_attenuation_db": 29,
+ #Signal attenuation on each side of the bench, to avoid any dazzling
+ #between the plugs. A typical value is 10.
+ "signal_attenuation_db": 10,
+ #(unidir, bidir) throughput targets for UDP tests
+ #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),
+ #Configuration passed to the 'attenuator' module
+ "attenuator" : {
+ "name":"att",
+ "buttons":{1:1, 2:2, 3:4, 4:4, 5:10, 6:20, 7:40, 8:0},
+ "user":"spidcom",
+ "host":"tursan"
+ },
+ #Configuration passed to the 'waveform_generator' module
+ "waveform_generator" : {
+ "name":"gbf",
+ "user":"spidcom",
+ "host":"tursan",
+ "noise_band_mhz":(0, 50),
+ "power_range_dbm":(-40, 24)
+ },
+ #Configuration passed to the 'power_strip' module
+ "power_strip":{1: ("192.168.0.10", "admin", "anel")},
+ #Configuration passed to the 'spc300' module
+ "spc300":{
+ "eth_netmask": "192.168.5.",
+ "plc_netmask": "unused",
+ #Empty dictionnary means that no MSTAR plugs are used
+ "plugs":
+ {
+ (1, 1): ("100", "unused", "unused"),
+ (1, 5): ("101", "unused", "unused")
+ }
+ },
+ #Configuration passed to the 'iperf' module
+ "iperf" : {
+ "host_a":{"non_plc_ip_address":"tursan",
+ "user":"spidcom",
+ "plc_ip_address":"192.168.5.254",
+ "power_strip_key":(1, 1),
+ "device":("SPK300g-master", "eoc-0.7.9")
+ },
+ "host_b":{"non_plc_ip_address":"spidcom-lab1",
+ "user":"spidcom",
+ "plc_ip_address":"192.168.5.52",
+ "power_strip_key":(1, 5),
+ "device":("SPK300g-slave", "eoc-0.7.9")
+ },
+ }
+ }