From patchwork Thu Aug 4 01:58:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Jitindar Singh X-Patchwork-Id: 9262513 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5D2F860754 for ; Thu, 4 Aug 2016 02:10:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FA5827E71 for ; Thu, 4 Aug 2016 02:10:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31BB527FA1; Thu, 4 Aug 2016 02:10:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFA0727E71 for ; Thu, 4 Aug 2016 02:10:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754800AbcHDCK1 (ORCPT ); Wed, 3 Aug 2016 22:10:27 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:34004 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754272AbcHDCKO (ORCPT ); Wed, 3 Aug 2016 22:10:14 -0400 Received: by mail-pa0-f68.google.com with SMTP id hh10so15284615pac.1 for ; Wed, 03 Aug 2016 19:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=SqzXo4bRC0MGHQN2cfTHOxbB+/TstpRpUfld4krFOKE=; b=sFHQhXLZasiEvuSW1bLA1Ty7+sTIWlV7Yda7Fd20NFiMrrdjm8JYIvfsEH6QJREc57 3KtbB52wu5zjqhAwaHtuIuB7TKLd1cLm7zvJgMVwpQWZUVIKVvxWekY2o32l5c/IeoHT eL7PpjdIbHD9NE5jhSRZedGt8E1OeNsII8WnZdEhYTUtktRMyMBGrfMlrfShLu7tD+MH A5QbaT4H3T3fR9hkfZsbVY5HVGlQadKOtuY0I69tKZPeVITt8lQMhZFfhtwf3NOWehPP pH/zSKYKNumNN3hXyTE45FaF954+2/tUR0FVZwT9PIFfRv4mj5+BKloT6zGOoQuaHdVR 2zbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SqzXo4bRC0MGHQN2cfTHOxbB+/TstpRpUfld4krFOKE=; b=MNfByawBOg2Kw1yy1DqhVuciI2mHOVKPjbaxRjEgZZmKOWZFtms2TnSMihdZq3l9DC aP/lQhiZq1+rogKTugyQV3dvBDZUprxnIP5SZneCf8Q20e6Uk4B5eMHlbB/cIfUA91dE rpo3KdysZLJmedwbA0FjfHBvu3P2rs/dyIxpPuzfI8tNJpsAxGK8kuNUEJR36Tfs/k57 XFYZQB9O0PYvzRiPR/wiHEomzL60SFB/hxX2+U9guGVzqniFzHCnVtLGXiMleqvuJkrv d+M9sEtp1DR7pgh5n9m3G7gNpqP58sQECiZdLwLnVxA/5m1OnJKjCtY78IiSIKqNCV/u pIDg== X-Gm-Message-State: AEkoousxrt5OOd2RAnVnHqeT7n4o+PI2nN51z+I61K9QKi9FlASUqMEqm769UwyXpGn2ZA== X-Received: by 10.66.74.103 with SMTP id s7mr120011711pav.1.1470275929902; Wed, 03 Aug 2016 18:58:49 -0700 (PDT) Received: from dyn253.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id r21sm15458158pfi.52.2016.08.03.18.58.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Aug 2016 18:58:49 -0700 (PDT) From: Suraj Jitindar Singh To: kvm@vger.kernel.org Cc: sjitindarsingh@gmail.com, pbonzini@redhat.com, rkrcmar@redhat.com, drjones@redhat.com Subject: [kvm-unit-tests RFC] Add ability to specify groups which won't be run by default Date: Thu, 4 Aug 2016 11:58:27 +1000 Message-Id: <1470275907-14780-1-git-send-email-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.5.5 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, I'm looking at adding a powerpc test to kvm-unit-tests which has a high potential of bringing down the host. Thus I would like to be able to specify that it not be run by default when all tests are being run, that is the user has to specifically run that test on its own to ensure that they are sure that they want to run it. The way I was thinking of doing this is by having some prefix for the groups parameter in the unittests.cfg file, for example an underscore, which specifies that this test group not be run when no groups parameter is passed to run_tests.sh (i.e. all tests are being run). That is the user will have to specifically specify that individual test group at invocation to have it run. Would you be open to having me add this to the generic test infrastructure? I am open to comments or any other way you would prefer this be done. This just seemed like the easiest option to me. Example of patch below using underscore prefix as condition. --- scripts/runtime.bash | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/runtime.bash b/scripts/runtime.bash index 0503cf0..fbd415c 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -52,6 +52,12 @@ function run() return fi + if grep -q "^_" <<<$groups && ( [ -z "$only_group" ] || ( [ -n \ + "$only_group" ] && ! grep -qw "$only_group" \ + <<<$groups) ); then + return; + fi + if [ -n "$arch" ] && [ "$arch" != "$ARCH" ]; then echo "`SKIP` $1 ($arch only)" return 2