3 Authors: Baohua Yang@IBM, Denghui Huang@IBM
11 from testmodule import TestModule
16 class ForwardingManager(TestModule):
18 Test for the forwarding manager.
19 Start 2-layer tree topology network. e.g., in Mininet, run 'sudo mn --controller=remote,ip=127.0.0.1 --mac --topo tree,2'
22 def __init__(self, restSubContext='/controller/nb/v2/staticroute', user=DEFAULT_USER, password=DEFAULT_PWD,
23 container=DEFAULT_CONTAINER, contentType='json', prefix=DEFAULT_PREFIX):
24 super(self.__class__, self).__init__(restSubContext, user, password, container, contentType, prefix)
28 The name is suggested to match the NB API.
31 return super(self.__class__, self).get_entries('routes')
33 def add_static_route(self, name, body):
37 r = super(self.__class__, self).add_entry('route', name, body)
39 def remove_static_route(self, name):
43 r = super(self.__class__, self).remove_entry('route', name)
45 def test_static_route_operations(self, name, body):
47 Test static route operations, like adding and removeing a route.
48 >>> ForwardingManager().test_static_route_operations('route1',{'name':'route1','prefix':'192.168.1.0/24','nextHop':'10.0.0.2'})
51 return super(self.__class__, self).test_add_remove_operations('routes', 'route', name, body, 'staticRoute')