From 68fd11094a22b87a3f3ff16de3a07069ad68196e Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 30 Oct 2020 09:11:21 -0600 Subject: [PATCH 1/5] lf_cisco_power.py : any spatial stream out of range will fail test --- lf_cisco_power.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lf_cisco_power.py b/lf_cisco_power.py index 54aeaae8..567ca0c3 100755 --- a/lf_cisco_power.py +++ b/lf_cisco_power.py @@ -1189,7 +1189,7 @@ def main(): failed_low += 1 least = min(least, diff_a4) - if ((least < (-pfrange - pf_a4_dropoff)) or (failed_low > 1)): + if ((least < (-pfrange - pf_a4_dropoff)) or (failed_low >= 1)): pf = 0 if (diff_a1 > pfrange): From 8ee73a1d2c49d87e03aa3c1e77081e886715f41a Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 30 Oct 2020 09:53:51 -0600 Subject: [PATCH 2/5] lf_cisco_power.py: add timestamp to results --- lf_cisco_power.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lf_cisco_power.py b/lf_cisco_power.py index 567ca0c3..ad32e332 100755 --- a/lf_cisco_power.py +++ b/lf_cisco_power.py @@ -442,6 +442,8 @@ def main(): worksheet.write(row, col, 'Offset\n4', dyel_bold); col += 1 worksheet.set_column(col, col, 12) # Set width worksheet.write(row, col, "PASS /\nFAIL\n( += %s dBm)"%(pf_dbm), dgreen_bold); col += 1 + worksheet.set_column(col, col, 12) # Set width + worksheet.write(row, col, 'Time\n4', dyel_bold); col += 1 worksheet.set_column(col, col, 100) # Set width worksheet.write(row, col, 'Warnings and Errors', dgreen_bold_left); col += 1 row += 1 @@ -1203,26 +1205,28 @@ def main(): print("_nss {} allowed_per_path (AP should be transmitting at) {}".format(_nss, allowed_per_path)) + + if (pf == 0): pfs = "FAIL" - - ln = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s"%( + time_stamp = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime()) + ln = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s"%( myrd, pathloss, antenna_gain, ch, n, bw, tx, beacon_sig, sig, antstr, _ap, _bw, _ch, _mode, _nss, _noise, _rxrate, cc_mac, cc_ch, cc_power, cc_dbm, calc_dbm, diff_dbm, calc_ant1, calc_ant2, calc_ant3, calc_ant4, - diff_a1, diff_a2, diff_a3, diff_a4, pfs + diff_a1, diff_a2, diff_a3, diff_a4, pfs, time_stamp ) #print("RESULT: %s"%(ln)) csv.write(ln) csv.write("\t") - ln = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s"%( + ln = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s"%( myrd, pathloss, antenna_gain, _ch, _nss, _bw, tx, allowed_per_path, antstr, calc_ant1, calc_ant2, calc_ant3, calc_ant4, - diff_a1, diff_a2, diff_a3, diff_a4, pfs + diff_a1, diff_a2, diff_a3, diff_a4, pfs, time_stamp ) csvs.write(ln) csvs.write("\t") @@ -1274,7 +1278,7 @@ def main(): worksheet.write(row, col, pfs, red); col += 1 else: worksheet.write(row, col, pfs, green); col += 1 - + worksheet.write(row, col, time_stamp, center_pink); col += 1 if (_bw != bw): err = "ERROR: Requested bandwidth: %s != station's reported bandwidth: %s. "%(bw, _bw) e_tot += err From 106d018d1bebe355cd3c4f812957002087a74072 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 30 Oct 2020 09:53:51 -0600 Subject: [PATCH 3/5] lf_cisco_power.py: add timestamp to results --- lf_cisco_power.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lf_cisco_power.py b/lf_cisco_power.py index ad32e332..dc2bec37 100755 --- a/lf_cisco_power.py +++ b/lf_cisco_power.py @@ -75,6 +75,7 @@ import pprint import argparse import subprocess import xlsxwriter +import math NL = "\n" CR = "\r\n" @@ -217,6 +218,8 @@ def main(): parser.add_argument("--vht160", help="--vht160 , Enable VHT160 in lanforge ", action='store_true') parser.add_argument("--verbose", help="--verbose , switch present will have verbose logging", action='store_true') + #current_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + "{:.3f}".format(time.time() - (math.floor(time.time())))[1:] + #print(current_time) args = None try: @@ -329,13 +332,13 @@ def main(): # Full spread-sheet data csv = open(full_outfile, "w") - csv.write("Regulatory Domain\tCabling Pathloss\tAntenna Gain\tCfg-Channel\tCfg-NSS\tCfg-AP-BW\tTx Power\tBeacon-Signal%s\tCombined-Signal%s\tRSSI 1\tRSSI 2\tRSSI 3\tRSSI 4\tAP-BSSID\tRpt-BW\tRpt-Channel\tRpt-Mode\tRpt-NSS\tRpt-Noise\tRpt-Rxrate\tCtrl-AP-MAC\tCtrl-Channel\tCtrl-Power\tCtrl-dBm\tCalc-dBm-Combined\tDiff-dBm-Combined\tAnt-1\tAnt-2\tAnt-3\tAnt-4\tOffset-1\tOffset-2\tOffset-3\tOffset-4\tPASS/FAIL(+-%sdB)\tWarnings-and-Errors"%(use_beacon,use_combined,pf_dbm)) + csv.write("Regulatory Domain\tCabling Pathloss\tAntenna Gain\tCfg-Channel\tCfg-NSS\tCfg-AP-BW\tTx Power\tBeacon-Signal%s\tCombined-Signal%s\tRSSI 1\tRSSI 2\tRSSI 3\tRSSI 4\tAP-BSSID\tRpt-BW\tRpt-Channel\tRpt-Mode\tRpt-NSS\tRpt-Noise\tRpt-Rxrate\tCtrl-AP-MAC\tCtrl-Channel\tCtrl-Power\tCtrl-dBm\tCalc-dBm-Combined\tDiff-dBm-Combined\tAnt-1\tAnt-2\tAnt-3\tAnt-4\tOffset-1\tOffset-2\tOffset-3\tOffset-4\tPASS/FAIL(+-%sdB)\tTimeStamp\tWarnings-and-Errors"%(use_beacon,use_combined,pf_dbm)) csv.write("\n"); csv.flush() # Summary spread-sheet data csvs = open(outfile, "w") - csvs.write("Regulatory Domain\tCabling Pathloss\tAntenna Gain\tAP Channel\tNSS\tAP BW\tTx Power\tAllowed Per-Path\tRSSI 1\tRSSI 2\tRSSI 3\tRSSI 4\tAnt-1\tAnt-2\tAnt-3\tAnt-4\tOffset-1\tOffset-2\tOffset-3\tOffset-4\tPASS/FAIL(+-%sdB)\tWarnings-and-Errors"%(pf_dbm)) + csvs.write("Regulatory Domain\tCabling Pathloss\tAntenna Gain\tAP Channel\tNSS\tAP BW\tTx Power\tAllowed Per-Path\tRSSI 1\tRSSI 2\tRSSI 3\tRSSI 4\tAnt-1\tAnt-2\tAnt-3\tAnt-4\tOffset-1\tOffset-2\tOffset-3\tOffset-4\tPASS/FAIL(+-%sdB)\tTimeStamp\tWarnings-and-Errors"%(pf_dbm)) csvs.write("\n"); csvs.flush() @@ -442,7 +445,11 @@ def main(): worksheet.write(row, col, 'Offset\n4', dyel_bold); col += 1 worksheet.set_column(col, col, 12) # Set width worksheet.write(row, col, "PASS /\nFAIL\n( += %s dBm)"%(pf_dbm), dgreen_bold); col += 1 +<<<<<<< HEAD worksheet.set_column(col, col, 12) # Set width +======= + worksheet.set_column(col, col, 24) # Set width +>>>>>>> a41a41e... lf_cisco_power.py: add timestamp to results worksheet.write(row, col, 'Time\n4', dyel_bold); col += 1 worksheet.set_column(col, col, 100) # Set width worksheet.write(row, col, 'Warnings and Errors', dgreen_bold_left); col += 1 @@ -1209,7 +1216,12 @@ def main(): if (pf == 0): pfs = "FAIL" +<<<<<<< HEAD time_stamp = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime()) +======= + + time_stamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + "{:.3f}".format(time.time() - (math.floor(time.time())))[1:] +>>>>>>> a41a41e... lf_cisco_power.py: add timestamp to results ln = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s"%( myrd, pathloss, antenna_gain, ch, n, bw, tx, beacon_sig, sig, antstr, _ap, _bw, _ch, _mode, _nss, _noise, _rxrate, From 9bf6e4ff1f0876a088453399e98c91f3448358eb Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 30 Oct 2020 13:00:32 -0600 Subject: [PATCH 4/5] lf_cisco_power.py : ran pyflakes this time --- lf_cisco_power.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lf_cisco_power.py b/lf_cisco_power.py index dc2bec37..e3033a84 100755 --- a/lf_cisco_power.py +++ b/lf_cisco_power.py @@ -445,11 +445,7 @@ def main(): worksheet.write(row, col, 'Offset\n4', dyel_bold); col += 1 worksheet.set_column(col, col, 12) # Set width worksheet.write(row, col, "PASS /\nFAIL\n( += %s dBm)"%(pf_dbm), dgreen_bold); col += 1 -<<<<<<< HEAD - worksheet.set_column(col, col, 12) # Set width -======= worksheet.set_column(col, col, 24) # Set width ->>>>>>> a41a41e... lf_cisco_power.py: add timestamp to results worksheet.write(row, col, 'Time\n4', dyel_bold); col += 1 worksheet.set_column(col, col, 100) # Set width worksheet.write(row, col, 'Warnings and Errors', dgreen_bold_left); col += 1 @@ -1216,12 +1212,8 @@ def main(): if (pf == 0): pfs = "FAIL" -<<<<<<< HEAD - time_stamp = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime()) -======= time_stamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + "{:.3f}".format(time.time() - (math.floor(time.time())))[1:] ->>>>>>> a41a41e... lf_cisco_power.py: add timestamp to results ln = "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s"%( myrd, pathloss, antenna_gain, ch, n, bw, tx, beacon_sig, sig, antstr, _ap, _bw, _ch, _mode, _nss, _noise, _rxrate, From 7033890f7fbe9377d82a2db61463c212c8c00962 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Fri, 30 Oct 2020 13:18:11 -0600 Subject: [PATCH 5/5] lf_cisco_power.py : fixed colors --- lf_cisco_power.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lf_cisco_power.py b/lf_cisco_power.py index e3033a84..20fb3321 100755 --- a/lf_cisco_power.py +++ b/lf_cisco_power.py @@ -446,7 +446,7 @@ def main(): worksheet.set_column(col, col, 12) # Set width worksheet.write(row, col, "PASS /\nFAIL\n( += %s dBm)"%(pf_dbm), dgreen_bold); col += 1 worksheet.set_column(col, col, 24) # Set width - worksheet.write(row, col, 'Time\n4', dyel_bold); col += 1 + worksheet.write(row, col, 'Time Stamp\n', dgreen_bold); col += 1 worksheet.set_column(col, col, 100) # Set width worksheet.write(row, col, 'Warnings and Errors', dgreen_bold_left); col += 1 row += 1 @@ -1282,7 +1282,7 @@ def main(): worksheet.write(row, col, pfs, red); col += 1 else: worksheet.write(row, col, pfs, green); col += 1 - worksheet.write(row, col, time_stamp, center_pink); col += 1 + worksheet.write(row, col, time_stamp, green); col += 1 if (_bw != bw): err = "ERROR: Requested bandwidth: %s != station's reported bandwidth: %s. "%(bw, _bw) e_tot += err