4 Authors: Baohua Yang@IBM, Denghui Huang@IBM
7 Usage: Before running the test tool, should
8 1. Start 2-layer tree topology network. e.g., in Mininet, run 'sudo mn --controller=remote,ip=127.0.0.1 --mac --topo tree,2'.
9 2. Configure gateway in the controller web GUI, name = 'gateway', subnet = '10.0.0.254/24'.
10 3. In Mininet, run 'h1 ping h2' to make sure the network is connected.
17 def test_module(module_name):
19 Run single test on given module.
21 print "#Test case: " + module_name.replace('_', ' ')
22 cmd = 'python -m doctest ' + module_name + '.py'
25 def run(modules=None):
27 Run test cases according to the given modules.
28 If no parameter is given, then will scan the case directory,
29 and try to run all cases.
31 backup_dir = os.getcwd()
33 modules = [e[:-3] for e in os.listdir(MODULES_DIR) if e.endswith('.py')]
34 os.chdir(backup_dir + '/' + MODULES_DIR)
40 if __name__ == '__main__':
42 test_modules = ['switch_manager', 'topology_manager', 'forwarding_rule_manager', 'statistics_manager',
43 'host_tracker', 'arp_handler', 'forwarding_manager', 'container_manager']
44 #test_modules = ['topology_manager']