diff options
author | Radek Zetik <radekx.zetik@intel.com> | 2015-12-09 12:59:36 +0000 |
---|---|---|
committer | Maryam Tahhan <maryam.tahhan@intel.com> | 2015-12-14 15:51:47 +0000 |
commit | 66c0d987430787f33b936b31b120356f33270f58 (patch) | |
tree | c20f239eebc0e905ecbcfca398651e9679b9a9c4 | |
parent | b7a3cb6b74850ef71fbbeacbee63df791caba626 (diff) |
Results: Integrate with opnfv_test_dashboard
The feature is enabled by --opnfvpod parameter on vsperf command line.
The value of the parameter sets POD name:
example:
--opnfvpod <pod_name> or --opnfvpod=<pod_name>
You need to specify installer name. It can be set in conf-file
default value:
OPNFV_INSTALLER = "Fuel"
Additionally, there are two parameters with default values:
OPNFV_URL = "http://213.77.62.197"
Defines address of opnfv releng database server
PACKAGE_LIST = "src/package-list.mk"
OVS and DPDK tags are read from this file and values are used
for creation of 'version' filed.
The patch requires 'requests' module. The requirements.txt is updated.
JIRA: VSPERF-112
Change-Id: I49f6f5058b1bce8a257669efa8229ff31879481d
Signed-off-by: Radek Zetik <radekx.zetik@intel.com>
Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Brian Castelli <brian.castelli@spirent.com>
-rw-r--r-- | conf/10_custom.conf | 2 | ||||
-rw-r--r-- | requirements.txt | 1 | ||||
-rw-r--r-- | tools/opnfvdashboard/opnfvdashboard.py | 22 | ||||
-rwxr-xr-x | vsperf | 6 |
4 files changed, 28 insertions, 3 deletions
diff --git a/conf/10_custom.conf b/conf/10_custom.conf index 28a3156d..bf1c38c4 100644 --- a/conf/10_custom.conf +++ b/conf/10_custom.conf @@ -63,3 +63,5 @@ TRAFFICGEN_IXNET_DUT_RESULT_DIR = '' TEST_PARAMS = {'packet_sizes':'64'} OPNFV_INSTALLER = "Fuel" +OPNFV_URL = "http://213.77.62.197" +PACKAGE_LIST = "src/package-list.mk" diff --git a/requirements.txt b/requirements.txt index 934340d9..39f0a090 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ pexpect==3.3 tox==1.8.1 jinja2==2.7.3 xmlrunner==1.7.7 +requests==2.8.1 diff --git a/tools/opnfvdashboard/opnfvdashboard.py b/tools/opnfvdashboard/opnfvdashboard.py index 8aecfef2..e7a47e50 100644 --- a/tools/opnfvdashboard/opnfvdashboard.py +++ b/tools/opnfvdashboard/opnfvdashboard.py @@ -39,9 +39,12 @@ def _push_results(reader, int_data): """ the method encodes results and sends them into opnfv dashboard """ - db_url = "http://213.77.62.197" + db_url = int_data['db_url'] url = db_url + "/results" casename = "" + version_ovs = "" + version_dpdk = "" + version = "" allowed_pkt = ["64", "128", "512", "1024", "1518"] details = {"64": '', "128": '', "512": '', "1024": '', "1518": ''} @@ -56,16 +59,31 @@ def _push_results(reader, int_data): else: details[row_reader['packet_size']] = row_reader['throughput_rx_fps'] + # Create version field + with open(int_data['pkg_list'], 'r') as pkg_file: + for line in pkg_file: + if "OVS_TAG" in line: + version_ovs = line.replace(' ', '') + version_ovs = version_ovs.replace('OVS_TAG?=', '') + if "DPDK_TAG" in line: + if int_data['vanilla'] == False: + version_dpdk = line.replace(' ', '') + version_dpdk = version_dpdk.replace('DPDK_TAG?=', '') + else: + version_dpdk = "not used" + version = "OVS " + version_ovs.replace('\n', '') + " DPDK " + version_dpdk.replace('\n', '') + # Build body body = {"project_name": "vsperf", "case_name": casename, "pod_name": int_data['pod'], "installer": int_data['installer'], - "version": "OVS 2.4", + "version": version, "details": details} myData = requests.post(url, json=body) logging.info("Results for %s sent to opnfv, http response: %s", casename, myData) + logging.debug("opnfv url: %s", db_url) logging.debug("the body sent to opnfv") logging.debug(body) @@ -448,11 +448,15 @@ def main(): if args['opnfvpod']: pod_name = args['opnfvpod'] installer_name = settings.getValue('OPNFV_INSTALLER') + opnfv_url = settings.getValue('OPNFV_URL') + pkg_list = settings.getValue('PACKAGE_LIST') int_data = {'cuse': False, 'vanilla': False, 'pod': pod_name, - 'installer': installer_name} + 'installer': installer_name, + 'pkg_list': pkg_list, + 'db_url': opnfv_url} if settings.getValue('VSWITCH').endswith('Vanilla'): int_data['vanilla'] = True if settings.getValue('VNF').endswith('Cuse'): |