From patchwork Tue Feb 12 23:34:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 10808905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E56EF13A4 for ; Tue, 12 Feb 2019 23:34:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D51F82BCDD for ; Tue, 12 Feb 2019 23:34:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C97152C201; Tue, 12 Feb 2019 23:34:54 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 693412BED9 for ; Tue, 12 Feb 2019 23:34:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731272AbfBLXex (ORCPT ); Tue, 12 Feb 2019 18:34:53 -0500 Received: from mga04.intel.com ([192.55.52.120]:58481 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730661AbfBLXex (ORCPT ); Tue, 12 Feb 2019 18:34:53 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2019 15:34:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,362,1544515200"; d="scan'208";a="318494776" Received: from sjchrist-coffee.jf.intel.com ([10.54.74.14]) by fmsmga006.fm.intel.com with ESMTP; 12 Feb 2019 15:34:52 -0800 From: Sean Christopherson To: Paolo Bonzini , =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= Cc: kvm@vger.kernel.org Subject: [kvm-unit-tests PATCH 01/15] KVM: Add a "-t" option to run a specific test Date: Tue, 12 Feb 2019 15:34:37 -0800 Message-Id: <20190212233451.27740-2-sean.j.christopherson@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190212233451.27740-1-sean.j.christopherson@intel.com> References: <20190212233451.27740-1-sean.j.christopherson@intel.com> MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP x86's nested-VMX test space is massive, to the point where the group option, "-g", does not provide sufficient granularity, e.g. a user may want to run the core VMX tests but not the VMCS shadow tests, which take an absurdly long time to run due to exhuastively testing all VMCS field values. Note that x86's config is currently a bit of a train wreck as far as VMX is concerned; the "-t" option is of limited value until the config is revamped. Signed-off-by: Sean Christopherson --- run_tests.sh | 6 +++++- scripts/runtime.bash | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index aa2e65f..7d55e74 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -21,6 +21,7 @@ Usage: $0 [-h] [-v] [-a] [-g group] [-j NUM-TASKS] -a: Run all tests, including those flagged as 'nodefault' and those guarded by errata. -g: Only execute tests in the given group + -t: Only execute the given test -j: Execute tests in parallel Set the environment variable QEMU=/path/to/qemu-system-ARCH to @@ -32,7 +33,7 @@ EOF RUNTIME_arch_run="./$TEST_DIR/run" source scripts/runtime.bash -while getopts "ag:hj:v" opt; do +while getopts "ag:t:hj:v" opt; do case $opt in a) run_all_tests="yes" @@ -41,6 +42,9 @@ while getopts "ag:hj:v" opt; do g) only_group=$OPTARG ;; + t) + only_test=$OPTARG + ;; h) usage exit diff --git a/scripts/runtime.bash b/scripts/runtime.bash index 3f5f3e2..c2d0b6b 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -65,9 +65,9 @@ function run() if [ -z "$testname" ]; then return - fi - - if [ -n "$only_group" ] && ! grep -qw "$only_group" <<<$groups; then + elif [ -n "$only_test" ] && [ "$only_test" != "$testname" ]; then + return + elif [ -n "$only_group" ] && ! grep -qw "$only_group" <<<$groups; then return fi