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 <ak...@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