def test_14_check_interface_ODU2E_NETWORK(self): response = test_utils.check_netconf_node_request( "SPDR-SA1", "interface/XPDR1-NETWORK1-ODU2e-service1") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() input_dict_1 = { 'name': 'XPDR1-NETWORK1-ODU2e-service1', 'administrative-state': 'inService', 'supporting-circuit-pack-name': 'CP1-CFP0', 'supporting-interface': 'XPDR1-NETWORK1-ODU4', 'type': 'org-openroadm-interfaces:otnOdu', 'supporting-port': 'CP1-CFP0-P1' } input_dict_2 = { 'odu-function': 'org-openroadm-otn-common-types:ODU-CTP', 'rate': 'org-openroadm-otn-common-types:ODU2e', 'monitoring-mode': 'monitored' } input_dict_3 = {'trib-port-number': 1} self.assertDictEqual(dict(res['interface'][0], **input_dict_1), res['interface'][0]) self.assertDictEqual( dict(res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'], **input_dict_2), res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']) self.assertDictEqual( dict( res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'] ['parent-odu-allocation'], **input_dict_3), res['interface'][0] ['org-openroadm-otn-odu-interfaces:odu']['parent-odu-allocation']) self.assertIn( 1, res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'] ['parent-odu-allocation']['trib-slots'])
def test_22_service_path_delete_xpdr_check(self): response = test_utils.check_netconf_node_request( "XPDRA01", "circuit-packs/1%2F0%2F1-PLUG-NET") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertEqual('not-reserved-available', res["circuit-packs"][0]['equipment-state'])
def test_13_check_interface_ODU2E_CLIENT(self): response = test_utils.check_netconf_node_request( "SPDR-SA1", "interface/XPDR1-CLIENT4-ODU2e-service1") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() input_dict_1 = { 'name': 'XPDR1-CLIENT4-ODU2e-service1', 'administrative-state': 'inService', 'supporting-circuit-pack-name': 'CP1-SFP4', 'supporting-interface': 'XPDR1-CLIENT4-ETHERNET10G', 'type': 'org-openroadm-interfaces:otnOdu', 'supporting-port': 'CP1-SFP4-P1' } input_dict_2 = { 'odu-function': 'org-openroadm-otn-common-types:ODU-TTP-CTP', 'rate': 'org-openroadm-otn-common-types:ODU2e', 'monitoring-mode': 'terminated' } self.assertDictEqual(dict(res['interface'][0], **input_dict_1), res['interface'][0]) self.assertDictEqual( dict(res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'], **input_dict_2), res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']) self.assertDictEqual( { u'payload-type': u'03', u'exp-payload-type': u'03' }, res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
def test_11_service_path_create_xpdr_check(self): response = test_utils.check_netconf_node_request( "XPDRA01", "interface/XPDR1-NETWORK1-ODU") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the 2 following statements replace self.assertDictContainsSubset deprecated in python 3.2 self.assertDictEqual( dict( { 'name': 'XPDR1-NETWORK1-ODU', 'administrative-state': 'inService', 'supporting-circuit-pack-name': '1/0/1-PLUG-NET', 'type': 'org-openroadm-interfaces:otnOdu', 'supporting-port': '1', 'supporting-interface': 'XPDR1-NETWORK1-OTU' }, **res['interface'][0]), res['interface'][0]) self.assertDictEqual( dict( { 'rate': 'org-openroadm-otn-odu-interfaces:ODU4', u'monitoring-mode': u'terminated' }, **res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']), res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']) self.assertDictEqual( { u'exp-payload-type': u'07', u'payload-type': u'07' }, res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
def test_08_degree_mc_interface(self): response = test_utils.check_netconf_node_request( "ROADM-D1", "interface/DEG1-TTP-TXRX-mc-749:763") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertDictEqual( dict( { "name": "DEG1-TTP-TXRX-mc-749:763", "supporting-interface": "OMS-DEG1-TTP-TXRX", "supporting-circuit-pack-name": "1/0", "circuit-id": "TBD", "description": "TBD", "supporting-port": "L1", "type": "org-openroadm-interfaces:mediaChannelTrailTerminationPoint" }, **res['interface'][0]), res['interface'][0]) # Check the mc-ttp max and min-freq self.assertEqual({ "min-freq": 196.00625, "max-freq": 196.09375 }, res['interface'][0] ['org-openroadm-media-channel-interfaces:mc-ttp']) time.sleep(3)
def test_32_check_no_xc_ROADMA(self): response = test_utils.check_netconf_node_request("ROADMA01", "") res = response.json() self.assertEqual(response.status_code, requests.codes.ok) self.assertNotIn('roadm-connections', dict.keys(res['org-openroadm-device'])) time.sleep(2)
def test_10_srg_nmc_interface(self): response = test_utils.check_netconf_node_request( "ROADM-D1", "interface/SRG1-PP1-TXRX-nmc-749:763") res = response.json() self.assertEqual(response.status_code, requests.codes.ok) self.assertEqual( dict( { "name": "SRG1-PP1-TXRX-nmc-749:763", "supporting-circuit-pack-name": "3/0", "circuit-id": "TBD", "description": "TBD", "supporting-port": "C1", "type": "org-openroadm-interfaces:networkMediaChannelConnectionTerminationPoint" }, **res['interface'][0]), res['interface'][0]) self.assertEqual( { "frequency": 196.05, "width": 80 }, res['interface'][0] ['org-openroadm-network-media-channel-interfaces:nmc-ctp']) time.sleep(3)
def test_12_service_path_create_xpdr_check(self): response = test_utils.check_netconf_node_request( "XPDR-A1", "interface/XPDR1-NETWORK1-OTU") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 self.assertDictEqual( dict( { 'name': 'XPDR1-NETWORK1-OTU', 'administrative-state': 'inService', 'supporting-circuit-pack-name': '1/0/1-PLUG-NET', 'type': 'org-openroadm-interfaces:otnOtu', 'supporting-port': '1', 'supporting-interface': 'XPDR1-NETWORK1-7' }, **res['interface'][0]), res['interface'][0]) input_dict_2 = { 'tx-sapi': 'AMkDwQ7xTmRI', 'expected-dapi': 'AMkDwQ7xTmRI', 'rate': 'org-openroadm-otn-common-types:OTU4', 'fec': 'scfec' } self.assertDictEqual( input_dict_2, res['interface'][0]['org-openroadm-otn-otu-interfaces:otu'])
def test_13_service_path_create_xpdr_check(self): response = test_utils.check_netconf_node_request( "XPDRA01", "circuit-packs/1%2F0%2F1-PLUG-NET") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertIn('not-reserved-inuse', res['circuit-packs'][0]["equipment-state"])
def test_07_check_interface_OTU(self): response = test_utils.check_netconf_node_request( "SPDR-SA1", "interface/XPDR1-NETWORK1-OTU") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() input_dict_1 = { 'name': 'XPDR1-NETWORK1-OTU', 'administrative-state': 'inService', 'supporting-circuit-pack-name': 'CP1-CFP0', 'supporting-interface': 'XPDR1-NETWORK1-761:768', 'type': 'org-openroadm-interfaces:otnOtu', 'supporting-port': 'CP1-CFP0-P1' } input_dict_2 = { 'tx-dapi': 'Swfw02qXGyI=', 'expected-sapi': 'Swfw02qXGyI=', 'tx-sapi': 'Swfw02qXGyI=', 'expected-dapi': 'Swfw02qXGyI=', 'rate': 'org-openroadm-otn-common-types:OTU4', 'fec': 'scfec' } self.assertDictEqual(dict(res['interface'][0], **input_dict_1), res['interface'][0]) self.assertDictEqual( input_dict_2, res['interface'][0]['org-openroadm-otn-otu-interfaces:otu'])
def test_10_check_interface_ODU4(self): response = test_utils.check_netconf_node_request( "SPDR-SA1", "interface/XPDR1-NETWORK1-ODU4") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() input_dict_1 = { 'name': 'XPDR1-NETWORK1-ODU4', 'administrative-state': 'inService', 'supporting-circuit-pack-name': 'CP1-CFP0', 'supporting-interface': 'XPDR1-NETWORK1-OTU', 'type': 'org-openroadm-interfaces:otnOdu', 'supporting-port': 'CP1-CFP0-P1' } input_dict_2 = { 'odu-function': 'org-openroadm-otn-common-types:ODU-TTP', 'rate': 'org-openroadm-otn-common-types:ODU4', 'expected-dapi': 'Swfw02qXGyI=', 'expected-sapi': 'Swfw02qXGyI=', 'tx-dapi': 'Swfw02qXGyI=', 'tx-sapi': 'Swfw02qXGyI=' } self.assertDictEqual(dict(res['interface'][0], **input_dict_1), res['interface'][0]) self.assertDictEqual( dict(res['interface'][0]['org-openroadm-otn-odu-interfaces:odu'], **input_dict_2), res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']) self.assertDictEqual( { u'payload-type': u'21', u'exp-payload-type': u'21' }, res['interface'][0]['org-openroadm-otn-odu-interfaces:odu']['opu'])
def test_16_get_OTS_DEG2_TTP_TXRX_ROADMC(self): response = test_utils.check_netconf_node_request( "ROADMC01", "interface/OTS-DEG2-TTP-TXRX/org-openroadm-optical-transport-interfaces:ots") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertEqual(15.1, res['org-openroadm-optical-transport-interfaces:ots']['span-loss-transmit']) self.assertEqual(5.7, res['org-openroadm-optical-transport-interfaces:ots']['span-loss-receive'])
def test_34_get_interface_XPDRA_XPDR1_NETWORK2(self): response = test_utils.check_netconf_node_request( "XPDRA01", "interface/XPDR1-NETWORK2-753:760/org-openroadm-optical-channel-interfaces:och") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertEqual(-5, res['org-openroadm-optical-channel-interfaces:och']['transmit-power']) self.assertEqual(2, res['org-openroadm-optical-channel-interfaces:och']['wavelength-number'])
def test_11_roadm_connection(self): response = test_utils.check_netconf_node_request( "ROADM-D1", "roadm-connections/SRG1-PP1-TXRX-DEG1-TTP-TXRX-749:763") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertEqual("SRG1-PP1-TXRX-DEG1-TTP-TXRX-749:763", res['roadm-connections'][0]['connection-name']) self.assertEqual("SRG1-PP1-TXRX-nmc-749:763", res['roadm-connections'][0]['source']['src-if']) self.assertEqual("DEG1-TTP-TXRX-nmc-749:763", res['roadm-connections'][0]['destination']['dst-if']) time.sleep(3)
def test_16_service_path_delete_rdm_check(self): response = test_utils.check_netconf_node_request( "ROADMA01", "interface/SRG1-PP7-TXRX-713:720") self.assertEqual(response.status_code, requests.codes.conflict) res = response.json() self.assertIn( { "error-type": "application", "error-tag": "data-missing", "error-message": "Request could not be completed because the relevant data model content does not exist" }, res['errors']['error'])
def test_21_service_path_delete_xpdr_check(self): response = test_utils.check_netconf_node_request( "XPDRA01", "interface/XPDR1-CLIENT1-ETHERNET") self.assertEqual(response.status_code, requests.codes.conflict) res = response.json() self.assertIn( { "error-type": "application", "error-tag": "data-missing", "error-message": "Request could not be completed because the relevant data model content does not exist" }, res['errors']['error'])
def test_17_check_interface_10GE_CLIENT(self): response = test_utils.check_netconf_node_request("SPDR-SC1", "interface/XPDR1-CLIENT1-ETHERNET10G") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() input_dict = {'name': 'XPDR1-CLIENT1-ETHERNET10G', 'administrative-state': 'inService', 'supporting-circuit-pack-name': 'CP1-SFP4', 'type': 'org-openroadm-interfaces:ethernetCsmacd', 'supporting-port': 'CP1-SFP4-P1' } self.assertDictEqual(dict(input_dict, **res['interface'][0]), res['interface'][0]) self.assertDictEqual( {u'speed': 10000}, res['interface'][0]['org-openroadm-ethernet-interfaces:ethernet'])
def test_06_check_interface_och(self): response = test_utils.check_netconf_node_request("SPDR-SC1", "interface/XPDR1-NETWORK1-761:768") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertDictEqual(dict({'name': 'XPDR1-NETWORK1-1', 'administrative-state': 'inService', 'supporting-circuit-pack-name': 'CP1-CFP0', 'type': 'org-openroadm-interfaces:opticalChannel', 'supporting-port': 'CP1-CFP0-P1' }, **res['interface'][0]), res['interface'][0]) self.assertDictEqual( {u'frequency': 196.1, u'rate': u'org-openroadm-common-types:R100G', u'transmit-power': -5, u'modulation-format': 'dp-qpsk'}, res['interface'][0]['org-openroadm-optical-channel-interfaces:och'])
def test_10_service_path_create_rdm_check(self): response = test_utils.check_netconf_node_request( "ROADM-A1", "roadm-connections/SRG1-PP3-TXRX-DEG1-TTP-TXRX-713:720") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 self.assertDictEqual( dict( { 'connection-name': 'SRG1-PP3-TXRX-DEG1-TTP-TXRX-713:720', 'opticalControlMode': 'off' }, **res['roadm-connections'][0]), res['roadm-connections'][0]) self.assertDictEqual({'src-if': 'SRG1-PP3-TXRX-nmc-713:720'}, res['roadm-connections'][0]['source']) self.assertDictEqual({'dst-if': 'DEG1-TTP-TXRX-nmc-713:720'}, res['roadm-connections'][0]['destination'])
def test_24_check_xc2_ROADMA(self): response = test_utils.check_netconf_node_request( "ROADM-A1", "roadm-connections/DEG2-TTP-TXRX-SRG1-PP2-TXRX-753:760") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 self.assertDictEqual( dict( { 'connection-name': 'DEG2-TTP-TXRX-SRG1-PP2-TXRX-753:760', 'opticalControlMode': 'power' }, **res['roadm-connections'][0]), res['roadm-connections'][0]) self.assertDictEqual({'src-if': 'DEG2-TTP-TXRX-nmc-753:760'}, res['roadm-connections'][0]['source']) self.assertDictEqual({'dst-if': 'SRG1-PP2-TXRX-nmc-753:760'}, res['roadm-connections'][0]['destination'])
def test_07_service_path_create_rdm_check(self): response = test_utils.check_netconf_node_request( "ROADMA01", "interface/SRG1-PP7-TXRX-713:720") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 self.assertDictEqual( dict( { 'name': 'SRG1-PP7-TXRX-713:720', 'administrative-state': 'inService', 'supporting-circuit-pack-name': '4/0', 'type': 'org-openroadm-interfaces:opticalChannel', 'supporting-port': 'C7' }, **res['interface'][0]), res['interface'][0]) self.assertDictEqual({ 'wavelength-number': 7 }, res['interface'][0]['org-openroadm-optical-channel-interfaces:och'])
def test_19_check_ODU2E_connection(self): response = test_utils.check_netconf_node_request( "SPDR-SC1", "odu-connection/XPDR1-CLIENT1-ODU2e-SPDRA-SPDRC-10G-x-XPDR1-NETWORK1-ODU2e-SPDRA-SPDRC-10G") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() input_dict_1 = { 'connection-name': 'XPDR1-CLIENT1-ODU2e-SPDRA-SPDRC-10G-x-XPDR1-NETWORK1-ODU2e-SPDRA-SPDRC-10G', 'direction': 'bidirectional' } self.assertDictEqual(dict(input_dict_1, **res['odu-connection'][0]), res['odu-connection'][0]) self.assertDictEqual({u'dst-if': u'XPDR1-NETWORK1-ODU2e-SPDRA-SPDRC-10G'}, res['odu-connection'][0]['destination']) self.assertDictEqual({u'src-if': u'XPDR1-CLIENT1-ODU2e-SPDRA-SPDRC-10G'}, res['odu-connection'][0]['source'])
def test_14_service_path_create_xpdr_check(self): response = test_utils.check_netconf_node_request( "XPDR-A1", "interface/XPDR1-CLIENT1-ETHERNET") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 self.assertDictEqual( dict( { 'name': 'XPDR1-CLIENT1-ETHERNET', 'administrative-state': 'inService', 'supporting-circuit-pack-name': '1/0/1-PLUG-CLIENT', 'type': 'org-openroadm-interfaces:ethernetCsmacd', 'supporting-port': 'C1' }, **res['interface'][0]), res['interface'][0]) self.assertDictEqual({ u'fec': u'off', u'speed': 100000 }, res['interface'][0]['org-openroadm-ethernet-interfaces:ethernet'])
def test_39_check_xc1_ROADMC(self): response = test_utils.check_netconf_node_request( "ROADM-C1", "roadm-connections/SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 self.assertDictEqual( dict( { 'connection-name': 'SRG1-PP1-TXRX-DEG1-TTP-TXRX-761:768', 'opticalControlMode': 'gainLoss', 'target-output-power': -3.0 }, **res['roadm-connections'][0]), res['roadm-connections'][0]) self.assertDictEqual({'src-if': 'SRG1-PP1-TXRX-nmc-761:768'}, res['roadm-connections'][0]['source']) self.assertDictEqual({'dst-if': 'DEG1-TTP-TXRX-nmc-761:768'}, res['roadm-connections'][0]['destination']) time.sleep(7)
def test_10_service_path_create_xpdr_check(self): response = test_utils.check_netconf_node_request( "XPDRA01", "interface/XPDR1-NETWORK1-OTU") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 self.assertDictEqual( dict( { 'name': 'XPDR1-NETWORK1-OTU', 'administrative-state': 'inService', 'supporting-circuit-pack-name': '1/0/1-PLUG-NET', 'type': 'org-openroadm-interfaces:otnOtu', 'supporting-port': '1', 'supporting-interface': 'XPDR1-NETWORK1-713:720' }, **res['interface'][0]), res['interface'][0]) self.assertDictEqual( { u'rate': u'org-openroadm-otn-otu-interfaces:OTU4', u'fec': u'scfec' }, res['interface'][0]['org-openroadm-otn-otu-interfaces:otu'])
def test_07_service_path_create_rdm_check(self): response = test_utils.check_netconf_node_request( "ROADM-A1", "interface/DEG1-TTP-TXRX-mc-713:720") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 self.assertDictEqual( dict( { 'name': 'DEG1-TTP-TXRX-mc-7', 'administrative-state': 'inService', 'supporting-circuit-pack-name': '1/0', 'type': 'org-openroadm-interfaces:mediaChannelTrailTerminationPoint', 'supporting-port': 'L1' }, **res['interface'][0]), res['interface'][0]) self.assertDictEqual({ u'min-freq': 195.775, u'max-freq': 195.825 }, res['interface'][0] ['org-openroadm-media-channel-interfaces:mc-ttp'])
def test_08_service_path_create_rdm_check(self): response = test_utils.check_netconf_node_request( "ROADM-A1", "interface/SRG1-PP3-TXRX-nmc-713:720") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 self.assertDictEqual( dict( { 'name': 'SRG1-PP3-TXRX-nmc-713:720', 'administrative-state': 'inService', 'supporting-circuit-pack-name': '3/0', 'type': 'org-openroadm-interfaces:networkMediaChannelConnectionTerminationPoint', 'supporting-port': 'C3' }, **res['interface'][0]), res['interface'][0]) self.assertDictEqual( { u'frequency': 195.8, u'width': 40 }, res['interface'][0] ['org-openroadm-network-media-channel-interfaces:nmc-ctp'])
def test_09_service_path_create_xpdr_check(self): response = test_utils.check_netconf_node_request( "XPDRA01", "interface/XPDR1-NETWORK1-713:720") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() # the following statement replaces self.assertDictContainsSubset deprecated in python 3.2 self.assertDictEqual( dict( { 'name': 'XPDR1-NETWORK1-713:720', 'administrative-state': 'inService', 'supporting-circuit-pack-name': '1/0/1-PLUG-NET', 'type': 'org-openroadm-interfaces:opticalChannel', 'supporting-port': '1' }, **res['interface'][0]), res['interface'][0]) self.assertDictEqual( { u'rate': u'org-openroadm-optical-channel-interfaces:R100G', u'transmit-power': -5, u'wavelength-number': 7, u'modulation-format': u'dp-qpsk' }, res['interface'][0] ['org-openroadm-optical-channel-interfaces:och'])
def test_25_check_no_interface_OCH(self): response = test_utils.check_netconf_node_request( "SPDR-SA1", "interface/XPDR1-NETWORK1-1") self.assertEqual(response.status_code, requests.codes.conflict)
def test_47_get_no_xc_ROADMA(self): response = test_utils.check_netconf_node_request("ROADMA01", "") self.assertEqual(response.status_code, requests.codes.ok) res = response.json() self.assertNotIn(['roadm-connections'][0], res['org-openroadm-device']) time.sleep(1)