# Mount the different topologies
def test_01_connect_clliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.rawput_request(url, self.topo_cllinet_data)
+ response = test_utils.rawput_request(test_utils.URL_CONFIG_CLLI_NET, self.topo_cllinet_data)
self.assertEqual(response.status_code, requests.codes.ok)
time.sleep(3)
time.sleep(3)
def test_10_disconnect_clliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.delete_request(url)
+ response = test_utils.delete_request(test_utils.URL_CONFIG_CLLI_NET)
self.assertEqual(response.status_code, requests.codes.ok)
time.sleep(3)
self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
def test_02_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertEqual(res['network'][0]['node'][0]['node-id'], 'NodeA')
self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
def test_07_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertEqual(res['network'][0]['node'][0]['node-id'], 'NodeA')
self.assertEqual(response.status_code, requests.codes.created)
def test_16_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
nbNode = len(res['network'][0]['node'])
self.assertEqual(len(listNode), 0)
def test_17_getOpenRoadmNetwork(self):
- url = ("{}/config/ietf-network:networks/network/openroadm-network"
- )
+ url = "{}/config/ietf-network:networks/network/openroadm-network"
response = test_utils.get_request(url)
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertEqual(response.status_code, requests.codes.created)
def test_26_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
nbNode = len(res['network'][0]['node'])
response = test_utils.unmount_device("ROADMB01")
self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
# Delete in the clli-network
- url = "{}/config/ietf-network:networks/network/clli-network/node/NodeB"
- data = {}
- response = test_utils.delete_request(url)
+ response = test_utils.del_node_request("NodeB")
self.assertEqual(response.status_code, requests.codes.ok)
def test_31_disconnect_ROADMC(self):
response = test_utils.unmount_device("ROADMC01")
self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
# Delete in the clli-network
- url = "{}/config/ietf-network:networks/network/clli-network/node/NodeC"
- data = {}
- response = test_utils.delete_request(url)
+ response = test_utils.del_node_request("NodeC")
self.assertEqual(response.status_code, requests.codes.ok)
def test_32_getNodes_OpenRoadmTopology(self):
self.assertNotEqual(res['network'][0]['node'][i]['node-id'], 'ROADMB01')
def test_34_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
nbNode = len(res['network'][0]['node'])
self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
def test_36_getClliNetwork(self):
- url = ("{}/config/ietf-network:networks/network/clli-network"
- )
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
nbNode = len(res['network'][0]['node'])
response = test_utils.unmount_device("ROADMA01")
self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
# Delete in the clli-network
- url = "{}/config/ietf-network:networks/network/clli-network/node/NodeA"
- data = {}
- response = test_utils.delete_request(url)
+ response = test_utils.del_node_request("NodeA")
self.assertEqual(response.status_code, requests.codes.ok)
def test_42_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertNotIn('node', res['network'][0])
'connected')
def test_02_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
logging.info(res)
self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
def test_09_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
nbNode = len(res['network'][0]['node'])
self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
def test_02_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
logging.info(res)
self.assertEqual(response.status_code, requests.codes.created, test_utils.CODE_SHOULD_BE_201)
def test_07_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertEqual(res['network'][0]['node'][0]['node-id'], 'NodeA')
self.assertEqual(response.status_code, requests.codes.created)
def test_16_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
nbNode = len(res['network'][0]['node'])
self.assertEqual(response.status_code, requests.codes.created)
def test_26_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
nbNode = len(res['network'][0]['node'])
# Delete in the topology-netconf
response = test_utils.unmount_device("ROADM-B1")
# Delete in the clli-network
- url = "{}/config/ietf-network:networks/network/clli-network/node/NodeB"
- data = {}
- response = test_utils.delete_request(url)
+ response = test_utils.del_node_request("NodeB")
self.assertEqual(response.status_code, requests.codes.ok)
def test_31_disconnect_ROADMC(self):
response = test_utils.unmount_device("ROADM-C1")
self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
# Delete in the clli-network
- url = "{}/config/ietf-network:networks/network/clli-network/node/NodeC"
- data = {}
- response = test_utils.delete_request(url)
+ response = test_utils.del_node_request("NodeC")
self.assertEqual(response.status_code, requests.codes.ok)
# def test_24_check_roadm2roadm_links_deletion(self):
self.assertNotEqual(res['network'][0]['node'][i]['node-id'], 'ROADM-B1')
def test_34_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
nbNode = len(res['network'][0]['node'])
self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
def test_36_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
nbNode = len(res['network'][0]['node'])
response = test_utils.unmount_device("ROADM-A1")
self.assertEqual(response.status_code, requests.codes.ok, test_utils.CODE_SHOULD_BE_200)
# Delete in the clli-network
- url = "{}/config/ietf-network:networks/network/clli-network/node/NodeA"
- data = {}
- response = test_utils.delete_request(url)
+ response = test_utils.del_node_request("NodeA")
self.assertEqual(response.status_code, requests.codes.ok)
def test_42_getClliNetwork(self):
- url = "{}/config/ietf-network:networks/network/clli-network"
- response = test_utils.get_request(url)
+ response = test_utils.get_clli_net_request()
self.assertEqual(response.status_code, requests.codes.ok)
res = response.json()
self.assertNotIn('node', res['network'][0])
NODES_PWD = "admin"
URL_CONFIG_NETCONF_TOPO = "{}/config/network-topology:network-topology/topology/topology-netconf/"
URL_CONFIG_ORDM_TOPO = "{}/config/ietf-network:networks/network/openroadm-topology/"
+URL_CONFIG_CLLI_NET = "{}/config/ietf-network:networks/network/clli-network/"
TYPE_APPLICATION_JSON = {'Content-Type': 'application/json', 'Accept': 'application/json'}
TYPE_APPLICATION_XML = {'Content-Type': 'application/xml', 'Accept': 'application/xml'}
)
return delete_request(url)
+def get_clli_net_request():
+ return get_request(URL_CONFIG_CLLI_NET)
def del_link_request(link: str):
url = URL_CONFIG_ORDM_TOPO + ("ietf-network-topology:link/" + link)
return delete_request(url)
+def del_node_request(node: str):
+ url = URL_CONFIG_CLLI_NET + ("node/" + node)
+ return delete_request(url)
def shutdown_process(process):
if process is not None: