mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 11:18:03 +00:00
DUT information from KPI files
Signed-off-by: Matthew Stidham <stidmatt@gmail.com>
This commit is contained in:
@@ -206,6 +206,9 @@ class GhostRequest:
|
|||||||
tags='custom',
|
tags='custom',
|
||||||
authors=authors)
|
authors=authors)
|
||||||
|
|
||||||
|
def list_append(self, list_1, value):
|
||||||
|
list_1.append(value)
|
||||||
|
|
||||||
def kpi_to_ghost(self,
|
def kpi_to_ghost(self,
|
||||||
authors,
|
authors,
|
||||||
folders,
|
folders,
|
||||||
@@ -272,6 +275,10 @@ class GhostRequest:
|
|||||||
df = csvreader.read_csv(file=target_file, sep='\t')
|
df = csvreader.read_csv(file=target_file, sep='\t')
|
||||||
csv_testbed = csvreader.get_column(df, 'test-rig')[0]
|
csv_testbed = csvreader.get_column(df, 'test-rig')[0]
|
||||||
pass_fail = Counter(csvreader.get_column(df, 'pass/fail'))
|
pass_fail = Counter(csvreader.get_column(df, 'pass/fail'))
|
||||||
|
dut_hw = csvreader.get_column(df, 'dut-hw-version')[0]
|
||||||
|
dut_sw = csvreader.get_column(df, 'dut-sw-version')[0]
|
||||||
|
dut_model = csvreader.get_column(df, 'dut-model-num')[0]
|
||||||
|
dut_serial = csvreader.get_column(df, 'dut-serial-num')[0]
|
||||||
if pass_fail['PASS'] + pass_fail['FAIL'] > 0:
|
if pass_fail['PASS'] + pass_fail['FAIL'] > 0:
|
||||||
text = text + 'Tests passed: %s<br />' % pass_fail['PASS']
|
text = text + 'Tests passed: %s<br />' % pass_fail['PASS']
|
||||||
text = text + 'Tests failed: %s<br />' % pass_fail['FAIL']
|
text = text + 'Tests failed: %s<br />' % pass_fail['FAIL']
|
||||||
@@ -282,9 +289,7 @@ class GhostRequest:
|
|||||||
print("Failure")
|
print("Failure")
|
||||||
target_folders.remove(target_folder)
|
target_folders.remove(target_folder)
|
||||||
break
|
break
|
||||||
if len(csv_testbed) > 2:
|
testbeds.append(csv_testbed)
|
||||||
testbed = csv_testbed
|
|
||||||
testbeds.append(testbed)
|
|
||||||
if testbed == 'Unknown Testbed':
|
if testbed == 'Unknown Testbed':
|
||||||
raise UserWarning('Please define your testbed')
|
raise UserWarning('Please define your testbed')
|
||||||
|
|
||||||
@@ -340,10 +345,10 @@ class GhostRequest:
|
|||||||
datasource=grafana_datasource,
|
datasource=grafana_datasource,
|
||||||
bucket=grafana_bucket)
|
bucket=grafana_bucket)
|
||||||
|
|
||||||
try:
|
|
||||||
text = 'Testbed: %s<br />' % testbeds[0]
|
text = 'Testbed: %s<br />' % testbeds[0]
|
||||||
except:
|
dut_table = '<table><tr><td>DUT_HW</td><td>DUT_SW</td><td>DUT model</td><td>DUT Serial</td></tr>' \
|
||||||
text = ''
|
'<tr><td>%s</td><td>%s</td>%s</td><td>%s</td></tr></table>' % (dut_hw, dut_sw, dut_model, dut_serial)
|
||||||
|
text = text + dut_table
|
||||||
|
|
||||||
for pdf in pdfs:
|
for pdf in pdfs:
|
||||||
text = text + pdf
|
text = text + pdf
|
||||||
@@ -370,5 +375,3 @@ class GhostRequest:
|
|||||||
tags='custom',
|
tags='custom',
|
||||||
authors=authors)
|
authors=authors)
|
||||||
|
|
||||||
for folder in target_folders:
|
|
||||||
shutil.rmtree(folder)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user