mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-11-03 20:27:54 +00:00 
			
		
		
		
	Merge branch 'master' of github.com:greearb/lanforge-scripts
This commit is contained in:
		@@ -75,6 +75,7 @@ import pprint
 | 
				
			|||||||
import argparse
 | 
					import argparse
 | 
				
			||||||
import subprocess
 | 
					import subprocess
 | 
				
			||||||
import xlsxwriter
 | 
					import xlsxwriter
 | 
				
			||||||
 | 
					import math
 | 
				
			||||||
 | 
					
 | 
				
			||||||
NL = "\n"
 | 
					NL = "\n"
 | 
				
			||||||
CR = "\r\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("--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')
 | 
					   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
 | 
					   args = None
 | 
				
			||||||
   try:
 | 
					   try:
 | 
				
			||||||
@@ -329,13 +332,13 @@ def main():
 | 
				
			|||||||
        
 | 
					        
 | 
				
			||||||
   # Full spread-sheet data
 | 
					   # Full spread-sheet data
 | 
				
			||||||
   csv = open(full_outfile, "w")
 | 
					   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.write("\n");
 | 
				
			||||||
   csv.flush()
 | 
					   csv.flush()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   # Summary spread-sheet data
 | 
					   # Summary spread-sheet data
 | 
				
			||||||
   csvs = open(outfile, "w")
 | 
					   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.write("\n");
 | 
				
			||||||
   csvs.flush()
 | 
					   csvs.flush()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -442,6 +445,8 @@ def main():
 | 
				
			|||||||
   worksheet.write(row, col, 'Offset\n4', dyel_bold); col += 1
 | 
					   worksheet.write(row, col, 'Offset\n4', dyel_bold); col += 1
 | 
				
			||||||
   worksheet.set_column(col, col, 12) # Set width
 | 
					   worksheet.set_column(col, col, 12) # Set width
 | 
				
			||||||
   worksheet.write(row, col, "PASS /\nFAIL\n( += %s dBm)"%(pf_dbm), dgreen_bold); col += 1
 | 
					   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 Stamp\n', dgreen_bold); col += 1
 | 
				
			||||||
   worksheet.set_column(col, col, 100) # Set width
 | 
					   worksheet.set_column(col, col, 100) # Set width
 | 
				
			||||||
   worksheet.write(row, col, 'Warnings and Errors', dgreen_bold_left); col += 1
 | 
					   worksheet.write(row, col, 'Warnings and Errors', dgreen_bold_left); col += 1
 | 
				
			||||||
   row += 1
 | 
					   row += 1
 | 
				
			||||||
@@ -1189,7 +1194,7 @@ def main():
 | 
				
			|||||||
                           failed_low += 1
 | 
					                           failed_low += 1
 | 
				
			||||||
                           least = min(least, diff_a4)
 | 
					                           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
 | 
					                           pf = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                       if (diff_a1 > pfrange):
 | 
					                       if (diff_a1 > pfrange):
 | 
				
			||||||
@@ -1203,26 +1208,29 @@ def main():
 | 
				
			|||||||
                       
 | 
					                       
 | 
				
			||||||
                   print("_nss {}  allowed_per_path (AP should be transmitting at) {}".format(_nss, allowed_per_path))
 | 
					                   print("_nss {}  allowed_per_path (AP should be transmitting at) {}".format(_nss, allowed_per_path))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                   if (pf == 0):
 | 
					                   if (pf == 0):
 | 
				
			||||||
                       pfs = "FAIL"
 | 
					                       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("%Y-%m-%d %H:%M:%S", time.localtime()) + "{:.3f}".format(time.time() - (math.floor(time.time())))[1:]  
 | 
				
			||||||
 | 
					                   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,
 | 
					                       myrd, pathloss, antenna_gain, ch, n, bw, tx, beacon_sig, sig,
 | 
				
			||||||
                       antstr, _ap, _bw, _ch, _mode, _nss, _noise, _rxrate,
 | 
					                       antstr, _ap, _bw, _ch, _mode, _nss, _noise, _rxrate,
 | 
				
			||||||
                       cc_mac, cc_ch, cc_power, cc_dbm,
 | 
					                       cc_mac, cc_ch, cc_power, cc_dbm,
 | 
				
			||||||
                       calc_dbm, diff_dbm, calc_ant1, calc_ant2, calc_ant3, calc_ant4,
 | 
					                       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))
 | 
					                   #print("RESULT: %s"%(ln))
 | 
				
			||||||
                   csv.write(ln)
 | 
					                   csv.write(ln)
 | 
				
			||||||
                   csv.write("\t")
 | 
					                   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,
 | 
					                       myrd, pathloss, antenna_gain, _ch, _nss, _bw, tx, allowed_per_path,
 | 
				
			||||||
                       antstr,
 | 
					                       antstr,
 | 
				
			||||||
                       calc_ant1, calc_ant2, calc_ant3, calc_ant4,
 | 
					                       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(ln)
 | 
				
			||||||
                   csvs.write("\t")
 | 
					                   csvs.write("\t")
 | 
				
			||||||
@@ -1274,7 +1282,7 @@ def main():
 | 
				
			|||||||
                       worksheet.write(row, col, pfs, red); col += 1
 | 
					                       worksheet.write(row, col, pfs, red); col += 1
 | 
				
			||||||
                   else:
 | 
					                   else:
 | 
				
			||||||
                       worksheet.write(row, col, pfs, green); col += 1
 | 
					                       worksheet.write(row, col, pfs, green); col += 1
 | 
				
			||||||
 | 
					                   worksheet.write(row, col, time_stamp, green); col += 1
 | 
				
			||||||
                   if (_bw != bw):
 | 
					                   if (_bw != bw):
 | 
				
			||||||
                       err = "ERROR:  Requested bandwidth: %s != station's reported bandwidth: %s.  "%(bw, _bw)
 | 
					                       err = "ERROR:  Requested bandwidth: %s != station's reported bandwidth: %s.  "%(bw, _bw)
 | 
				
			||||||
                       e_tot += err
 | 
					                       e_tot += err
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user