Skip to content

Commit

Permalink
Added maverick code
Browse files Browse the repository at this point in the history
Signed-off-by: Jyothsna-setti <[email protected]>
  • Loading branch information
Jyothsna-setti committed May 20, 2022
1 parent 11812e1 commit 533057a
Showing 1 changed file with 47 additions and 44 deletions.
91 changes: 47 additions & 44 deletions tests/e2e/interOp/Maverick/android/test_maverick.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@ def test_ap_reboot(self, setup_controller, get_configuration, get_apnos):
iwinfo = ap_ssh.get_iwinfo()
print("iwinfo:")
print(iwinfo)
allure.attach(name="Status before reboot:", body=str(gw, connected, iwinfo))
maverick = ap_ssh.set_maverick()
print("maverick:")
print(maverick)
allure.attach(name="Status before maverick:", body=str(gw, connected, iwinfo))
device_name = get_configuration['access_point'][0]['serial']
payload = {
"serialNumber": device_name,
"when": 0
}
resp = setup_controller.ap_reboot(device_name, payload)
resp = setup_controller.ap_maverick(device_name, payload)
time.sleep(120)
print(resp.json())
allure.attach(name="Reboot", body=str(resp.json()), attachment_type=allure.attachment_type.JSON)
allure.attach(name="Maverick", body=str(resp.json()), attachment_type=allure.attachment_type.JSON)
for ap in get_configuration['access_point']:
cmd = "uci show ucentral"
print(get_configuration['access_point'])
Expand All @@ -46,47 +49,47 @@ def test_ap_reboot(self, setup_controller, get_configuration, get_apnos):
iwinfo1 = ap_ssh.get_iwinfo()
print("iwinfo1:")
print(iwinfo1)
allure.attach(name="Status after reboot:", body=str(gw1, connected1, iwinfo1))
allure.attach(name="Status after maverick:", body=str(gw1, connected1, iwinfo1))
assert (resp.status_code == 200) & (gw == gw1) & (connected == connected1) & (iwinfo == iwinfo1)

def test_ap_factory_reset(self, setup_controller, get_configuration, get_apnos):
for ap in get_configuration['access_point']:
cmd = "uci show ucentral"
print(get_configuration['access_point'])
ap_ssh = get_apnos(ap, pwd="../libs/apnos/", sdk="2.x")
gw = ap_ssh.run_generic_command(cmd)
print("Status:")
print(gw)
connected, latest, active = ap_ssh.get_ucentral_status()
print("Connected:")
print(connected)
iwinfo = ap_ssh.get_iwinfo()
print("iwinfo:")
print(iwinfo)
allure.attach(name="Status before factory reset:", body=str(gw, connected, iwinfo))
device_name = get_configuration['access_point'][0]['serial']
payload = {
"serialNumber": device_name,
"when": 0,
"keepRedirector": True
}
resp = setup_controller.ap_factory_reset(device_name, payload)
time.sleep(150)
print(resp.json())
allure.attach(name="Factory Reset", body=str(resp.json()), attachment_type=allure.attachment_type.JSON)
for ap in get_configuration['access_point']:
cmd = "uci show ucentral"
print(get_configuration['access_point'])
ap_ssh = get_apnos(ap, pwd="../libs/apnos/", sdk="2.x")
gw1 = ap_ssh.run_generic_command(cmd)
print("Status:")
print(gw1)
connected1, latest1, active1 = ap_ssh.get_ucentral_status()
print("Connected1:")
print(connected1)
iwinfo1 = ap_ssh.get_iwinfo()
print("iwinfo1:")
print(iwinfo1)
allure.attach(name="Status after factory reset:", body=str(gw1, connected1, iwinfo1))
assert (resp.status_code == 200) & (gw == gw1) & (connected == connected1) & (iwinfo == iwinfo1)
# def test_ap_factory_reset(self, setup_controller, get_configuration, get_apnos):
# for ap in get_configuration['access_point']:
# cmd = "uci show ucentral"
# print(get_configuration['access_point'])
# ap_ssh = get_apnos(ap, pwd="../libs/apnos/", sdk="2.x")
# gw = ap_ssh.run_generic_command(cmd)
# print("Status:")
# print(gw)
# connected, latest, active = ap_ssh.get_ucentral_status()
# print("Connected:")
# print(connected)
# iwinfo = ap_ssh.get_iwinfo()
# print("iwinfo:")
# print(iwinfo)
# allure.attach(name="Status before factory reset:", body=str(gw, connected, iwinfo))
# device_name = get_configuration['access_point'][0]['serial']
# payload = {
# "serialNumber": device_name,
# "when": 0,
# "keepRedirector": True
# }
# resp = setup_controller.ap_factory_reset(device_name, payload)
# time.sleep(150)
# print(resp.json())
# allure.attach(name="Factory Reset", body=str(resp.json()), attachment_type=allure.attachment_type.JSON)
# for ap in get_configuration['access_point']:
# cmd = "uci show ucentral"
# print(get_configuration['access_point'])
# ap_ssh = get_apnos(ap, pwd="../libs/apnos/", sdk="2.x")
# gw1 = ap_ssh.run_generic_command(cmd)
# print("Status:")
# print(gw1)
# connected1, latest1, active1 = ap_ssh.get_ucentral_status()
# print("Connected1:")
# print(connected1)
# iwinfo1 = ap_ssh.get_iwinfo()
# print("iwinfo1:")
# print(iwinfo1)
# allure.attach(name="Status after factory reset:", body=str(gw1, connected1, iwinfo1))
# assert (resp.status_code == 200) & (gw == gw1) & (connected == connected1) & (iwinfo == iwinfo1)

0 comments on commit 533057a

Please sign in to comment.