From patchwork Mon Feb 21 14:02:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 577641 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1LE35RY014037 for ; Mon, 21 Feb 2011 14:03:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754625Ab1BUODB (ORCPT ); Mon, 21 Feb 2011 09:03:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20507 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754512Ab1BUODA (ORCPT ); Mon, 21 Feb 2011 09:03:00 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1LE2xS7023355 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 21 Feb 2011 09:02:59 -0500 Received: from freedom.redhat.com (vpn-8-170.rdu.redhat.com [10.11.8.170]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p1LE2vjW024098; Mon, 21 Feb 2011 09:02:57 -0500 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues Subject: [PATCH] KVM test: Move enumerate test dicts code to kvm_utils.run_tests() Date: Mon, 21 Feb 2011 11:02:55 -0300 Message-Id: <1298296975-26640-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 21 Feb 2011 14:03:06 +0000 (UTC) diff --git a/client/tests/kvm/control b/client/tests/kvm/control index be37678..d9ff70c 100644 --- a/client/tests/kvm/control +++ b/client/tests/kvm/control @@ -39,7 +39,7 @@ str = """ parser = kvm_config.Parser() parser.parse_file(os.path.join(kvm_test_dir, "build.cfg")) parser.parse_string(str) -if not kvm_utils.run_tests(parser.get_dicts(), job): +if not kvm_utils.run_tests(parser, job): logging.error("KVM build step failed, exiting.") sys.exit(1) @@ -68,10 +68,7 @@ if args: pass parser.parse_string(str) -logging.info("Selected tests:") -for i, d in enumerate(parser.get_dicts()): - logging.info("Test %4d: %s" % (i + 1, d["shortname"])) -kvm_utils.run_tests(parser.get_dicts(), job) +kvm_utils.run_tests(parser, job) # Generate a nice HTML report inside the job's results dir kvm_utils.create_report(kvm_test_dir, job.resultdir) diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py index 9e25a0a..de52b65 100644 --- a/client/tests/kvm/kvm_utils.py +++ b/client/tests/kvm/kvm_utils.py @@ -1084,20 +1084,23 @@ def get_hash_from_file(hash_path, dvd_basename): return line.split()[0] -def run_tests(test_list, job): +def run_tests(parser, job): """ Runs the sequence of KVM tests based on the list of dictionaries generated by the configuration system, handling dependencies. - @param test_list: List with all dictionary test parameters. + @param parser: Config parser object. @param job: Autotest job object. @return: True, if all tests ran passed, False if any of them failed. """ + for i, d in enumerate(parser.get_dicts()): + logging.info("Test %4d: %s" % (i + 1, d["shortname"])) + status_dict = {} failed = False - for dict in test_list: + for dict in parser.get_dicts(): if dict.get("skip") == "yes": continue dependencies_satisfied = True