X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Ftransportpce_tests%2Fwith_docker%2Ftest02_nbinotifications.py;h=2cbf4e2a5efb7743d968b54c0cb30cbb35b957b4;hb=881b140c7b162169e6523705c7f25402ad01e59e;hp=c3ce3d6c195cadcc7bc0333b32c4c8563a08d6ec;hpb=4b6d551d99de440b20ee0850b588ef01a0d65da2;p=transportpce.git diff --git a/tests/transportpce_tests/with_docker/test02_nbinotifications.py b/tests/transportpce_tests/with_docker/test02_nbinotifications.py index c3ce3d6c1..2cbf4e2a5 100644 --- a/tests/transportpce_tests/with_docker/test02_nbinotifications.py +++ b/tests/transportpce_tests/with_docker/test02_nbinotifications.py @@ -12,7 +12,6 @@ # pylint: disable=too-many-public-methods import os -import json # pylint: disable=wrong-import-order import sys import unittest @@ -262,20 +261,15 @@ class TransportNbiNotificationstesting(unittest.TestCase): 'The service is now inService') def test_18_change_status_port_roadma_srg(self): - url = "{}/config/org-openroadm-device:org-openroadm-device/circuit-packs/3%2F0/ports/C1" - body = {"ports": [{ + self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION), '3%2F0', 'C1', + { "port-name": "C1", "logical-connection-point": "SRG1-PP1", "port-type": "client", "circuit-id": "SRG1", "administrative-state": "outOfService", - "port-qual": "roadm-external"}]} - response = requests.request("PUT", url.format("http://127.0.0.1:8141/restconf"), - data=json.dumps(body), headers=test_utils.TYPE_APPLICATION_JSON, - auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD), - timeout=test_utils.REQUEST_TIMEOUT) - self.assertEqual(response.status_code, requests.codes.ok) - time.sleep(2) + "port-qual": "roadm-external" + })) def test_19_get_notifications_alarm_service1(self): response = test_utils.transportpce_api_rpc_request( @@ -288,20 +282,15 @@ class TransportNbiNotificationstesting(unittest.TestCase): 'The service is now outOfService') def test_20_restore_status_port_roadma_srg(self): - url = "{}/config/org-openroadm-device:org-openroadm-device/circuit-packs/3%2F0/ports/C1" - body = {"ports": [{ + self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION), '3%2F0', 'C1', + { "port-name": "C1", "logical-connection-point": "SRG1-PP1", "port-type": "client", "circuit-id": "SRG1", "administrative-state": "inService", - "port-qual": "roadm-external"}]} - response = requests.request("PUT", url.format("http://127.0.0.1:8141/restconf"), - data=json.dumps(body), headers=test_utils.TYPE_APPLICATION_JSON, - auth=(test_utils.ODL_LOGIN, test_utils.ODL_PWD), - timeout=test_utils.REQUEST_TIMEOUT) - self.assertEqual(response.status_code, requests.codes.ok) - time.sleep(2) + "port-qual": "roadm-external" + })) def test_21_get_notifications_alarm_service1(self): self.test_17_get_notifications_alarm_service1()