From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932287Ab2AEDvX (ORCPT ); Wed, 4 Jan 2012 22:51:23 -0500 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.125]:34876 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757934Ab2AEDsZ (ORCPT ); Wed, 4 Jan 2012 22:48:25 -0500 X-Authority-Analysis: v=2.0 cv=Pb19d1dd c=1 sm=0 a=ZycB6UtQUfgMyuk2+PxD7w==:17 a=UBy9sU4F98IA:10 a=B60UIce8vKIA:10 a=5SG0PmZfjMsA:10 a=bbbx4UPp9XUA:10 a=20KFwNOVAAAA:8 a=meVymXHHAAAA:8 a=EY7yrsVz9WzIrqMmz14A:9 a=h1C6u8u6QLVgUEO3AfsA:7 a=QEXdDO2ut3YA:10 a=jEp0ucaQiEUA:10 a=jeBq3FmKZ4MA:10 a=SyuQLDgLEiboFxdDF1EA:9 a=ZycB6UtQUfgMyuk2+PxD7w==:117 X-Cloudmark-Score: 0 X-Originating-IP: 74.67.80.29 Message-Id: <20120105034823.026754603@goodmis.org> User-Agent: quilt/0.50-1 Date: Wed, 04 Jan 2012 22:48:02 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Linus Torvalds Subject: [PATCH 07/20] ktest: Ask for type of test when creating a new config References: <20120105034755.793909214@goodmis.org> Content-Disposition: inline; filename=0007-ktest-Ask-for-type-of-test-when-creating-a-new-confi.patch Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="00GvhwF7k39YY" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00GvhwF7k39YY Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: Steven Rostedt When no argument is supplied to ktest, or the config applied does not exist and a new config is being created, instead of just using the default test type, give the user an option to pick the test type of either 'build, install, or boot'. Other options may be added later but then those would require more questions as they require more fields. But that's for another release of ktest to add that feature. Signed-off-by: Steven Rostedt --- tools/testing/ktest/ktest.pl | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 2ffb67c..f50b44f 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -752,6 +752,15 @@ sub __read_config { return $test_case; } =20 +sub get_test_case { + print "What test case would you like to run?\n"; + print " (build, install or boot)\n"; + print " Other tests are available but require editing the config file\n"; + my $ans =3D ; + chomp $ans; + $default{"TEST_TYPE"} =3D $ans; +} + sub read_config { my ($config) =3D @_; =20 @@ -766,10 +775,7 @@ sub read_config { # was a test specified? if (!$test_case) { print "No test case specified.\n"; - print "What test case would you like to run?\n"; - my $ans =3D ; - chomp $ans; - $default{"TEST_TYPE"} =3D $ans; + get_test_case; } =20 # set any defaults @@ -3070,6 +3076,7 @@ if ($#ARGV =3D=3D 0) { } =20 if (! -f $ktest_config) { + get_test_case; open(OUT, ">$ktest_config") or die "Can not create $ktest_config"; print OUT << "EOF" # Generated by ktest.pl @@ -3088,6 +3095,7 @@ THIS_DIR :=3D $variable{"PWD"} # Define each test with TEST_START # The config options below it will override the defaults TEST_START +TEST_TYPE =3D $default{"TEST_TYPE"} =20 DEFAULTS EOF --=20 1.7.7.3 --00GvhwF7k39YY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJPBR2HAAoJEIy3vGnGbaoAP7wP/08Gad37y7pFQhcMCqMawp1a IF7BQgaKHLQZqxQUIbjZNB01Tpmgm0hX4ZCxeI5cHTMd4qmrdIKPKVYNtvwPFn5z uatL+KJFI18AKgFEzpaQTazJTXCvEzQB5XKwOoHG3w6laOO6VYTYw9Iuw+c2Or1q Q0krDvxb5Dk5VamphCySAb45Fh2o19BlnaRsL8iF+68br+MKc6QaSy3i9lBa+S1R FX/7gG0ODMiU4tG7UM1vEMP3TfL0VXVQn9ZReLGFNuO3U+2sIldkPRekY7PlPABT Um0pO5aGzX/PvVBudFxWXoYZIAS5wEZjrcd5L9RsrYp3q2ZA3vdMUZQMson5D7xz H7bjSU68WNODWhkBP60qFy61QG3Ffa2iKmSzCjJVywHlc+INtBBR2lFMUBPFHkL9 rVW1KE+4BPqzKEyPo1gfR7DPOeG1ChHt/YKZDtfcwlWVu244OwQnegDIKhSAB28x sIqrCBLohrpjEd4hebK1FxLNNaFGFCQmb79PnuggsgyDnq0rs/W+4UHZ+7WqHLzp juBR+qYqsweJUs8xERMddeNtnKIC5S1hrKOmAXk+rE6HT96b0AEYH+3ZlHXhCZ+u aeA1KQ4dyZY3qCFdb6fzLE9bvE4Xts6pEioaDlWMUhGbALxYPfqPf0fzNMu+m2Ch mW95g1FpaYhFlGq//SK0 =V9MN -----END PGP SIGNATURE----- --00GvhwF7k39YY--