summaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-11-23 13:41:18 -0500
committerSteven Rostedt <rostedt@goodmis.org>2011-12-22 21:59:13 -0500
commitc4261d0f62ccbb42184d13b43807b36b100e8fb5 (patch)
tree6145b4628ce7093982a0027767989d6e92488d7a /tools/testing
parentdad98754924735d4dfcbd49b68c00957e999c0ef (diff)
downloadlinux-c4261d0f62ccbb42184d13b43807b36b100e8fb5.tar.bz2
ktest: Ask for type of test when creating a new config
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 <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing')
-rwxr-xr-xtools/testing/ktest/ktest.pl16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 2ffb67c3c49d..f50b44fa8a03 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -752,6 +752,15 @@ sub __read_config {
return $test_case;
}
+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 = <STDIN>;
+ chomp $ans;
+ $default{"TEST_TYPE"} = $ans;
+}
+
sub read_config {
my ($config) = @_;
@@ -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 = <STDIN>;
- chomp $ans;
- $default{"TEST_TYPE"} = $ans;
+ get_test_case;
}
# set any defaults
@@ -3070,6 +3076,7 @@ if ($#ARGV == 0) {
}
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 := $variable{"PWD"}
# Define each test with TEST_START
# The config options below it will override the defaults
TEST_START
+TEST_TYPE = $default{"TEST_TYPE"}
DEFAULTS
EOF