From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 4/9] ktest: Add manual bisect
Date: Tue, 08 Mar 2011 10:22:02 -0500 [thread overview]
Message-ID: <20110308152528.275834988@goodmis.org> (raw)
In-Reply-To: 20110308152158.799699072@goodmis.org
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0004-ktest-Add-manual-bisect.patch --]
[-- Type: text/plain, Size: 4482 bytes --]
From: Steven Rostedt <srostedt@redhat.com>
For both git bisect and config bisect, if BISECT_MANUAL is set to 1,
then bisect will stop between iterations and ask the user for the
result. The actual result is ignored. This makes it possible to
use ktest.pl for bisecting configs and git and let the user examine
the results themselves and enter their own results.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
tools/testing/ktest/ktest.pl | 33 +++++++++++++++++++++++++++++++--
tools/testing/ktest/sample.conf | 16 ++++++++++++++++
2 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index c95209b..e55bd52 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -37,6 +37,7 @@ $default{"POWEROFF_ON_SUCCESS"} = 0;
$default{"BUILD_OPTIONS"} = "";
$default{"BISECT_SLEEP_TIME"} = 60; # sleep time between bisects
$default{"CLEAR_LOG"} = 0;
+$default{"BISECT_MANUAL"} = 0;
$default{"SUCCESS_LINE"} = "login:";
$default{"BOOTED_TIMEOUT"} = 1;
$default{"DIE_ON_FAILURE"} = 1;
@@ -81,6 +82,7 @@ my $addconfig;
my $in_bisect = 0;
my $bisect_bad = "";
my $reverse_bisect;
+my $bisect_manual;
my $in_patchcheck = 0;
my $run_test;
my $redirect;
@@ -1046,6 +1048,21 @@ sub get_version {
doprint "$version\n";
}
+sub answer_bisect {
+ for (;;) {
+ doprint "Pass or fail? [p/f]";
+ my $ans = <STDIN>;
+ chomp $ans;
+ if ($ans eq "p" || $ans eq "P") {
+ return 1;
+ } elsif ($ans eq "f" || $ans eq "F") {
+ return 0;
+ } else {
+ print "Please answer 'P' or 'F'\n";
+ }
+ }
+}
+
sub child_run_test {
my $failed = 0;
@@ -1214,6 +1231,9 @@ sub run_bisect {
my $ret = run_bisect_test $type, $buildtype;
+ if ($bisect_manual) {
+ $ret = answer_bisect;
+ }
# Are we looking for where it worked, not failed?
if ($reverse_bisect) {
@@ -1524,7 +1544,9 @@ sub run_config_bisect {
}
$ret = run_config_bisect_test $type;
-
+ if ($bisect_manual) {
+ $ret = answer_bisect;
+ }
if ($ret) {
process_passed %current_config;
return 0;
@@ -1555,7 +1577,13 @@ sub run_config_bisect {
$half = int($#start_list / 2);
} while ($half > 0);
- # we found a single config, try it again
+ # we found a single config, try it again unless we are running manually
+
+ if ($bisect_manual) {
+ process_failed $start_list[0];
+ return 1;
+ }
+
my @tophalf = @start_list[0 .. 0];
$ret = run_config_bisect_test $type;
@@ -1925,6 +1953,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
$poweroff_after_halt = set_test_option("POWEROFF_AFTER_HALT", $i);
$sleep_time = set_test_option("SLEEP_TIME", $i);
$bisect_sleep_time = set_test_option("BISECT_SLEEP_TIME", $i);
+ $bisect_manual = set_test_option("BISECT_MANUAL", $i);
$store_failures = set_test_option("STORE_FAILURES", $i);
$timeout = set_test_option("TIMEOUT", $i);
$booted_timeout = set_test_option("BOOTED_TIMEOUT", $i);
diff --git a/tools/testing/ktest/sample.conf b/tools/testing/ktest/sample.conf
index 3408c59..af82ac2 100644
--- a/tools/testing/ktest/sample.conf
+++ b/tools/testing/ktest/sample.conf
@@ -528,6 +528,15 @@
# With BISECT_REVERSE = 1, The test will consider failures as
# good, and success as bad.
#
+# BISECT_MANUAL = 1 (optional, default 0)
+#
+# In case there's a problem with automating the bisect for
+# whatever reason. (Can't reboot, want to inspect each iteration)
+# Doing a BISECT_MANUAL will have the test wait for you to
+# tell it if the test passed or failed after each iteration.
+# This is basicall the same as running git bisect yourself
+# but ktest will rebuild and install the kernel for you.
+#
# BISECT_CHECK = 1 (optional, default 0)
#
# Just to be sure the good is good and bad is bad, setting
@@ -613,10 +622,17 @@
#
# CONFIG_BISECT is the config that failed to boot
#
+# If BISECT_MANUAL is set, it will pause between iterations.
+# This is useful to use just ktest.pl just for the config bisect.
+# If you set it to build, it will run the bisect and you can
+# control what happens in between iterations. It will ask you if
+# the test succeeded or not and continue the config bisect.
+#
# Example:
# TEST_START
# TEST_TYPE = config_bisect
# CONFIG_BISECT_TYPE = build
# CONFIG_BISECT = /home/test/¢onfig-bad
# MIN_CONFIG = /home/test/config-min
+# BISECT_MANUAL = 1
#
--
1.7.2.3
next prev parent reply other threads:[~2011-03-08 15:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-08 15:21 [PATCH 0/9] ktest: queue for 2.6.39 Steven Rostedt
2011-03-08 15:21 ` [PATCH 1/9] ktest: Print logfile name on failure Steven Rostedt
2011-03-08 15:22 ` [PATCH 2/9] ktest: Start failure timeout on panic too Steven Rostedt
2011-03-08 15:22 ` [PATCH 3/9] ktest: Handle kernels before make oldnoconfig Steven Rostedt
2011-03-08 15:22 ` Steven Rostedt [this message]
2011-03-08 15:22 ` [PATCH 5/9] ktest: Add BISECT_SKIP Steven Rostedt
2011-03-08 15:22 ` [PATCH 6/9] ktest: Add BISECT_FILES to run git bisect on paths Steven Rostedt
2011-03-08 15:22 ` [PATCH 7/9] ktest: Fix bug where the test would not end after failure Steven Rostedt
2011-03-08 15:22 ` [PATCH 8/9] ktest: Monitor kernel while running of user tests Steven Rostedt
2011-03-08 15:22 ` [PATCH 9/9] ktest: Add STOP_TEST_AFTER to stop the test after a period of time Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110308152528.275834988@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox