Commit 43de3316 authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt

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: default avatarSteven Rostedt <rostedt@goodmis.org>
parent ccc513b6
...@@ -109,6 +109,7 @@ my $start_minconfig; ...@@ -109,6 +109,7 @@ my $start_minconfig;
my $start_minconfig_defined; my $start_minconfig_defined;
my $output_minconfig; my $output_minconfig;
my $minconfig_type; my $minconfig_type;
my $use_output_minconfig;
my $ignore_config; my $ignore_config;
my $ignore_errors; my $ignore_errors;
my $addconfig; my $addconfig;
...@@ -209,6 +210,7 @@ my %option_map = ( ...@@ -209,6 +210,7 @@ my %option_map = (
"OUTPUT_MIN_CONFIG" => \$output_minconfig, "OUTPUT_MIN_CONFIG" => \$output_minconfig,
"START_MIN_CONFIG" => \$start_minconfig, "START_MIN_CONFIG" => \$start_minconfig,
"MIN_CONFIG_TYPE" => \$minconfig_type, "MIN_CONFIG_TYPE" => \$minconfig_type,
"USE_OUTPUT_MIN_CONFIG" => \$use_output_minconfig,
"IGNORE_CONFIG" => \$ignore_config, "IGNORE_CONFIG" => \$ignore_config,
"TEST" => \$run_test, "TEST" => \$run_test,
"ADD_CONFIG" => \$addconfig, "ADD_CONFIG" => \$addconfig,
...@@ -3146,9 +3148,16 @@ sub make_min_config { ...@@ -3146,9 +3148,16 @@ sub make_min_config {
# that instead. # that instead.
if (-f $output_minconfig && !$start_minconfig_defined) { if (-f $output_minconfig && !$start_minconfig_defined) {
print "$output_minconfig exists\n"; print "$output_minconfig exists\n";
if (!defined($use_output_minconfig)) {
if (read_yn " Use it as minconfig?") { if (read_yn " Use it as minconfig?") {
$start_minconfig = $output_minconfig; $start_minconfig = $output_minconfig;
} }
} elsif ($use_output_minconfig > 0) {
doprint "Using $output_minconfig as MIN_CONFIG\n";
$start_minconfig = $output_minconfig;
} else {
doprint "Set to still use MIN_CONFIG as starting point\n";
}
} }
if (!defined($start_minconfig)) { if (!defined($start_minconfig)) {
......
...@@ -1113,6 +1113,12 @@ ...@@ -1113,6 +1113,12 @@
# config that is generated allows network activity (ssh). # config that is generated allows network activity (ssh).
# (optional) # (optional)
# #
# USE_OUTPUT_MIN_CONFIG set this to 1 if you do not want to be prompted
# about using the OUTPUT_MIN_CONFIG as the MIN_CONFIG as the starting
# point. Set it to 0 if you want to always just use the given MIN_CONFIG.
# If it is not defined, it will prompt you to pick which config
# to start with (MIN_CONFIG or OUTPUT_MIN_CONFIG).
#
# Example: # Example:
# #
# TEST_TYPE = make_min_config # TEST_TYPE = make_min_config
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment