From patchwork Fri Jun 12 16:13:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 29886 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5CGDMJk018704 for ; Fri, 12 Jun 2009 16:13:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755710AbZFLQNP (ORCPT ); Fri, 12 Jun 2009 12:13:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755126AbZFLQNP (ORCPT ); Fri, 12 Jun 2009 12:13:15 -0400 Received: from mx2.redhat.com ([66.187.237.31]:52850 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755216AbZFLQNO (ORCPT ); Fri, 12 Jun 2009 12:13:14 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5CGDGgn006563; Fri, 12 Jun 2009 12:13:16 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n5CGDFGw031842; Fri, 12 Jun 2009 12:13:16 -0400 Received: from localhost.localdomain (vpn-10-74.bos.redhat.com [10.16.10.74]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5CGDAZU002152; Fri, 12 Jun 2009 12:13:14 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues Subject: [KVM-AUTOTEST PATCH 3/4] kvm_tests: Use autotest log files to scan results Date: Fri, 12 Jun 2009 13:13:09 -0300 Message-Id: <1244823190-9299-3-git-send-email-lmr@redhat.com> In-Reply-To: <1244823190-9299-2-git-send-email-lmr@redhat.com> References: <1244823190-9299-1-git-send-email-lmr@redhat.com> <1244823190-9299-2-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The 'autotest' kvm subtest was relying on autotest output, that now has the logging line prefixes. The logging line prefixes breaks the results parser, so we would either have to make the parser to strip the logging prefixes or read autotest status files generated on the results directory. The later is a simpler approach, so this patch implements it. Also, copy control files defined inside self.bindir/autotest_control directory to the guest. This way we can create more complex control files to run in guests without having to touch other tests directories. Signed-off-by: Lucas Meneghel Rodrigues --- client/tests/kvm/kvm_tests.py | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/client/tests/kvm/kvm_tests.py b/client/tests/kvm/kvm_tests.py index 4b87a76..62e5161 100644 --- a/client/tests/kvm/kvm_tests.py +++ b/client/tests/kvm/kvm_tests.py @@ -296,20 +296,30 @@ def run_autotest(test, params, env): if status != 0: raise error.TestFail("Could not extract %s.tar.bz2" % test_name) + # Cleaning up old remaining results + session.sendline("rm -rf autotest/results/*") + # Copying the selected control file (located inside + # test.bindir/autotest_control to the autotest dir + control_file_path = os.path.join(test.bindir, "autotest_control", + test_control_file) + if not vm.scp_to_remote(control_file_path, "autotest/control"): + raise error.TestFail("Could not copy the test control file to guest") # Run the test logging.info("Running test '%s'..." % test_name) - session.sendline("cd autotest/tests/%s" % test_name) - session.sendline("rm -f ./%s.state" % test_control_file) + session.sendline("cd autotest") + session.sendline("rm -f control.state") session.read_up_to_prompt() - session.sendline("../../bin/autotest ./%s" % test_control_file) + session.sendline("bin/autotest control") logging.info("---------------- Test output ----------------") - match, output = session.read_up_to_prompt(timeout=test_timeout, - print_func=logging.info) + match = session.read_up_to_prompt(timeout=test_timeout, + print_func=logging.info)[0] logging.info("---------------- End of test output ----------------") if not match: raise error.TestFail("Timeout elapsed while waiting for test to" " complete") - + # Get the results generated by autotest + session.sendline("cat results/*/status") + output = session.read_up_to_prompt()[1] session.close() # Parse test results