aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/ktest
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-05-21 23:35:12 -0400
committerSteven Rostedt <rostedt@goodmis.org>2012-05-22 00:07:34 -0400
commit43de3316e97c5a9ac4446aa33a893c15cea512b7 (patch)
treeac1b6df1655ab245cb013867becd682d6caa1eab /tools/testing/ktest
parentccc513b688e1f409c03cfaa7117cda778331f6fb (diff)
ktest: Add USE_OUTPUT_MIN_CONFIG to avoid prompt on make_min_config
If the file that OUTPUT_MIN_CONFIG exists then ktest.pl will prompt the user and ask them if the OUTPUT_MIN_CONFIG should be used as the starting point for make_min_config instead of MIN_CONFIG. This is usually the case, and to allow the user to do so, which is helpful if the user is creating different min configs based on tests, and they know one is a superset of another test, they can set USE_OUTPUT_MIN_CONFIG to one, which will prevent kest.pl from prompting to use the OUTPUT_MIN_CONFIG and it will just use it. If USE_OUTPUT_MIN_CONIFG is set to zero, then ktest.pl will continue to use MIN_CONFIG instead. The default is that USE_OUTPUT_MIN_CONFIG is undefined. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/ktest')
-rwxr-xr-xtools/testing/ktest/ktest.pl11
-rw-r--r--tools/testing/ktest/sample.conf6
2 files changed, 16 insertions, 1 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index b6de81927cc3..292b13ad03f5 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -109,6 +109,7 @@ my $start_minconfig;
109my $start_minconfig_defined; 109my $start_minconfig_defined;
110my $output_minconfig; 110my $output_minconfig;
111my $minconfig_type; 111my $minconfig_type;
112my $use_output_minconfig;
112my $ignore_config; 113my $ignore_config;
113my $ignore_errors; 114my $ignore_errors;
114my $addconfig; 115my $addconfig;
@@ -209,6 +210,7 @@ my %option_map = (
209 "OUTPUT_MIN_CONFIG" => \$output_minconfig, 210 "OUTPUT_MIN_CONFIG" => \$output_minconfig,
210 "START_MIN_CONFIG" => \$start_minconfig, 211 "START_MIN_CONFIG" => \$start_minconfig,
211 "MIN_CONFIG_TYPE" => \$minconfig_type, 212 "MIN_CONFIG_TYPE" => \$minconfig_type,
213 "USE_OUTPUT_MIN_CONFIG" => \$use_output_minconfig,
212 "IGNORE_CONFIG" => \$ignore_config, 214 "IGNORE_CONFIG" => \$ignore_config,
213 "TEST" => \$run_test, 215 "TEST" => \$run_test,
214 "ADD_CONFIG" => \$addconfig, 216 "ADD_CONFIG" => \$addconfig,
@@ -3146,8 +3148,15 @@ sub make_min_config {
3146 # that instead. 3148 # that instead.
3147 if (-f $output_minconfig && !$start_minconfig_defined) { 3149 if (-f $output_minconfig && !$start_minconfig_defined) {
3148 print "$output_minconfig exists\n"; 3150 print "$output_minconfig exists\n";
3149 if (read_yn " Use it as minconfig?") { 3151 if (!defined($use_output_minconfig)) {
3152 if (read_yn " Use it as minconfig?") {
3153 $start_minconfig = $output_minconfig;
3154 }
3155 } elsif ($use_output_minconfig > 0) {
3156 doprint "Using $output_minconfig as MIN_CONFIG\n";
3150 $start_minconfig = $output_minconfig; 3157 $start_minconfig = $output_minconfig;
3158 } else {
3159 doprint "Set to still use MIN_CONFIG as starting point\n";
3151 } 3160 }
3152 } 3161 }
3153 3162
diff --git a/tools/testing/ktest/sample.conf b/tools/testing/ktest/sample.conf
index 1c1b7dc13430..0e8191b6c5e3 100644
--- a/tools/testing/ktest/sample.conf
+++ b/tools/testing/ktest/sample.conf
@@ -1113,6 +1113,12 @@
1113# config that is generated allows network activity (ssh). 1113# config that is generated allows network activity (ssh).
1114# (optional) 1114# (optional)
1115# 1115#
1116# USE_OUTPUT_MIN_CONFIG set this to 1 if you do not want to be prompted
1117# about using the OUTPUT_MIN_CONFIG as the MIN_CONFIG as the starting
1118# point. Set it to 0 if you want to always just use the given MIN_CONFIG.
1119# If it is not defined, it will prompt you to pick which config
1120# to start with (MIN_CONFIG or OUTPUT_MIN_CONFIG).
1121#
1116# Example: 1122# Example:
1117# 1123#
1118# TEST_TYPE = make_min_config 1124# TEST_TYPE = make_min_config