[PATCH] KVM test: Unittest subtest: Avoid leak of extra_params

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@xxxxxxxxxx>
---
 client/tests/kvm/tests/unittest.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/client/tests/kvm/tests/unittest.py b/client/tests/kvm/tests/unittest.py
index ad95720..c52637a 100644
--- a/client/tests/kvm/tests/unittest.py
+++ b/client/tests/kvm/tests/unittest.py
@@ -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))
-- 
1.7.1.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux