Skip to contentSkip to conversation

KVM test: Unittest subtest: Avoid leak of extra_params

PATCH New Lucas Meneghel Rodrigues 1 participant 1 message Aug 3, 2010 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM test: Unittest subtest: Avoid leak of extra_params

This is the sequel of the previous fix on the unittest
subtest: As we're running on a loop through the unittest list, the original extra_params need to be restored at the end of each test, so previously set extra_params don't leak to other unittests.

---
 client/tests/kvm/tests/unittest.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
client/tests/kvm/tests/unittest.py +5 -0
index ad95720..c52637a 100644
@@ -46,6 +46,8 @@ def run_unittest(test, params, env):
 
     timeout = int(params.get('unittest_timeout', 600))
 
+    extra_params_original = params['extra_params']
+
     for t in test_list:
         logging.info('Running %s', t)
 
@@ -111,5 +113,8 @@ def run_unittest(test, params, env):
             except NameError, IOError:
                logging.error("Not possible to collect logs")
 
+        # Restore the extra params so other tests can run normally
+        params['extra_params'] = extra_params_original
+
     if nfail != 0:
         raise error.TestFail("Unit tests failed: %s" % " ".join(tests_failed))
Signature · 1 line
1.7.1.1