Skip to content

Commit

Permalink
Reporting test details for all tests
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Luc Provoost committed Dec 8, 2020
1 parent 50f6063 commit d5801e4
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 60 deletions.
49 changes: 19 additions & 30 deletions VNFs/DPPD-PROX/helper-scripts/rapid/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions VNFs/DPPD-PROX/helper-scripts/rapid/rapid_corestatstest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(self, test_param, runtime, testname, environment_file,
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("+-----------+-----------+------------+------------+------------+------------+------------+------------+------------+")
Expand Down Expand Up @@ -71,7 +72,7 @@ def run(self):
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,
Expand All @@ -80,10 +81,10 @@ def run(self):
'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)

4 changes: 2 additions & 2 deletions VNFs/DPPD-PROX/helper-scripts/rapid/rapid_flowsizetest.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ def run(self):
'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)
7 changes: 4 additions & 3 deletions VNFs/DPPD-PROX/helper-scripts/rapid/rapid_impairtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(self, test_param, lat_percentile, runtime, testname,
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']
Expand Down Expand Up @@ -65,7 +66,7 @@ def run(self):
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,
Expand All @@ -81,6 +82,6 @@ def run(self):
'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)
2 changes: 1 addition & 1 deletion VNFs/DPPD-PROX/helper-scripts/rapid/rapid_irqtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ def run(self):
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)
7 changes: 4 additions & 3 deletions VNFs/DPPD-PROX/helper-scripts/rapid/rapid_portstatstest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(self, test_param, runtime, testname, environment_file,
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("+-----------+-----------+------------+------------+------------+------------+")
Expand Down Expand Up @@ -66,17 +67,17 @@ def run(self):
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,
'Received': rx,
'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)
26 changes: 9 additions & 17 deletions VNFs/DPPD-PROX/helper-scripts/rapid/rapid_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,29 +114,21 @@ def record_stop_time(self):
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,
Expand Down
2 changes: 1 addition & 1 deletion VNFs/DPPD-PROX/helper-scripts/rapid/rapid_warmuptest.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ def run(self):
self.gen_machine.stop()
# gen_machine['socket'].set_value(gencores,0,56,50,1)
time.sleep(WARMUPTIME)
return (True)
return (True, None)

0 comments on commit d5801e4

Please sign in to comment.