Skip to content

Commit 250bae8

Browse files
Steven Rostedtrostedt
authored andcommitted
ktest: Fix bug when ADD_CONFIG is set but MIN_CONFIG is not
The MIN_CONFIG is a single config that is considered to have all the configs that are required to boot the box. ADD_CONFIG is a list of configs that we add that may contain configs known to be broken (set off) or just configs that we want every box to have and this can include shared configs. If a config has no MIN_CONFIG defined, but has multiple files defined for the ADD_CONFIG, the test will die, because the MIN_CONFIG will default to ADD_CONFIG. The problem is the code to open MIN_CONFIG expects a string of one file, not multiple, and the open will fail. Since the real minconfig that is used is a concatination of MIN_CONFIG and ADD_CONFIG files, we change the code to open that instead of whatever MIN_CONFIG defaults to. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent 43d1b65 commit 250bae8

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

‎tools/testing/ktest/ktest.pl‎

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,12 +1970,6 @@ sub config_bisect {
19701970
unlink $tmpconfig;
19711971
}
19721972

1973-
# Add other configs
1974-
if (defined($addconfig)) {
1975-
run_command "cat $addconfig >> $tmpconfig" or
1976-
dodie "failed to append $addconfig";
1977-
}
1978-
19791973
if (-f $tmpconfig) {
19801974
load_force_config($tmpconfig);
19811975
process_config_ignore $tmpconfig;
@@ -1997,7 +1991,7 @@ sub config_bisect {
19971991
}
19981992
close(IN);
19991993

2000-
# Now run oldconfig with the minconfig (and addconfigs)
1994+
# Now run oldconfig with the minconfig
20011995
make_oldconfig;
20021996

20031997
# check to see what we lost (or gained)
@@ -2901,11 +2895,12 @@ sub set_test_option {
29012895
unlink $dmesg;
29022896
unlink $buildlog;
29032897

2904-
if (!defined($minconfig)) {
2905-
$minconfig = $addconfig;
2906-
2907-
} elsif (defined($addconfig)) {
2908-
run_command "cat $addconfig $minconfig > $tmpdir/add_config" or
2898+
if (defined($addconfig)) {
2899+
my $min = $minconfig;
2900+
if (!defined($minconfig)) {
2901+
$min = "";
2902+
}
2903+
run_command "cat $addconfig $min > $tmpdir/add_config" or
29092904
dodie "Failed to create temp config";
29102905
$minconfig = "$tmpdir/add_config";
29112906
}

0 commit comments

Comments
 (0)