Skip to content

Commit b091861

Browse files
Steven Rostedtrostedt
authored andcommitted
ktest: Add CONFIG_BISECT_CHECK option
The config-bisect can take a bad config and bisect it down to find out what config actually breaks the config. But as all tests will apply a minconfig (defined by a user) to apply before booting, it is possible that the minconfig could actually make the bad config work (minconfigs can disable configs). The end result is that the config bisect test will not find a config that breaks. This can be rather frustrating to the user. The CONFIG_BISECT_CHECK option, when set to 1, will make sure that the bad config (with the minconfig applied) still fails before trying to bisect. And yes, I did get burned by this. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent e5c2ec1 commit b091861

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎tools/testing/ktest/ktest.pl‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@
173173

174174
my $config_bisect;
175175
my $config_bisect_type;
176+
my $config_bisect_check;
176177

177178
my $patchcheck_type;
178179
my $patchcheck_start;
@@ -283,6 +284,7 @@
283284

284285
"CONFIG_BISECT" => \$config_bisect,
285286
"CONFIG_BISECT_TYPE" => \$config_bisect_type,
287+
"CONFIG_BISECT_CHECK" => \$config_bisect_check,
286288

287289
"PATCHCHECK_TYPE" => \$patchcheck_type,
288290
"PATCHCHECK_START" => \$patchcheck_start,
@@ -2743,6 +2745,18 @@ sub config_bisect {
27432745
}
27442746
}
27452747
my $ret;
2748+
2749+
if (defined($config_bisect_check) && $config_bisect_check) {
2750+
doprint " Checking to make sure bad config with min config fails\n";
2751+
create_config keys %config_list;
2752+
$ret = run_config_bisect_test $config_bisect_type;
2753+
if ($ret) {
2754+
doprint " FAILED! Bad config with min config boots fine\n";
2755+
return -1;
2756+
}
2757+
doprint " Bad config with min config fails as expected\n";
2758+
}
2759+
27462760
do {
27472761
$ret = run_config_bisect;
27482762
} while (!$ret);

‎tools/testing/ktest/sample.conf‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,12 @@
10771077
# can specify it with CONFIG_BISECT_GOOD. Otherwise
10781078
# the MIN_CONFIG is the base.
10791079
#
1080+
# CONFIG_BISECT_CHECK (optional)
1081+
# Set this to 1 if you want to confirm that the config ktest
1082+
# generates (the bad config with the min config) is still bad.
1083+
# It may be that the min config fixes what broke the bad config
1084+
# and the test will not return a result.
1085+
#
10801086
# Example:
10811087
# TEST_START
10821088
# TEST_TYPE = config_bisect

0 commit comments

Comments
 (0)