lf_tx_power.py : Cannot disable MCS lower data rates when higher data rates are enabled

needed to disable the MCS in a specific order
cc_module_9800_3504.py : pass in spatial_stream and mcs_tx_index as strings
wifi_ctl_9800_3504.py : log out loop changed from 100 to 7 added the BAD IP
string for log out.  log out times out then exit

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2022-04-16 09:17:19 -06:00
committed by shivam
parent 1fed5f423c
commit e04719e8d8
3 changed files with 90 additions and 59 deletions

View File

@@ -277,10 +277,10 @@ class create_controller_series_object:
elif self.action in ["ap_dot11_dot11ax_mcs_tx_index_spatial_stream", "no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream"]:
self.command_extend = [
"--action", self.action,
"--spatial_stream", self.spatial_stream,
"--mcs_tx_index", self.mcs_tx_index
"--spatial_stream", str(self.spatial_stream),
"--mcs_tx_index", str(self.mcs_tx_index)
]
self.command.extend(self.command_extend)
# possible need to look for exact command
elif self.action in ["summary", "show_radio", "no_logging_console", "line_console_0", "show_ap_wlan_summary", "show_wlan_summary", "show_wlan_id",

View File

@@ -556,11 +556,12 @@ def main():
outfile_path = report.get_report_path()
current_time = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime())
test_name = ('Tx Power: ' + 'AP: ' + args.ap + ', Band: ' + args.band + ', Channel: ' + args.channel
if (args.outfile):
test_name = ('Tx Power:' + args.outfile + 'AP: ' + args.ap + ', Band: ' + args.band + ', Channel: ' + args.channel
+ ', NSS: ' + args.nss
+ ', BW: ' + args.bandwidth
+ ', Tx Power: ' + args.txpower)
if (args.outfile):
outfile_tmp = (outfile_path + '/' + current_time + '_' + args.outfile
+ '_AP_' + args.ap
+ '_band_' + args.band
@@ -569,6 +570,11 @@ def main():
+ '_bw_' + args.bandwidth.replace(' ', '_')
+ '_tx_pw_' + args.txpower.replace(' ', '_'))
else:
test_name = ('Tx Power:' + 'AP: ' + args.ap + ', Band: ' + args.band + ', Channel: ' + args.channel
+ ', NSS: ' + args.nss
+ ', BW: ' + args.bandwidth
+ ', Tx Power: ' + args.txpower)
outfile_tmp = (outfile_path + '/' + current_time + '_' + 'tx_power'
+ '_AP_' + args.ap
+ '_band_' + args.band
@@ -1015,7 +1021,7 @@ def main():
# these are set to configure the number of spatial streams and MCS values
# 5g has 8 spatial streams , MCS is 7, 9, 11
# ap dot11 6ghz dot11ax mcs tx index 7 spatial-stream 1 << - turn on
# no ap dot11 6ghz dot11ax mcs tx index 7 spatial-stream 2 <<-- turn off
# no ap dot11 6ghz dot11ax mcs tx index 7 www.you-stream 2 <<-- turn off
# Loop through all iterations and run txpower tests.
# The is the main loop of loops: Channels, spatial streams (nss), bandwidth (bw), txpowers (tx)
@@ -1036,108 +1042,123 @@ def main():
ch = cha[0]
for n in nss:
if (n != "NA" and args.set_nss):
# Disable the wlan to set the spatial streams
# Disable wlan, apply settings, Enable wlan
if args.band == "dual_band_6g":
cs.ap_dot11_dual_band_6ghz_shutdown()
elif args.band == "dual_band_5g":
cs.ap_dot11_dual_band_5ghz_shutdown()
elif args.band == "6g":
cs.ap_dot11_6ghz_shutdown()
elif args.band == "5g":
cs.ap_dot11_5ghz_shutdown()
elif args.band == "24g":
cs.ap_dot11_24ghz_shutdown()
# the band will be set
num_spatial_streams = int(n)
# set the spatial streams for - need to disable the wlan and re-enable
# ap dot11 dot11ax mcs tx index 7 spatial-stream 1 << - turn on
# no ap dot11 dot11ax mcs tx index 7 spatial-stream 2 <<-- turn off
# Cannot disable MCS lower data rates when higher data rates are enabled
if num_spatial_streams == 1 or num_spatial_streams == 2 or num_spatial_streams == 3 or num_spatial_streams == 4:
cs.spatial_stream = 1
cs.mcs_tx_index = 11
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 9
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 7
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 9
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 11
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream_1()
if num_spatial_streams == 2 or num_spatial_streams == 3 or num_spatials_streams == 4:
if num_spatial_streams == 2 or num_spatial_streams == 3 or num_spatial_streams == 4:
cs.spatial_stream = 2
cs.mcs_tx_index = 11
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 9
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 7
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 9
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 11
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream_1()
else:
cs.spatial_stream = 2
cs.mcs_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 7
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream_1()
if num_spatial_streams == 3 or num_spatials_streams == 4:
if num_spatial_streams == 3 or num_spatial_streams == 4:
cs.spatial_stream = 3
cs.mcs_tx_index = 11
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 9
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 7
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 9
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 11
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream_1()
else:
cs.spatial_stream = 3
cs.mcs_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 7
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream_1()
if num_spatials_streams == 4:
if num_spatial_streams == 4:
cs.spatial_stream = 3
cs.mcs_tx_index = 11
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 9
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 7
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 9
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 11
cs.ap_dot11_dot11ax_mcs_tx_index_spatial_stream_1()
else:
cs.spatial_stream = 4
cs.mcs_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 7
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream_1()
if args.band == '5g' or args.band == 'dual_band_5g':
# turn off spatial streams 5 - 8
# disable spatial stream 5
cs.spatial_stream = 5
cs.mcs_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 7
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream_1()
# disable spatial stream 6
cs.spatial_stream = 6
cs.mcs_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 7
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream_1()
# disable spatial stream 7
cs.spatial_stream = 7
cs.mcs_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 7
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream_1()
# disable spatial stream 8
cs.spatial_stream = 8
cs.mcs_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.mcs_tx_index = 7
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 9
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream()
cs.msc_tx_index = 11
cs.no_ap_dot11_dot11ax_mcs_tx_index_spatial_stream_1()
for bw in bandwidths:
if (n != "NA"):

View File

@@ -254,6 +254,7 @@ def main():
CCP_POLICY_TAG = args.prompt + "(config-policy-tag)#" # WLC(config-policy-tag)#
CCP_CONFIG_LINE = args.prompt + "(config-line)#" # WLC(config-line)#
CCP_FINGERPRINT = "you want to continue connecting (yes/no/[fingerprint])?"
CCP_BAD_IP = "% Bad IP address or host name% Unknown command or computer name, or unable to find computer address"
'''print("CCP {}".format(CCP))
print("CCP_EN {}".format(CCP_EN))
@@ -1949,9 +1950,9 @@ def main():
logg.info("command sent {}".format(command))
logged_out_9800 = False
loop_count = 0
while logged_out_9800 == False and loop_count <= 100:
while logged_out_9800 == False and loop_count <= 7:
loop_count += 1
i = egg.expect_exact([CCP, CCP_EN, CCP_CONFIG, CCP_CONFIG_WLAN, CCP_POLICY_TAG, CCP_CONFIG_LINE, pexpect.TIMEOUT, "--More--"], timeout=timeout)
i = egg.expect_exact([CCP, CCP_EN, CCP_CONFIG, CCP_CONFIG_WLAN, CCP_POLICY_TAG, CCP_CONFIG_LINE, "--More--", CCP_BAD_IP, pexpect.TIMEOUT], timeout=timeout)
logg.info("expect index: %s" % i)
print(egg.before.decode('utf-8', 'ignore')) # allows program that calls from subprocess to see output from command
if i == 0:
@@ -1973,6 +1974,7 @@ def main():
if i == 2:
logg.info("{} prompt received will send exit, loop_count: {}".format(CCP_CONFIG, loop_count))
try:
# exit will go one prompt up
egg.sendline("exit")
sleep(0.2)
logged_out_9800 = True
@@ -1982,6 +1984,7 @@ def main():
if i == 3:
logg.info("{} prompt received will send end, loop_count: {}".format(CCP_CONFIG_WLAN, loop_count))
try:
# end will go to the # prompt
egg.sendline("end")
sleep(0.2)
except BaseException:
@@ -2003,12 +2006,19 @@ def main():
except BaseException:
logg.info("9800 exception on end")
sleep(0.1)
if i == 6:
logg.info("9800 expect timeout loop_count: {}".format(loop_count))
egg.sendline("end")
if i == 7: # --More--
if i == 6: # --More--
logg.info("9800 found --More--, sending space")
egg.send(SEND_MORE)
if i == 7: # BAD IP
logg.info("9800 expect timeout loop_count: {}".format(loop_count))
egg.sendline("exit")
logged_out_9800 = True
# Timeout - try to exit
if i == 8:
logg.info("9800 expect timeout loop_count: {}".format(loop_count))
egg.sendline("exit")
logged_out_9800 = True
if(logged_out_9800 == False):
logg.info("######################################################################################")