From baa146cf6eedc5c2e203c190e915a96520c7c4b5 Mon Sep 17 00:00:00 2001 From: Dan Wendlandt Date: Mon, 15 Aug 2011 18:13:52 -0700 Subject: [PATCH] exit unit tests if tests are invoked specifying a particular test --- quantum/plugins/openvswitch/run_tests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/quantum/plugins/openvswitch/run_tests.py b/quantum/plugins/openvswitch/run_tests.py index 12df8521e..15a7583b4 100644 --- a/quantum/plugins/openvswitch/run_tests.py +++ b/quantum/plugins/openvswitch/run_tests.py @@ -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") -- 2.45.2