test_l3_longevity.py : removed controller programming

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2021-02-24 14:33:41 -07:00
parent 8cb00b99b5
commit c1537145e8

View File

@@ -307,420 +307,11 @@ class L3VariableTime(Realm):
if (int(sta_count) != int(self.total_stas)):
print("WARNING: Cisco Controller reported %s stations, should be %s"%(sta_count, self.total_stas))
#show summary (to get AP)
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 --action summary --series 9800 --log stdout
def controller_show_summary(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"summary"))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "summary"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}"
.format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#show ap dot11 5ghz summary (band defaults to 5ghz) --band a
#show ap dot11 24ghz summary use --band b for 2.4 ghz
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 --action advanced --series 9800 --log stdout
def controller_show_ap_summary(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"advanced"))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "advanced"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#show wlan summary
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 --action show_wlan_summary --series 9800 --log stdout
def controller_show_wlan_summary(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"show wlan summary"))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "show_wlan_summary"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#disable AP
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action disable --series 9800
def controller_disable_ap(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"disable"))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "disable"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#disable wlan
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action disable_wlan --series 9800
def controller_disable_wlan(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"disable_wlan"))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "disable_wlan"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#disable network 5ghz
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action disable_network_5ghz --series 9800
def controller_disable_network_5ghz(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"disable_network_5ghz"))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "disable_network_5ghz"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#disable network 24ghz
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action disable_network_24ghz --series 9800
def controller_disable_network_24ghz(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"disable_network_24ghz"))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "disable_network_24ghz"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#set manual mode - Series 9800 must be set to manual mode
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action manual --series 9800
# ap name <AP NAME> dot11 5ghz radio role manual client-serving
def controller_role_manual(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"manual"))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "manual"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#set manual mode - Series 9800 must be set to auto mode
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action auto --series 9800
# ap name <AP NAME> dot11 5ghz radio role manual client-serving
def controller_role_auto(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,self.args.cisco_user,
self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series, self.args.cisco_band,"auto"))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band, "--action", "auto"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#test parameters summary (txPower 1-8)
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action txPower --value 5 --series 9800
def controller_set_tx_power(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {} value {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
self.args.cisco_band,"txPower", self.args.cisco_tx_power )) # TODO fix txPower to tx_power in wifi_ctl_9800_3504.py
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band,
"--action", "txPower","--value", self.args.cisco_tx_power],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#set channel [36, 64, 100]
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action channel --value 36 --series 9800
# 9800 : ap name <AP> dot11 [5ghz | 24ghz] channel <channel>
# 3504 : (Cisco Controller) >config 802.11a channel ap APA453.0E7B.CF9C 52
def controller_set_channel(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {} value {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
self.args.cisco_band,"channel", self.args.cisco_channel ))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band,
"--action", "channel","--value", self.args.cisco_channel],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#set bandwidth [20 40 80 160]
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action bandwidth --value 40 --series 9800
def controller_set_chan_width(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {} value {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
self.args.cisco_band,"channel", self.args.cisco_chan_width ))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band,
"--action", "channel","--value", self.args.cisco_chan_width],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#create wlan
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action create_wlan --wlan "open-wlan" --wlanID 1 --series 9800
def controller_create_wlan(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {} wlan {} wlanID".format(self.args.cisco_scheme,self.args.cisco_ctlr,
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
self.args.cisco_band,"create_wlan", self.args.cisco_wlan, self.args.cisco_wlanID ))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band,
"--action", "create_wlan","--wlan", self.args.cisco_wlan, "--wlanID", self.args.cisco_wlanID],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#create wireless tag policy --9800 series needs to have wireless tag policy set
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action wireless_tag_policy --series 9800
def controller_set_wireless_tag_policy(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action".format(self.args.cisco_scheme,self.args.cisco_ctlr,
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
self.args.cisco_band,"wireless_tag_policy" ))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band,
"--action", "wireless_tag_policy"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#enable wlan
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action enable_wlan --series 9800
def controller_enable_wlan(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
self.args.cisco_band,"enable_wlan"))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band,
"--action", "enable_wlan"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#enable 5ghz
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action enable_network_5ghz --series 9800
def controller_enable_network_5ghz(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
self.args.cisco_band,"enable_network_5ghz"))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band,
"--action", "enable_network_5ghz"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#enable 24ghz
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action enable_network_24ghz --series 9800
def controller_enable_network_24ghz(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
self.args.cisco_band,"enable_network_24ghz"))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band,
"--action", "enable_network_24ghz"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#enable (band a)
#./wifi_ctl_9800_3504.py --scheme ssh -d 172.19.36.168 -p <controller_pw> --port 23 -a "9120-Chamber-1" --band a --action enable --series 9800
def controller_enable_ap(self):
try:
print("scheme {} ctlr {} user {} passwd {} AP {} series {} band {} action {}".format(self.args.cisco_scheme,self.args.cisco_ctlr,
self.args.cisco_user,self.args.cisco_passwd, self.args.cisco_ap, self.args.cisco_series,
self.args.cisco_band,"enable"))
ctl_output = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--band", self.args.cisco_band,
"--action", "enable"],
capture_output=self.args.cap_ctl_out, check=True)
if self.args.cap_ctl_out:
pss = ctl_output.stdout.decode('utf-8', 'ignore')
print(pss)
except subprocess.CalledProcessError as process_error:
print("Controller unable to commicate to AP or unable to communicate to controller error code: {} output {}".
format(process_error.returncode, process_error.output))
time.sleep(1)
exit(1)
#advanced (showes summary)
@@ -774,103 +365,6 @@ class L3VariableTime(Realm):
print("configure ap {} channel {} chan_width {}".format(self.args.cisco_ap,self.args.cisco_channel,self.args.cisco_chan_width))
# Verify channel and channel width.
# for testing perposes set channel back to 36
def controller_set_channel_ap_36(self):
#(Cisco Controller) >config 802.11a channel ap APA453.0E7B.CF9C 36
cisco_channel_36 = "36"
advanced = subprocess.run(["../wifi_ctl_9800_3504.py", "--scheme", self.args.cisco_scheme, "-d", self.args.cisco_ctlr, "-u",
self.args.cisco_user, "-p", self.args.cisco_passwd,
"-a", self.args.cisco_ap,"--series", self.args.cisco_series, "--action", "channel","--value",cisco_channel_36], capture_output=True)
pss = advanced.stdout.decode('utf-8', 'ignore')
print(pss)
def verify_cac_on_ap(self):
pass
# Do this after you get the configuration Verify CAC
# use pySerial to check if the AP is configured:
# 1. You can grep for "DFS CAC timer enabled time 60"
# 2. and "changed to DFS channel 52, running CAC for 60 seconds
# Wait for 60 sec and check for this log "CAC_EXPIRY_EVT: CAC finished on DFS channel 52"
#"make a note of the time and check the CAC timer expired in 60-61 seconds."
# After CAC expires Verify Traffic. (the loop should start up may want some special detection)
def lf_hackrf_enable(self):
# hard coded for now
# need json and update to realm
#if os.path.isfile(self.args.hackrf):
# print("hack rf file found {}".format(self.args.hackrf))
#else:
# print("WARNING: hack rf file not found at {}".format(self.args.hackrf))
# look for lf_hackrf.py in local directory the look for in
pass
def verify_radar_detected_on_ap(self):
pass
#You will see logs as below in the AP:(show logging will help you getting this info)
#[*07/07/2020 23:44:27.7630] wcp/dfs :: RadarDetection: radar detected
#[*07/07/2020 23:44:27.7630] wcp/dfs :: RadarDetection: sending packet out to capwapd, slotId=1, msgLen=386, chanCnt=1 -100
#[*07/07/2020 23:44:27.7900] DOT11_DRV[1]: DFS CAC timer disabled time 0
#[*07/07/2020 23:44:27.7960] Enabling Channel and channel width Switch Announcement on current channel
#[*07/07/2020 23:44:27.8060] DOT11_DRV[1]: set_dfs Channel set to 36/20, CSA count 10
#[*07/07/2020 23:44:27.8620] DOT11_DRV[1]: DFS CAC timer enabled time 60
def verify_black_list_time_ap(self):
pass
def lf_hackrf_disable(self):
pass
#need to save the process id
# dfs dynamic frequency selection
def dfs(self):
if self.args == None:
return
if self.args.cisco_ctlr == None:
return
if self.args.cisco_dfs == False:
return
if self.args.cisco_channel == None:
return
if self.args.cisco_chan_width == None:
return
print("testing dfs")
self.controller_show_ap_channel()
self.controller_disable_ap()
self.controller_set_channel()
self.controller_set_chan_width()
self.controller_enable_ap()
self.verify_cac_on_ap()
self.lf_hackrf_enable()
self.verify_radar_detected_on_ap()
self.verify_black_list_time_ap()
self.lf_hackrf_disable()
# For Testing only - since hackrf not causing channel changes
self.controller_disable_ap()
self.controller_set_channel_ap_36()
#self.dfs_set_chan_width_ap()
self.controller_enable_ap()
#check the AP for 52 is configured or not , check the CAC timer
# verify the clien can connect back to the AP once the CAC expires (check all connections)
def controller_channel_chan_width_config(self):
if self.args == None:
return
if self.args.cisco_ctlr == None:
return
if self.args.cisco_channel == None:
return
self.controller_disable_ap()
self.controller_set_channel()
self.controller_set_chan_width()
self.controller_enable_ap()
self.controller_show_ap_channel()
# need to actually check the CAC timer
time.sleep(60)
def reset_port_check(self):
for station_profile in self.station_profiles:
@@ -916,8 +410,6 @@ class L3VariableTime(Realm):
time.sleep(5)
def build(self):
self.controller_channel_chan_width_config()
self.dfs()
index = 0
for station_profile in self.station_profiles:
station_profile.use_security(station_profile.security, station_profile.ssid, station_profile.ssid_pass)