X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=test%2Ftools%2FRobot_Tool%2Flibraries%2FTopologyManager.py;fp=test%2Ftools%2FRobot_Tool%2Flibraries%2FTopologyManager.py;h=0000000000000000000000000000000000000000;hb=59e81c38620fa1b61e15771191e35771450b9499;hp=a001677b058e22b89b93ff86a87fd97773790646;hpb=072f6e3a8d1bdf8f4c663843589c22d93ba07791;p=integration%2Ftest.git diff --git a/test/tools/Robot_Tool/libraries/TopologyManager.py b/test/tools/Robot_Tool/libraries/TopologyManager.py deleted file mode 100644 index a001677b05..0000000000 --- a/test/tools/Robot_Tool/libraries/TopologyManager.py +++ /dev/null @@ -1,98 +0,0 @@ -""" -CSIT test tools. -Authors: Baohua Yang@IBM, Denghui Huang@IBM -Updated: 2013-11-01 -""" - -import sys - -sys.path.append('..') -from restlib import * # noqa -from testmodule import TestModule - -sys.path.remove('..') - - -class TopologyManager(TestModule): - """ - Test for the topology manager. - Start 2-layer tree topology network. e.g., in Mininet, run - 'sudo mn --controller=remote,ip=127.0.0.1 --mac --topo tree,2' - """ - - def __init__(self, restSubContext='/controller/nb/v2/topology', user=DEFAULT_USER, password=DEFAULT_PWD, - container=DEFAULT_CONTAINER, contentType='json', prefix=DEFAULT_PREFIX): - super(self.__class__, self).__init__(restSubContext, user, password, container, contentType, prefix) - - def get_topology(self): - """ - The name is suggested to match the NB API. - Get the topology - """ - return super(self.__class__, self).get_entries() - - def get_userlinks(self): - """ - The name is suggested to match the NB API. - Show the userlinks. - """ - suffix = 'userLinks' - r = super(self.__class__, self).read(suffix) - if r: - return r - - def add_userlink(self, name, body): - """ - Add a userlink. - """ - suffix = 'userLink' - r = super(self.__class__, self).update(suffix + '/' + name, body) - return r - - def remove_userlink(self, name): - """ - Remove a userlink. - """ - suffix = 'userLink' - r = super(self.__class__, self).delete(suffix + '/' + name) - return r - - def test_get_topology(self): - """ - The name is suggested to match the NB API. - Test the topology - >>> TopologyManager().test_get_topology() - True - """ - result = [] - r = self.get_topology() - if r: - v = [e['edge'] for e in r['edgeProperties']] - result.append({u'tailNodeConnector': {u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:01'}, - u'type': u'OF', u'id': u'2'}, - u'headNodeConnector': {u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:03'}, - u'type': u'OF', u'id': u'3'}} in v) - result.append({u'tailNodeConnector': {u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:03'}, - u'type': u'OF', u'id': u'3'}, - u'headNodeConnector': {u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:01'}, - u'type': u'OF', u'id': u'2'}} in v) - result.append({u'tailNodeConnector': {u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:02'}, - u'type': u'OF', u'id': u'3'}, - u'headNodeConnector': {u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:01'}, - u'type': u'OF', u'id': u'1'}} in v) - result.append({u'tailNodeConnector': {u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:01'}, - u'type': u'OF', u'id': u'1'}, - u'headNodeConnector': {u'node': {u'type': u'OF', u'id': u'00:00:00:00:00:00:00:02'}, - u'type': u'OF', u'id': u'3'}} in v) - print result == [True, True, True, True] - - def test_userlink_operations(self, name, body): - """ - Test userlink operations, like adding and removing. - >>> TopologyManager().test_userlink_operations('link1', - {'status':'Success','name':'link1', - 'srcNodeConnector':'OF|1@OF|00:00:00:00:00:00:00:02', - 'dstNodeConnector':'OF|1@OF|00:00:00:00:00:00:00:03'}) - True - """ - return super(self.__class__, self).test_add_remove_operations('userLinks', 'userLink', name, body, 'userLinks')