summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py
diff options
context:
space:
mode:
authorLuc Provoost <luc.provoost@intel.com>2020-12-08 21:53:41 +0100
committerLuc Provoost <luc.provoost@intel.com>2020-12-08 21:53:41 +0100
commitd5801e449ca4c7115c2c11bf164bcce7b149917c (patch)
treef7ada6c0994918b43eeb3c5b0d52ffa3fe495812 /VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py
parent50f6063cff3bd904d1ae684c10c952a4c7f9b276 (diff)
Reporting test details for all testsopnfv-10.0.0stable/jerma
Test details were only implemented in rapid_flowsizetest.py. When executing other tests, an error occured. That is now fixed, although in some cases, None is returned. The format.yaml files defines now alsowhat will be reported in the Xtesting details. Change-Id: I5feae62dcf228664b24451d3fc5dfaaadf7edb5e Signed-off-by: Luc Provoost <luc.provoost@intel.com>
Diffstat (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py')
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py26
1 files changed, 9 insertions, 17 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py
index 73b41a6f..b89eb7bc 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py
@@ -114,29 +114,21 @@ class RapidTest(object):
def post_data(self, test, variables):
var = copy.deepcopy(self.data_format)
self.parse_data_format_dict(var, variables)
- if 'URL' not in var.keys():
- return
- if test not in var.keys():
- return
- URL=''
- for value in var['URL'].values():
- URL = URL + value
- HEADERS = {'X-Requested-With': 'Python requests', 'Content-type': 'application/rapid'}
- if 'Format' in var.keys():
+ if var.keys() >= {'URL', test, 'Format'}:
+ URL=''
+ for value in var['URL'].values():
+ URL = URL + value
+ HEADERS = {'X-Requested-With': 'Python requests', 'Content-type': 'application/rapid'}
if var['Format'] == 'PushGateway':
data = "\n".join("{} {}".format(k, v) for k, v in var[test].items()) + "\n"
response = requests.post(url=URL, data=data,headers=HEADERS)
elif var['Format'] == 'Xtesting':
data = var[test]
response = requests.post(url=URL, json=data)
- else:
- return
- else:
- return
- if (response.status_code != 202) and (response.status_code != 200):
- RapidLog.info('Cannot send metrics to {}'.format(URL))
- RapidLog.info(data)
-
+ if (response.status_code >= 300):
+ RapidLog.info('Cannot send metrics to {}'.format(URL))
+ RapidLog.info(data)
+ return (var[test])
@staticmethod
def report_result(flow_number, size, speed, pps_req_tx, pps_tx, pps_sut_tx,