Added comments

This commit is contained in:
Jaspreet Sachdev
2021-08-12 12:03:00 -04:00
parent 003cc25a71
commit d529676c6c
2 changed files with 47 additions and 7 deletions

View File

@@ -15,6 +15,8 @@ class TestUcentralGatewayService(object):
@pytest.mark.sdk_restapi @pytest.mark.sdk_restapi
def test_gwservice_listdevices(self, setup_controller): def test_gwservice_listdevices(self, setup_controller):
""" """
Test the list devices endpoint
WIFI-3452
""" """
resp = setup_controller.request("gw", "devices", "GET", None, None) resp = setup_controller.request("gw", "devices", "GET", None, None)
body = resp.url + "," + str(resp.status_code) + ',' + resp.text body = resp.url + "," + str(resp.status_code) + ',' + resp.text
@@ -27,6 +29,8 @@ class TestUcentralGatewayService(object):
@pytest.mark.sdk_restapi @pytest.mark.sdk_restapi
def test_gwservice_createdevice(self, setup_controller): def test_gwservice_createdevice(self, setup_controller):
""" """
Test the create device endpoint
WIFI-3453
""" """
configuration = {'uuid': '1'} configuration = {'uuid': '1'}
payload = {'serialNumber': 'DEADBEEF0011', payload = {'serialNumber': 'DEADBEEF0011',
@@ -61,6 +65,8 @@ class TestUcentralGatewayService(object):
@pytest.mark.sdk_restapi @pytest.mark.sdk_restapi
def test_gwservice_updatedevice(self, setup_controller): def test_gwservice_updatedevice(self, setup_controller):
""" """
Test the update device endpoint
WIFI-3454
""" """
configuration = {'uuid': '1'} configuration = {'uuid': '1'}
payload = {'serialNumber': 'DEADBEEF0011', payload = {'serialNumber': 'DEADBEEF0011',
@@ -102,3 +108,34 @@ class TestUcentralGatewayService(object):
allure.attach(name="gw get device", body=body) allure.attach(name="gw get device", body=body)
if resp.status_code != 200: if resp.status_code != 200:
assert False assert False
@pytest.mark.sdk_restapi
def test_gwservice_deletedevice(self, setup_controller):
"""
Test the delete device endpoint
WIFI-3455
"""
configuration = {'uuid': '1'}
payload = {'serialNumber': 'DEADBEEF0011',
'UUID': '123456',
'configuration': configuration,
'deviceType': 'AP',
'location': '',
'macAddress': 'DE:AD:BE:EF:00:11',
'manufacturer': 'Testing',
'owner': ''}
resp = setup_controller.request("gw", "device/DEADBEEF0011", "POST", None, json.dumps(payload))
body = resp.url + "," + str(resp.status_code) + ',' + resp.text
allure.attach(name="gw create devices", body=body)
if resp.status_code != 200:
assert False
devices = json.loads(resp.text)
print (devices)
resp = setup_controller.request("gw", "device/DEADBEEF0011", "DELETE", None, None)
body = resp.url + "," + str(resp.status_code) + ',' + resp.text
allure.attach(name="gw get device", body=body)
if resp.status_code != 200:
assert False

View File

@@ -11,7 +11,8 @@ import allure
class TestUcentralSecService(object): class TestUcentralSecService(object):
""" """
pytest -m "uci_login or uci_logout" Test the oauth endpoint
WIFI-3447
""" """
@pytest.mark.sdk_restapi @pytest.mark.sdk_restapi
def test_secservice_oauth(self, setup_controller): def test_secservice_oauth(self, setup_controller):
@@ -26,7 +27,8 @@ class TestUcentralSecService(object):
@pytest.mark.sdk_restapi @pytest.mark.sdk_restapi
def test_secservice_oauth_revoke(self, setup_controller): def test_secservice_oauth_revoke(self, setup_controller):
""" """
pytest -m "uci_logout" Test the oauth revoke endpoint
WIFI-3448
""" """
resp = setup_controller.logout() resp = setup_controller.logout()
body = resp.url + "," + str(resp.status_code) + ',' + resp.text body = resp.url + "," + str(resp.status_code) + ',' + resp.text
@@ -37,8 +39,8 @@ class TestUcentralSecService(object):
@pytest.mark.sdk_restapi @pytest.mark.sdk_restapi
def test_secservice_system_endpoints(self, setup_controller): def test_secservice_system_endpoints(self, setup_controller):
""" """
pytest -m "uci_endpoints" Test the system endpoints to verify list of services present
look for ucentralgw and ucentralfms services for 2.1 release WIFI-3449
""" """
resp = setup_controller.request("sec", "systemEndpoints", "GET", None, None) resp = setup_controller.request("sec", "systemEndpoints", "GET", None, None)
body = resp.url + "," + str(resp.status_code) + ',' + resp.text body = resp.url + "," + str(resp.status_code) + ',' + resp.text
@@ -74,8 +76,8 @@ class TestUcentralSecService(object):
@pytest.mark.sdk_restapi @pytest.mark.sdk_restapi
def test_secservice_get_version(self, setup_controller): def test_secservice_get_version(self, setup_controller):
""" """
pytest -m "uci_endpoints" Test the system endpoint to verify the version of the service
look for ucentralgw and ucentralfms services for 2.1 release WIFI-3450
""" """
params = {'command': 'version'} params = {'command': 'version'}
@@ -97,7 +99,8 @@ class TestUcentralSecService(object):
@pytest.mark.sdk_restapi @pytest.mark.sdk_restapi
def test_secservice_get_uptime(self, setup_controller): def test_secservice_get_uptime(self, setup_controller):
""" """
look for ucentralgw and ucentralfms services for 2.1 release Test the system endpoint to verify the uptime of the service
WIFI-3451
""" """
params = {'command': 'times'} params = {'command': 'times'}