From patchwork Sun Dec 30 01:02:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 208689 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 770D52C009A for ; Sun, 30 Dec 2012 12:02:35 +1100 (EST) Received: from localhost ([::1]:35573 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tp7IP-0007oX-4m for incoming@patchwork.ozlabs.org; Sat, 29 Dec 2012 20:02:33 -0500 Received: from eggs.gnu.org ([208.118.235.92]:39377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tp7IH-0007oM-8J for qemu-devel@nongnu.org; Sat, 29 Dec 2012 20:02:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tp7IG-0007R3-0S for qemu-devel@nongnu.org; Sat, 29 Dec 2012 20:02:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tp7IF-0007Qw-Nv for qemu-devel@nongnu.org; Sat, 29 Dec 2012 20:02:23 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qBU12NqT030669 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 29 Dec 2012 20:02:23 -0500 Received: from dhcp-8-167.nay.redhat.com ([10.66.7.126]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qBU12C5Z024953; Sat, 29 Dec 2012 20:02:15 -0500 From: Amos Kong To: autotest-kernel@redhat.com Date: Sun, 30 Dec 2012 09:02:09 +0800 Message-Id: <1356829329-30082-2-git-send-email-akong@redhat.com> In-Reply-To: <1356829329-30082-1-git-send-email-akong@redhat.com> References: <1356829329-30082-1-git-send-email-akong@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: lmr@redhat.com, Amos Kong , qemu-devel@nongnu.org, virt-test-devel@redhat.com Subject: [Qemu-devel] [Autotest PATCH 2/2] virt run: add three logical case filters X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch added there options for filtering cases by logics, For example: ./run -t qemu -c tests.cfg --oronly="WinXP Win7" --andonly="boot 64" --not="sp1" (following cases will be executed) Test 1: virtio_blk.smp2.virtio_net.WinXP.64.boot Test 2: virtio_blk.smp2.virtio_net.Win7.64.boot Current '--tests' option will actually added OR case filter. I would like to reserve '--tests', because it's easy to be understood. eg: --tests="Win7 WinXP": cases of those two guests will be filtered. Signed-off-by: Amos Kong --- run | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/run b/run index aac332a..da02ced 100755 --- a/run +++ b/run @@ -158,6 +158,15 @@ class VirtTestRunParser(optparse.OptionParser): general.add_option("--tests", action="store", dest="tests", help=('List of space separated tests to be executed' ' - example: --tests "boot reboot shutdown"')) + general.add_option("--and", action="store", dest="andstr", + help=('Add AND case filter' + ' - example: --and "RHEL boot"')) + general.add_option("--or", action="store", dest="orstr", + help=('Add OR case filter' + ' - example: --tests "boot shutdown"')) + general.add_option("--not", action="store", dest="nostr", + help=('Add NOT case filter' + ' - example: --not "netperf_win"')) general.add_option("--list-tests", action="store_true", dest="list", help="List tests available") general.add_option("--data-dir", action="store", dest="datadir", @@ -310,6 +319,18 @@ class VirtTestApp(object): tests = self.options.tests.split(" ") self.cartesian_parser.parse_string("only %s" % ", ".join(tests)) + if self.options.type and self.options.andstr: + for i in self.options.andstr.split(" "): + self.cartesian_parser.parse_string("only %s" % i) + + if self.options.type and self.options.orstr: + tests = self.options.orstr.split(" ") + self.cartesian_parser.parse_string("only %s" % ", ".join(tests)) + + if self.options.type and self.options.nostr: + for i in self.options.nostr.split(" "): + self.cartesian_parser.parse_string("no %s" % i) + elif (self.options.type and not self.options.tests and not self.options.config): if self.options.type == 'qemu':