import psutil
import requests
+import urllib.parse
# pylint: disable=import-error
import simulators
def sims_update_cp_port(sim: tuple, circuitpack: str, port: str, payload: dict):
# pylint: disable=consider-using-f-string
url = "{}/config/org-openroadm-device:org-openroadm-device/circuit-packs/{}/ports/{}".format(
- SIMS[sim]['restconf_baseurl'], circuitpack, port)
+ SIMS[sim]['restconf_baseurl'],
+ urllib.parse.quote(circuitpack, safe=''),
+ urllib.parse.quote(port, safe=''))
body = {"ports": [payload]}
print(sim)
print(url)
time.sleep(1)
def test_13_change_status_line_port_xpdra(self):
- self.assertTrue(test_utils.sims_update_cp_port(('xpdra', self.NODE_VERSION_121), '1%2F0%2F1-PLUG-NET', '1',
+ self.assertTrue(test_utils.sims_update_cp_port(('xpdra', self.NODE_VERSION_121), '1/0/1-PLUG-NET', '1',
{
"port-name": "1",
"logical-connection-point": "XPDR1-NETWORK1",
time.sleep(1)
def test_17_restore_status_line_port_xpdra(self):
- self.assertTrue(test_utils.sims_update_cp_port(('xpdra', self.NODE_VERSION_121), '1%2F0%2F1-PLUG-NET', '1',
+ self.assertTrue(test_utils.sims_update_cp_port(('xpdra', self.NODE_VERSION_121), '1/0/1-PLUG-NET', '1',
{
"port-name": "1",
"logical-connection-point": "XPDR1-NETWORK1",
self.test_12_get_eth_service1()
def test_21_change_status_port_roadma_srg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3%2F0', 'C1',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3/0', 'C1',
{
"port-name": "C1",
"logical-connection-point": "SRG1-PP1",
time.sleep(1)
def test_24_restore_status_port_roadma_srg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3%2F0', 'C1',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3/0', 'C1',
{
"port-name": "C1",
"logical-connection-point": "SRG1-PP1",
self.test_12_get_eth_service1()
def test_28_change_status_line_port_roadma_deg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '2%2F0', 'L1',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '2/0', 'L1',
{
"port-name": "L1",
"logical-connection-point": "DEG2-TTP-TXRX",
time.sleep(1)
def test_31_restore_status_line_port_roadma_srg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '2%2F0', 'L1',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '2/0', 'L1',
{
"port-name": "L1",
"logical-connection-point": "DEG2-TTP-TXRX",
self.test_12_get_eth_service1()
def test_35_change_status_line_port_xpdrc(self):
- self.assertTrue(test_utils.sims_update_cp_port(('xpdrc', self.NODE_VERSION_71), '1%2F0%2F1-PLUG-NET', '1',
+ self.assertTrue(test_utils.sims_update_cp_port(('xpdrc', self.NODE_VERSION_71), '1/0/1-PLUG-NET', '1',
{
"port-name": "1",
"port-type": "CFP2",
time.sleep(1)
def test_38_restore_status_line_port_xpdrc(self):
- self.assertTrue(test_utils.sims_update_cp_port(('xpdrc', self.NODE_VERSION_71), '1%2F0%2F1-PLUG-NET', '1',
+ self.assertTrue(test_utils.sims_update_cp_port(('xpdrc', self.NODE_VERSION_71), '1/0/1-PLUG-NET', '1',
{
"port-name": "1",
"port-type": "CFP2",
self.test_12_get_eth_service1()
def test_42_change_status_port_roadma_srg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3%2F0', 'C2',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3/0', 'C2',
{
"port-name": "C2",
"logical-connection-point": "SRG1-PP2",
self.test_13_get_connectivity_service_Ethernet()
def test_28_change_status_port_roadma_srg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3%2F0', 'C1',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3/0', 'C1',
{
"port-name": "C1",
"logical-connection-point": "SRG1-PP1",
self.test_20_check_update_connectivity_service_Ethernet()
def test_35_restore_status_port_roadma_srg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3%2F0', 'C1',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3/0', 'C1',
{
"port-name": "C1",
"logical-connection-point": "SRG1-PP1",
self.test_13_get_connectivity_service_Ethernet()
def test_42_change_status_line_port_roadma_deg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '2%2F0', 'L1',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '2/0', 'L1',
{
"port-name": "L1",
"logical-connection-point": "DEG2-TTP-TXRX",
self.test_20_check_update_connectivity_service_Ethernet()
def test_49_restore_status_line_port_roadma_deg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '2%2F0', 'L1',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '2/0', 'L1',
{
"port-name": "L1",
"logical-connection-point": "DEG2-TTP-TXRX",
self.test_13_get_connectivity_service_Ethernet()
def test_56_change_status_port_roadma_srg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3%2F0', 'C2',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3/0', 'C2',
{
"port-name": "C2",
"logical-connection-point": "SRG1-PP2",
self.assertIn(response.status_code, (requests.codes.ok, requests.codes.no_content))
def test_69_restore_status_port_roadma_srg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3%2F0', 'C2',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3/0', 'C2',
{
"port-name": "C2",
"logical-connection-point": "SRG1-PP2",
'The service is now inService')
def test_18_change_status_port_roadma_srg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION), '3%2F0', 'C1',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION), '3/0', 'C1',
{
"port-name": "C1",
"logical-connection-point": "SRG1-PP1",
'The service is now outOfService')
def test_20_restore_status_port_roadma_srg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION), '3%2F0', 'C1',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION), '3/0', 'C1',
{
"port-name": "C1",
"logical-connection-point": "SRG1-PP1",
time.sleep(2)
def test_15_change_status_port_roadma_srg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3%2F0', 'C1',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3/0', 'C1',
{
"port-name": "C1",
"logical-connection-point": "SRG1-PP1",
time.sleep(2)
def test_17_restore_status_port_roadma_srg(self):
- self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3%2F0', 'C1',
+ self.assertTrue(test_utils.sims_update_cp_port(('roadma', self.NODE_VERSION_221), '3/0', 'C1',
{
"port-name": "C1",
"logical-connection-point": "SRG1-PP1",