import psutil
import shutil
from unittest.result import failfast
+import test_utils
class TransportPCERendererTesting(unittest.TestCase):
#START_IGNORE_XTESTING
@classmethod
- def __start_honeynode1(cls):
- executable = ("./honeynode/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, "17830", "sample_configs/openroadm/2.1/oper-ROADMA.xml"],
- stdout=outfile)
-
- @classmethod
- def __start_honeynode2(cls):
- executable = ("./honeynode/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, "17831", "sample_configs/openroadm/2.1/oper-XPDRA.xml"],
- stdout=outfile)
+ def setUpClass(cls):
+ print ("starting honeynode1...")
+ cls.honeynode_process1 = test_utils.start_xpdra_honeynode()
+ time.sleep(20)
- @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))
+ print ("starting honeynode2...")
+ cls.honeynode_process2 = test_utils.start_roadma_honeynode()
+ time.sleep(20)
- @classmethod
- def setUpClass(cls):
- cls.__start_honeynode1()
- time.sleep(40)
- cls.__start_honeynode2()
- time.sleep(40)
- cls.__start_odl()
+ print ("starting opendaylight...")
+ cls.odl_process = test_utils.start_tpce()
time.sleep(60)
+ print ("opendaylight started")
@classmethod
def tearDownClass(cls):
"netconf-node-topology:username": "admin",
"netconf-node-topology:password": "admin",
"netconf-node-topology:host": "127.0.0.1",
- "netconf-node-topology:port": "17830",
+ "netconf-node-topology:port": "17831",
"netconf-node-topology:tcp-only": "false",
"netconf-node-topology:pass-through": {}}]}
headers = {'content-type': 'application/json'}
"netconf-node-topology:username": "admin",
"netconf-node-topology:password": "admin",
"netconf-node-topology:host": "127.0.0.1",
- "netconf-node-topology:port": "17831",
+ "netconf-node-topology:port": "17830",
"netconf-node-topology:tcp-only": "false",
"netconf-node-topology:pass-through": {}}]}
headers = {'content-type': 'application/json'}
res = response.json()
self.assertIn(
{'supporting-port': 'L1', 'supporting-circuit-pack-name': '2/0',
- 'logical-connection-point': 'DEG1-TTP-TXRX'},
+ 'logical-connection-point': 'DEG1-TTP-TXRX', 'port-direction': 'bidirectional'},
res['nodes'][0]['mapping'])
self.assertIn(
{'supporting-port': 'C7', 'supporting-circuit-pack-name': '4/0',
- 'logical-connection-point': 'SRG1-PP7-TXRX'},
+ 'logical-connection-point': 'SRG1-PP7-TXRX', 'port-direction': 'bidirectional'},
res['nodes'][0]['mapping'])
def test_04_xpdr_portmapping(self):
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-direction': 'bidirectional',
+ 'associated-lcp': 'XPDR1-CLIENT1', 'port-qual': 'xpdr-network'},
res['nodes'][0]['mapping'])
self.assertIn(
{'supporting-port': 'C1',
'supporting-circuit-pack-name': '1/0/C1-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):