class TransportPCEPortMappingTesting(unittest.TestCase):
- testtools_process1 = None
- testtools_process2 = None
+ honeynode_process1 = None
+ honeynode_process2 = None
odl_process = None
restconf_baseurl = "http://localhost:8181/restconf"
@classmethod
- def __start_testtools(cls):
- executable = ("./netconf/netconf/tools/netconf-testtool/target/"
- "netconf-testtool-1.3.1-executable.jar")
+ def __start_honeynode1(cls):
+ executable = ("./honeynode/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
+ "/honeynode-distribution-1.18.01/honeycomb-tpce")
if os.path.isfile(executable):
- with open('testtools1.log', 'w') as outfile:
- cls.testtools_process1 = subprocess.Popen(
- ["java", "-jar", executable, "--schemas-dir", "schemas",
- "--initial-config-xml", "sample_configs/ord_1.2.1/sample-config-ROADM.xml",
- "--starting-port", "17830"],
+ with open('honeynode1.log', 'w') as outfile:
+ cls.honeynode_process1 = subprocess.Popen(
+ [executable, "17831", "sample_configs/ord_2.1/oper-XPDRA.xml"],
stdout=outfile)
- with open('testtools2.log', 'w') as outfile:
- cls.testtools_process2 = subprocess.Popen(
- ["java", "-jar", executable, "--schemas-dir", "schemas",
- "--initial-config-xml", "sample_configs/ord_1.2.1/sample-config-XPDR.xml",
- "--starting-port", "17831"],
+
+ @classmethod
+ def __start_honeynode2(cls):
+ executable = ("./honeynode/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, "17830", "sample_configs/ord_2.1/oper-ROADMA.xml"],
stdout=outfile)
@classmethod
@classmethod
def setUpClass(cls):
- cls.__start_testtools()
+ cls.__start_honeynode1()
+ time.sleep(20)
+ cls.__start_honeynode2()
+ time.sleep(20)
cls.__start_odl()
time.sleep(60)
@classmethod
def tearDownClass(cls):
- cls.testtools_process1.send_signal(signal.SIGINT)
- cls.testtools_process1.wait()
- cls.testtools_process2.send_signal(signal.SIGINT)
- cls.testtools_process2.wait()
for child in psutil.Process(cls.odl_process.pid).children():
child.send_signal(signal.SIGINT)
child.wait()
cls.odl_process.send_signal(signal.SIGINT)
cls.odl_process.wait()
+ for child in psutil.Process(cls.honeynode_process1.pid).children():
+ child.send_signal(signal.SIGINT)
+ child.wait()
+ cls.honeynode_process1.send_signal(signal.SIGINT)
+ cls.honeynode_process1.wait()
+ for child in psutil.Process(cls.honeynode_process2.pid).children():
+ child.send_signal(signal.SIGINT)
+ child.wait()
+ cls.honeynode_process2.send_signal(signal.SIGINT)
+ cls.honeynode_process2.wait()
def setUp(self):
print ("execution of {}".format(self.id().split(".")[-1]))
# 'connected')
def test_02_restconfAPI(self):
- url = ("{}/config/portmapping:network/nodes/controller-config"
- .format(self.restconf_baseurl))
+ url = ("{}/config/transportpce-portmapping:network/nodes/controller-config".format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
response = requests.request(
"GET", url, headers=headers, auth=('admin', 'admin'))
time.sleep(10)
def test_05_rdm_portmapping_DEG1_TTP_TXRX(self):
- url = ("{}/config/portmapping:network/"
+ url = ("{}/config/transportpce-portmapping:network/"
"nodes/ROADMA/mapping/DEG1-TTP-TXRX"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
res['mapping'])
def test_06_rdm_portmapping_SRG1_PP7_TXRX(self):
- url = ("{}/config/portmapping:network/"
+ url = ("{}/config/transportpce-portmapping:network/"
"nodes/ROADMA/mapping/SRG1-PP7-TXRX"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
res['mapping'])
def test_07_rdm_portmapping_SRG3_PP1_TXRX(self):
- url = ("{}/config/portmapping:network/"
+ url = ("{}/config/transportpce-portmapping:network/"
"nodes/ROADMA/mapping/SRG3-PP1-TXRX"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
time.sleep(10)
def test_10_xpdr_portmapping_NETWORK1(self):
- url = ("{}/config/portmapping:network/"
- "nodes/XPDRA/mapping/XPDR-LINE1"
+ url = ("{}/config/transportpce-portmapping:network/"
+ "nodes/XPDRA/mapping/XPDR1-NETWORK1"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
response = requests.request(
res = response.json()
self.assertIn(
{'supporting-port': '1', 'supporting-circuit-pack-name': '1/0/1-PLUG-NET',
- 'logical-connection-point': 'XPDR-LINE1'},
+ 'logical-connection-point': 'XPDR1-NETWORK1'},
+ res['mapping'])
+
+ def test_11_xpdr_portmapping_NETWORK2(self):
+ url = ("{}/config/transportpce-portmapping:network/"
+ "nodes/XPDRA/mapping/XPDR1-NETWORK2"
+ .format(self.restconf_baseurl))
+ headers = {'content-type': 'application/json'}
+ response = requests.request(
+ "GET", url, headers=headers, auth=('admin', 'admin'))
+ self.assertEqual(response.status_code, requests.codes.ok)
+ res = response.json()
+ self.assertIn(
+ {'supporting-port': '2', 'supporting-circuit-pack-name': '1/0/2-PLUG-NET',
+ 'logical-connection-point': 'XPDR1-NETWORK2'},
+ res['mapping'])
+
+ def test_12_xpdr_portmapping_CLIENT1(self):
+ url = ("{}/config/transportpce-portmapping:network/"
+ "nodes/XPDRA/mapping/XPDR1-CLIENT1"
+ .format(self.restconf_baseurl))
+ headers = {'content-type': 'application/json'}
+ response = requests.request(
+ "GET", url, headers=headers, auth=('admin', 'admin'))
+ self.assertEqual(response.status_code, requests.codes.ok)
+ res = response.json()
+ self.assertIn(
+ {'supporting-port': 'C1',
+ 'supporting-circuit-pack-name': '1/0/C1-PLUG-CLIENT',
+ 'logical-connection-point': 'XPDR1-CLIENT1'},
res['mapping'])
- def test_11_xpdr_portmapping_CLIENT1(self):
- url = ("{}/config/portmapping:network/"
- "nodes/XPDRA/mapping/XPDR-CLNT1"
+ def test_13_xpdr_portmapping_CLIENT2(self):
+ url = ("{}/config/transportpce-portmapping:network/"
+ "nodes/XPDRA/mapping/XPDR1-CLIENT2"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
response = requests.request(
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertIn(
- {'supporting-port': '1',
- 'supporting-circuit-pack-name': '1/0/2-PLUG-CLIENT',
- 'logical-connection-point': 'XPDR-CLNT1'},
+ {'supporting-port': 'C2',
+ 'supporting-circuit-pack-name': '1/0/C2-PLUG-CLIENT',
+ 'logical-connection-point': 'XPDR1-CLIENT2'},
res['mapping'])
- def test_12_xpdr_device_disconnected(self):
+ def test_14_xpdr_portmapping_CLIENT4(self):
+ url = ("{}/config/transportpce-portmapping:network/"
+ "nodes/XPDRA/mapping/XPDR1-CLIENT4"
+ .format(self.restconf_baseurl))
+ headers = {'content-type': 'application/json'}
+ response = requests.request(
+ "GET", url, headers=headers, auth=('admin', 'admin'))
+ self.assertEqual(response.status_code, requests.codes.ok)
+ res = response.json()
+ self.assertIn(
+ {'supporting-port': 'C4',
+ 'supporting-circuit-pack-name': '1/0/C4-PLUG-CLIENT',
+ 'logical-connection-point': 'XPDR1-CLIENT4'},
+ res['mapping'])
+
+ def test_15_xpdr_device_disconnected(self):
url = ("{}/config/network-topology:"
"network-topology/topology/topology-netconf/node/XPDRA"
.format(self.restconf_baseurl))
self.assertEqual(response.status_code, requests.codes.ok)
time.sleep(20)
- def test_13_xpdr_device_disconnected(self):
+ def test_16_xpdr_device_disconnected(self):
url = ("{}/operational/network-topology:network-topology/topology/"
"topology-netconf/node/XPDRA".format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
"error-message":"Request could not be completed because the relevant data model content does not exist "},
res['errors']['error'])
- def test_14_xpdr_device_disconnected(self):
- url = ("{}/config/portmapping:network/"
- "nodes/XPDRA"
- .format(self.restconf_baseurl))
+ def test_17_xpdr_device_disconnected(self):
+ url = ("{}/config/transportpce-portmapping:network/nodes/XPDRA".format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
response = requests.request(
"GET", url, headers=headers, auth=('admin', 'admin'))
"error-message":"Request could not be completed because the relevant data model content does not exist "},
res['errors']['error'])
- def test_15_rdm_device_disconnected(self):
- url = ("{}/config/network-topology:"
- "network-topology/topology/topology-netconf/node/ROADMA"
+ def test_18_rdm_device_disconnected(self):
+ url = ("{}/config/network-topology:network-topology/topology/topology-netconf/node/ROADMA"
.format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
response = requests.request(
self.assertEqual(response.status_code, requests.codes.ok)
time.sleep(20)
- def test_16_rdm_device_disconnected(self):
- url = ("{}/operational/network-topology:network-topology/topology/"
- "topology-netconf/node/ROADMA".format(self.restconf_baseurl))
+ def test_19_rdm_device_disconnected(self):
+ url = ("{}/operational/network-topology:network-topology/topology/topology-netconf/node/ROADMA"
+ .format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
response = requests.request(
"GET", url, headers=headers, auth=('admin', 'admin'))
"error-message":"Request could not be completed because the relevant data model content does not exist "},
res['errors']['error'])
- def test_17_rdm_device_disconnected(self):
- url = ("{}/config/portmapping:network/nodes/ROADMA"
- .format(self.restconf_baseurl))
+ def test_20_rdm_device_disconnected(self):
+ url = ("{}/config/transportpce-portmapping:network/nodes/ROADMA".format(self.restconf_baseurl))
headers = {'content-type': 'application/json'}
response = requests.request(
"GET", url, headers=headers, auth=('admin', 'admin'))