]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
exit unit tests if tests are invoked specifying a particular test
authorDan Wendlandt <dan@nicira.com>
Tue, 16 Aug 2011 01:13:52 +0000 (18:13 -0700)
committerDan Wendlandt <dan@nicira.com>
Tue, 16 Aug 2011 01:13:52 +0000 (18:13 -0700)
quantum/plugins/openvswitch/run_tests.py

index 12df8521e543147fba546f2f127afa22b4be4c28..15a7583b43f1b96c70a0dea849304edf7db74add 100644 (file)
@@ -61,6 +61,10 @@ from quantum.plugins.openvswitch.tests.test_vlan_map import VlanMapTest
 if __name__ == '__main__':
     exit_status = False
 
+    # if a single test case was specified,
+    # we should only invoked the tests once
+    invoke_once = len(sys.argv) > 1
+
     cwd = os.getcwd()
 
     working_dir = os.path.abspath("tests")
@@ -70,6 +74,9 @@ if __name__ == '__main__':
                       workingDir=working_dir)
     exit_status = run_tests(c)
 
+    if invoke_once:
+        sys.exit(0)
+
     os.chdir(cwd)
 
     working_dir = os.path.abspath("quantum/plugins/openvswitch/tests")