Merge "Added Feature Test Template for Capwap project"
[integration/test.git] / test / tools / CSIT_Test / base / run.py
index 929f7e6d1ed66f625bd681c182920e25d9b53d17..28aab41df124d8293eac25e5946fc37ae3c32a8d 100644 (file)
@@ -5,16 +5,17 @@ Authors: Baohua Yang@IBM, Denghui Huang@IBM
 Updated: 2013-11-07
 
 Usage: Before running the test tool, should
- 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'.
+ 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'.
  2. Configure gateway in the controller web GUI, name = 'gateway', subnet = '10.0.0.254/24'.
  3. In Mininet, run 'h1 ping h2' to make sure the network is connected.
 """
 import doctest
 import os
-from restlib import *
+from restlib import *  # noqa
 
 
-def test_case(module_name):
+def test_module(module_name):
     '''
     Run single test on given module.
     '''
@@ -22,6 +23,7 @@ def test_case(module_name):
     cmd = 'python -m doctest ' + module_name + '.py'
     os.system(cmd)
 
+
 def run(modules=None):
     '''
     Run test cases according to the given modules.
@@ -30,10 +32,10 @@ def run(modules=None):
     '''
     backup_dir = os.getcwd()
     if not modules:
-        modules = [e[:-3] for e in os.listdir(CASES_DIR) if e.endswith('.py')]
-    os.chdir(backup_dir + '/' + CASES_DIR)
+        modules = [e[:-3] for e in os.listdir(MODULES_DIR) if e.endswith('.py')]
+    os.chdir(backup_dir + '/' + MODULES_DIR)
     for name in modules:
-        test_case(name)
+        test_module(name)
     os.chdir(backup_dir)
 
 
@@ -41,6 +43,6 @@ if __name__ == '__main__':
     doctest.testmod()
     test_modules = ['switch_manager', 'topology_manager', 'forwarding_rule_manager', 'statistics_manager',
                     'host_tracker', 'arp_handler', 'forwarding_manager', 'container_manager']
-    #test_modules = ['topology_manager']
+    # test_modules = ['topology_manager']
     run(test_modules)
-    #run()
+    # run()