summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/helper-scripts
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
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')
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/format.yaml49
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_corestatstest.py7
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py4
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_impairtest.py7
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_irqtest.py2
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_portstatstest.py7
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py26
-rw-r--r--VNFs/DPPD-PROX/helper-scripts/rapid/rapid_warmuptest.py2
8 files changed, 44 insertions, 60 deletions
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/format.yaml b/VNFs/DPPD-PROX/helper-scripts/rapid/format.yaml
index f4220775..6b1eb456 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/format.yaml
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/format.yaml
@@ -22,36 +22,25 @@
PacketsReceived: PacketsReceived
PacketsLost: PacketsLost
rapid_flowsizetest:
- project_name: "cirv"
- scenario: "rapid"
- start_date: start_date
- stop_date: stop_date
- case_name: test
- pod_name: "intel-pod10"
- installer: "Fuel"
- version: "1.0"
- build_tag: "none"
- criteria: "PASS"
- details:
- Flows: Flows
- Size: Size
- Speed (Mpps):
- RequestedSpeed: RequestedSpeed
- CoreGenerated: CoreGenerated
- SentByNIC: SentByNIC
- FwdBySUT: FwdBySUT
- RevByCore: RevByCore
- Latency (usec):
- AvgLatency: AvgLatency
- PCTLatency: PCTLatency
- MaxLatency: MaxLatency
- Distribution:
- bucket_size: bucket_size
- buckets: buckets
- Absolute Packet Count:
- PacketsSent: PacketsSent
- PacketsReceived: PacketsReceived
- PacketsLost: PacketsLost
+ Flows: Flows
+ Size: Size
+ Speed (Mpps):
+ RequestedSpeed: RequestedSpeed
+ CoreGenerated: CoreGenerated
+ SentByNIC: SentByNIC
+ FwdBySUT: FwdBySUT
+ RevByCore: RevByCore
+ Latency (usec):
+ AvgLatency: AvgLatency
+ PCTLatency: PCTLatency
+ MaxLatency: MaxLatency
+ Distribution:
+ bucket_size: bucket_size
+ buckets: buckets
+ Absolute Packet Count:
+ PacketsSent: PacketsSent
+ PacketsReceived: PacketsReceived
+ PacketsLost: PacketsLost
rapid_irqtest:
Core: Core
LessThan1us : B1
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_corestatstest.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_corestatstest.py
index 6b9fdcf3..a6a31c3c 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_corestatstest.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_corestatstest.py
@@ -33,6 +33,7 @@ class CoreStatsTest(RapidTest):
self.machines = machines
def run(self):
+ result_details = {'Details': 'Nothing'}
RapidLog.info("+------------------------------------------------------------------------------------------------------------------+")
RapidLog.info("| Measuring core statistics on 1 or more PROX instances |")
RapidLog.info("+-----------+-----------+------------+------------+------------+------------+------------+------------+------------+")
@@ -71,7 +72,7 @@ class CoreStatsTest(RapidTest):
old_tsc[i] = new_tsc[i]
tot_drop[i] = tot_drop[i] + tx - rx
RapidLog.info('|{:>10.0f}'.format(i)+ ' |{:>10.0f}'.format(duration)+' | ' + '{:>10.0f}'.format(rx) + ' | ' +'{:>10.0f}'.format(tx) + ' | '+'{:>10.0f}'.format(non_dp_rx)+' | '+'{:>10.0f}'.format(non_dp_tx)+' | ' + '{:>10.0f}'.format(tx-rx) + ' | '+ '{:>10.0f}'.format(non_dp_tx-non_dp_rx) + ' | '+'{:>10.0f}'.format(tot_drop[i]) +' |')
- variables = {'test': self.test['test'],
+ result_details = {'test': self.test['test'],
'environment_file': self.test['environment_file'],
'PROXID': i,
'StepSize': duration,
@@ -80,10 +81,10 @@ class CoreStatsTest(RapidTest):
'NonDPReceived': non_dp_rx,
'NonDPSent': non_dp_tx,
'Dropped': tot_drop[i]}
- self.post_data('rapid_corestatstest', variables)
+ result_details = self.post_data('rapid_corestatstest', result_details)
if machines_to_go == 0:
duration = duration - 1
machines_to_go = len (self.machines)
RapidLog.info("+-----------+-----------+------------+------------+------------+------------+------------+------------+------------+")
- return (True)
+ return (True, result_details)
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py
index 0123a865..c4308b1f 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py
@@ -267,8 +267,8 @@ class FlowSizeTest(RapidTest):
'PacketsLost': endabs_dropped,
'bucket_size': bucket_size,
'buckets': endbuckets}
- self.post_data('rapid_flowsizetest', result_details)
+ result_details = self.post_data('rapid_flowsizetest', result_details)
else:
RapidLog.info('|{:>7}'.format(str(flow_number))+" | Speed 0 or close to 0")
self.gen_machine.stop_latency_cores()
- return (TestPassed,result_details)
+ return (TestPassed, result_details)
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_impairtest.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_impairtest.py
index 8b7f876e..2e55aeaa 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_impairtest.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_impairtest.py
@@ -36,6 +36,7 @@ class ImpairTest(RapidTest):
self.test['lat_percentile'] = lat_percentile
def run(self):
+ result_details = {'Details': 'Nothing'}
imix = self.test['imix']
size = mean (imix)
flow_number = self.test['flowsize']
@@ -65,7 +66,7 @@ class ImpairTest(RapidTest):
else:
lat_warning = ''
RapidLog.info(self.report_result(attempts,size,speed,pps_req_tx,pps_tx,pps_sut_tx,pps_rx,lat_avg,lat_perc,lat_perc_max,lat_max,abs_tx,abs_rx,abs_dropped,actual_duration))
- variables = {'test': self.test['test'],
+ result_details = {'test': self.test['test'],
'environment_file': self.test['environment_file'],
'Flows': flow_number,
'Size': size,
@@ -81,6 +82,6 @@ class ImpairTest(RapidTest):
'DropRate': drop_rate,
'bucket_size': bucket_size,
'buckets': buckets}
- self.post_data('rapid_impairtest', variables)
+ result_details = self.post_data('rapid_impairtest', result_details)
self.gen_machine.stop_latency_cores()
- return (True)
+ return (True, result_details)
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_irqtest.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_irqtest.py
index 3b3ef949..1afa0f19 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_irqtest.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_irqtest.py
@@ -94,4 +94,4 @@ class IrqTest(RapidTest):
for j,bucket in enumerate(buckets):
variables['B{}'.format(column_names[j].replace(">","M").replace("<","").replace(" ",""))] = irq[i][j]
self.post_data('rapid_irqtest', variables)
- return (True)
+ return (True, None)
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_portstatstest.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_portstatstest.py
index 90bf5b28..135770fd 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_portstatstest.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_portstatstest.py
@@ -33,6 +33,7 @@ class PortStatsTest(RapidTest):
self.machines = machines
def run(self):
+ result_details = {'Details': 'Nothing'}
RapidLog.info("+---------------------------------------------------------------------------+")
RapidLog.info("| Measuring port statistics on 1 or more PROX instances |")
RapidLog.info("+-----------+-----------+------------+------------+------------+------------+")
@@ -66,7 +67,7 @@ class PortStatsTest(RapidTest):
old_errors[i] = new_errors[i]
old_tsc[i] = new_tsc[i]
RapidLog.info('|{:>10.0f}'.format(i)+ ' |{:>10.0f}'.format(duration)+' | ' + '{:>10.0f}'.format(rx) + ' | ' +'{:>10.0f}'.format(tx) + ' | '+'{:>10.0f}'.format(no_mbufs)+' | '+'{:>10.0f}'.format(errors)+' |')
- variables = {'test': self.test['test'],
+ result_details = {'test': self.test['test'],
'environment_file': self.test['environment_file'],
'PROXID': i,
'StepSize': duration,
@@ -74,9 +75,9 @@ class PortStatsTest(RapidTest):
'Sent': tx,
'NoMbufs': no_mbufs,
'iErrMiss': errors}
- self.post_data('rapid_corestatstest', variables)
+ result_details = self.post_data('rapid_corestatstest', result_details)
if machines_to_go == 0:
duration = duration - 1
machines_to_go = len (self.machines)
RapidLog.info("+-----------+-----------+------------+------------+------------+------------+")
- return (True)
+ return (True, result_details)
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,
diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_warmuptest.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_warmuptest.py
index 55f07be4..32579f84 100644
--- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_warmuptest.py
+++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_warmuptest.py
@@ -48,4 +48,4 @@ class WarmupTest(RapidTest):
self.gen_machine.stop()
# gen_machine['socket'].set_value(gencores,0,56,50,1)
time.sleep(WARMUPTIME)
- return (True)
+ return (True, None)