fix deprecated openroadm interfaces/objects
[transportpce.git] / tests / transportpce_tests / 2.2.1 / test_renderer_service_path_nominal.py
index c8211fa3886155f2ccb00bd2c0f648652881c501..c70bf9dd1ce1f9865e46f209338a0aaf3695d469 100644 (file)
@@ -19,6 +19,7 @@ import os
 import psutil
 import shutil
 from unittest.result import failfast
+import test_utils
 
 
 class TransportPCERendererTesting(unittest.TestCase):
@@ -30,42 +31,21 @@ class TransportPCERendererTesting(unittest.TestCase):
 
 #START_IGNORE_XTESTING
 
-    @classmethod
-    def __start_honeynode1(cls):
-        executable = ("./honeynode/2.2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
-                      "/honeynode-distribution-1.18.01/honeycomb-tpce")
-        if os.path.isfile(executable):
-            with open('honeynode1.log', 'w') as outfile:
-                cls.honeynode_process1 = subprocess.Popen(
-                    [executable, "17841", "sample_configs/openroadm/2.2.1/oper-ROADMA.xml"],
-                    stdout=outfile)
-
-    @classmethod
-    def __start_honeynode2(cls):
-        executable = ("./honeynode/2.2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
-                      "/honeynode-distribution-1.18.01/honeycomb-tpce")
-        if os.path.isfile(executable):
-            with open('honeynode2.log', 'w') as outfile:
-                cls.honeynode_process2 = subprocess.Popen(
-                    [executable, "17840", "sample_configs/openroadm/2.2.1/oper-XPDRA.xml"],
-                    stdout=outfile)
-
-    @classmethod
-    def __start_odl(cls):
-        executable = "../karaf/target/assembly/bin/karaf"
-        with open('odl.log', 'w') as outfile:
-            cls.odl_process = subprocess.Popen(
-                ["bash", executable, "server"], stdout=outfile,
-                stdin=open(os.devnull))
-
     @classmethod
     def setUpClass(cls):
-        cls.__start_honeynode1()
+        print ("starting honeynode1...")
+        cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
         time.sleep(20)
-        cls.__start_honeynode2()
+
+        print ("starting honeynode2...")
+        cls.honeynode_process2 = test_utils.start_roadma_honeynode()
         time.sleep(20)
-        cls.__start_odl()
+        print ("all honeynodes started")
+
+        print ("starting opendaylight...")
+        cls.odl_process = test_utils.start_tpce()
         time.sleep(60)
+        print ("opendaylight started")
 
     @classmethod
     def tearDownClass(cls):
@@ -140,11 +120,11 @@ class TransportPCERendererTesting(unittest.TestCase):
         res = response.json()
         self.assertIn(
              {'supporting-port': 'L1', 'supporting-circuit-pack-name': '1/0',
-              'logical-connection-point': 'DEG1-TTP-TXRX'},
+              'logical-connection-point': 'DEG1-TTP-TXRX', 'port-direction': 'bidirectional'},
              res['nodes'][0]['mapping'])
         self.assertIn(
              {'supporting-port': 'C3', 'supporting-circuit-pack-name': '3/0',
-              'logical-connection-point': 'SRG1-PP3-TXRX'},
+              'logical-connection-point': 'SRG1-PP3-TXRX', 'port-direction': 'bidirectional'},
              res['nodes'][0]['mapping'])
 
     def test_04_xpdr_portmapping(self):
@@ -158,12 +138,14 @@ class TransportPCERendererTesting(unittest.TestCase):
         res = response.json()
         self.assertIn(
              {'supporting-port': '1', 'supporting-circuit-pack-name': '1/0/1-PLUG-NET',
-              'logical-connection-point': 'XPDR1-NETWORK1'},
+              'logical-connection-point': 'XPDR1-NETWORK1', 'port-qual': 'xpdr-network',
+              'port-direction': 'bidirectional', 'associated-lcp': 'XPDR1-CLIENT1'},
              res['nodes'][0]['mapping'])
         self.assertIn(
              {'supporting-port': 'C1',
               'supporting-circuit-pack-name': '1/0/1-PLUG-CLIENT',
-              'logical-connection-point': 'XPDR1-CLIENT1'},
+              'logical-connection-point': 'XPDR1-CLIENT1', 'port-direction': 'bidirectional',
+              'associated-lcp': 'XPDR1-NETWORK1', 'port-qual': 'xpdr-client'},
              res['nodes'][0]['mapping'])
 
     def test_05_service_path_create(self):
@@ -203,7 +185,7 @@ class TransportPCERendererTesting(unittest.TestCase):
               'type': 'org-openroadm-interfaces:networkMediaChannelConnectionTerminationPoint',
               'supporting-port': 'L1'}, res['interface'][0])
         self.assertDictEqual(
-             {u'frequency': 191.65, u'width': 40},
+             {u'frequency': 195.8, u'width': 40},
              res['interface'][0]['org-openroadm-network-media-channel-interfaces:nmc-ctp'])
 
     def test_07_service_path_create_rdm_check(self):
@@ -221,7 +203,7 @@ class TransportPCERendererTesting(unittest.TestCase):
               'type': 'org-openroadm-interfaces:mediaChannelTrailTerminationPoint',
               'supporting-port': 'L1'}, res['interface'][0])
         self.assertDictEqual(
-             {u'min-freq': 191.625, u'max-freq': 191.67499999999998},
+             {u'min-freq': 195.775, u'max-freq': 195.825},
              res['interface'][0]['org-openroadm-media-channel-interfaces:mc-ttp'])
 
 
@@ -240,7 +222,7 @@ class TransportPCERendererTesting(unittest.TestCase):
               'type': 'org-openroadm-interfaces:networkMediaChannelConnectionTerminationPoint',
               'supporting-port': 'C3'}, res['interface'][0])
         self.assertDictEqual(
-             {u'frequency': 191.65, u'width': 40},
+             {u'frequency': 195.8, u'width': 40},
              res['interface'][0]['org-openroadm-network-media-channel-interfaces:nmc-ctp'])
 
     # -mc supporting interfaces must not be created for SRG, only degrees
@@ -299,7 +281,7 @@ class TransportPCERendererTesting(unittest.TestCase):
         self.assertDictEqual(
              {u'rate': u'org-openroadm-common-types:R100G',
               u'transmit-power':-5,
-              u'frequency': 191.65},
+              u'frequency': 195.8},
              res['interface'][0]['org-openroadm-optical-channel-interfaces:och'])
 
     def test_12_service_path_create_xpdr_check(self):