From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [kvm-unit-tests PATCH V4 1/5] scripts/runtime: Add ability to mark test as don't run by default Date: Wed, 17 Aug 2016 17:01:52 +0200 Message-ID: <20160817150152.GB22826@potion> References: <1471416538-14088-1-git-send-email-sjitindarsingh@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: kvm@vger.kernel.org, pbonzini@redhat.com, kvm-ppc@vger.kernel.org, lvivier@redhat.com, thuth@redhat.com, drjones@redhat.com To: Suraj Jitindar Singh Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51364 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752106AbcHQPB4 (ORCPT ); Wed, 17 Aug 2016 11:01:56 -0400 Content-Disposition: inline In-Reply-To: <1471416538-14088-1-git-send-email-sjitindarsingh@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: 2016-08-17 16:48+1000, Suraj Jitindar Singh: > Invoking run_tests.sh without the -g parameter will by default run all of > the tests for a given architecture. This patch series will add a test which > has the ability to bring down the host and thus it might be nice if we > double check that the user actually wants to run that test instead of > them unknowingly bringing down a machine they might not want to. > > In order to do this add the option for a tests' group parameter in > unittests.cfg to include "nodefault" on order to indicate that it shouldn't > be run be default. > > When tests are invoked via run_tests.sh those with the nodefault group > parameter will be skipped unless explicitly specified by the "-g" command > line option. When tests with the nodefault group parameter are built and > run standalone the user will be prompted on invocation to confirm that > they actually want to run the test. > > This allows a developer to mark a test as having potentially adverse > effects and thus requires an extra level of confirmation from the user > before they are invoked. Existing functionality will be preserved and new > tests can choose any group other than "nodefault" if they want to be run > by default. > > Signed-off-by: Suraj Jitindar Singh > --- I have only nits, so Reviewed-by: Radim Krčmář > diff --git a/scripts/runtime.bash b/scripts/runtime.bash > @@ -32,6 +32,25 @@ get_cmdline() > +skip_nodefault() > +{ > + [ "$STANDALONE" != "yes" ] && return 0 > + > + while true; do > + read -p "Test marked not to be run by default, are you sure (Y/N)? " yn "y/N" would help to understand the default with "". > + case $yn in > + "Y" | "y" | "Yes" | "yes") > + return 1 > + ;; > + "" | "N" | "n" | "No" | "no" | "q" | "quit" | "exit") > + return 0 > + ;; > + *) > + ;; The "*) ;;" case doesn't have to be there. > + esac > + done > +} > + From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Date: Wed, 17 Aug 2016 15:01:52 +0000 Subject: Re: [kvm-unit-tests PATCH V4 1/5] scripts/runtime: Add ability to mark test as don't run by default Message-Id: <20160817150152.GB22826@potion> List-Id: References: <1471416538-14088-1-git-send-email-sjitindarsingh@gmail.com> In-Reply-To: <1471416538-14088-1-git-send-email-sjitindarsingh@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Suraj Jitindar Singh Cc: kvm@vger.kernel.org, pbonzini@redhat.com, kvm-ppc@vger.kernel.org, lvivier@redhat.com, thuth@redhat.com, drjones@redhat.com 2016-08-17 16:48+1000, Suraj Jitindar Singh: > Invoking run_tests.sh without the -g parameter will by default run all of > the tests for a given architecture. This patch series will add a test which > has the ability to bring down the host and thus it might be nice if we > double check that the user actually wants to run that test instead of > them unknowingly bringing down a machine they might not want to. > > In order to do this add the option for a tests' group parameter in > unittests.cfg to include "nodefault" on order to indicate that it shouldn't > be run be default. > > When tests are invoked via run_tests.sh those with the nodefault group > parameter will be skipped unless explicitly specified by the "-g" command > line option. When tests with the nodefault group parameter are built and > run standalone the user will be prompted on invocation to confirm that > they actually want to run the test. > > This allows a developer to mark a test as having potentially adverse > effects and thus requires an extra level of confirmation from the user > before they are invoked. Existing functionality will be preserved and new > tests can choose any group other than "nodefault" if they want to be run > by default. > > Signed-off-by: Suraj Jitindar Singh > --- I have only nits, so Reviewed-by: Radim Krčmář > diff --git a/scripts/runtime.bash b/scripts/runtime.bash > @@ -32,6 +32,25 @@ get_cmdline() > +skip_nodefault() > +{ > + [ "$STANDALONE" != "yes" ] && return 0 > + > + while true; do > + read -p "Test marked not to be run by default, are you sure (Y/N)? " yn "y/N" would help to understand the default with "". > + case $yn in > + "Y" | "y" | "Yes" | "yes") > + return 1 > + ;; > + "" | "N" | "n" | "No" | "no" | "q" | "quit" | "exit") > + return 0 > + ;; > + *) > + ;; The "*) ;;" case doesn't have to be there. > + esac > + done > +} > +