From: Lucas Meneghel Rodrigues Subject: [PATCH] KVM test: Unittest subtest: Avoid leak of extra_params Date: Tue, 3 Aug 2010 10:44:23 -0300 Message-ID: <1280843063-3998-1-git-send-email-lmr@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: avi@redhat.com, kvm@vger.kernel.org To: autotest@test.kernel.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autotest-bounces@test.kernel.org Errors-To: autotest-bounces@test.kernel.org List-Id: kvm.vger.kernel.org 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 --- 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