make Honeynode and tox scripts BSD compatible
[transportpce.git] / tests / transportpce_tests / 2.2.1 / test_renderer_service_path_nominal.py
index 373b2d87792c5e533f31f5ff0fc432fe3fc12183..c145ff7ca62faf484e27ab6482d9b8ee21049540 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):
@@ -157,15 +137,17 @@ class TransportPCERendererTesting(unittest.TestCase):
         self.assertEqual(response.status_code, requests.codes.ok)
         res = response.json()
         self.assertIn(
-             {'supporting-port': '1', 'supporting-circuit-pack-name': '1/0/1-PLUG-NET',
+             {'supported-interface-capability': ['org-openroadm-port-types:if-OCH'],
+              'supporting-port': '1', 'supporting-circuit-pack-name': '1/0/1-PLUG-NET',
               'logical-connection-point': 'XPDR1-NETWORK1', 'port-qual': 'xpdr-network',
-              'port-direction': 'bidirectional', 'associated-lcp': 'XPDR1-CLIENT1'},
+              'port-direction': 'bidirectional', 'connection-map-lcp': 'XPDR1-CLIENT1'},
              res['nodes'][0]['mapping'])
         self.assertIn(
-             {'supporting-port': 'C1',
+             {'supported-interface-capability': ['org-openroadm-port-types:if-100GE'],
+              'supporting-port': 'C1',
               'supporting-circuit-pack-name': '1/0/1-PLUG-CLIENT',
               'logical-connection-point': 'XPDR1-CLIENT1', 'port-direction': 'bidirectional',
-              'associated-lcp': 'XPDR1-NETWORK1', 'port-qual': 'xpdr-client'},
+              'connection-map-lcp': 'XPDR1-NETWORK1', 'port-qual': 'xpdr-client'},
              res['nodes'][0]['mapping'])
 
     def test_05_service_path_create(self):
@@ -205,7 +187,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):
@@ -223,7 +205,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'])
 
 
@@ -242,7 +224,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
@@ -301,7 +283,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):