qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amos Kong <akong@redhat.com>
To: autotest-kernel@redhat.com
Cc: lmr@redhat.com, Amos Kong <akong@redhat.com>,
	qemu-devel@nongnu.org, virt-test-devel@redhat.com
Subject: [Qemu-devel] [Autotest PATCH 2/2] virt run: add three logical case filters
Date: Sun, 30 Dec 2012 09:02:09 +0800	[thread overview]
Message-ID: <1356829329-30082-2-git-send-email-akong@redhat.com> (raw)
In-Reply-To: <1356829329-30082-1-git-send-email-akong@redhat.com>

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 <akong@redhat.com>
---
 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':
-- 
1.7.1

  reply	other threads:[~2012-12-30  1:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-30  1:02 [Qemu-devel] [Autotest PATCH 1/2] virt run: fix typo in help message Amos Kong
2012-12-30  1:02 ` Amos Kong [this message]
2012-12-30  1:10   ` [Qemu-devel] [Autotest PATCH 2/2] virt run: add three logical case filters Amos Kong
2012-12-31 19:55     ` Lucas Meneghel Rodrigues
2013-01-04 13:13       ` Andreas Färber
2013-01-04 14:21         ` [Qemu-devel] [Autotest] " Lucas Meneghel Rodrigues
2013-01-04 15:06         ` [Qemu-devel] " Gerd Hoffmann
2013-01-04 17:35           ` Lucas Meneghel Rodrigues
2013-01-05  8:52       ` [Qemu-devel] [Virt-test-devel] " Qingtang Zhou
2013-01-05 15:29         ` Lucas Meneghel Rodrigues
2012-12-31 19:52 ` [Qemu-devel] [Virt-test-devel] [Autotest PATCH 1/2] virt run: fix typo in help message Lucas Meneghel Rodrigues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1356829329-30082-2-git-send-email-akong@redhat.com \
    --to=akong@redhat.com \
    --cc=autotest-kernel@redhat.com \
    --cc=lmr@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=virt-test-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).