提交 6bbcb1d3 编写于 作者: L Linus Torvalds

Merge tag 'ktest-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest

Pull ktest update from Steven Rostedt:
 "A fix and a clean up to ktest, as well as two small features.

   - A way to allow users to skip a manual bisect.
   - Allowing cherry picked patches to be tested.

  The cherry pick worked for a test I needed, but stressing it may not
  have all the desired effects.  It doesn't cause any regressions so I
  kept it in"

* tag 'ktest-v3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest:
  ktest: Don't bother with bisect good or bad on replay
  ktest: Fix check for new kernel success on rebooting to good kernel
  ktest: add ability to skip during BISECT_MANUAL
  ktest: Add PATCHCHECK_CHERRY
...@@ -194,6 +194,7 @@ my $config_bisect_check; ...@@ -194,6 +194,7 @@ my $config_bisect_check;
my $patchcheck_type; my $patchcheck_type;
my $patchcheck_start; my $patchcheck_start;
my $patchcheck_cherry;
my $patchcheck_end; my $patchcheck_end;
# set when a test is something other that just building or install # set when a test is something other that just building or install
...@@ -320,6 +321,7 @@ my %option_map = ( ...@@ -320,6 +321,7 @@ my %option_map = (
"PATCHCHECK_TYPE" => \$patchcheck_type, "PATCHCHECK_TYPE" => \$patchcheck_type,
"PATCHCHECK_START" => \$patchcheck_start, "PATCHCHECK_START" => \$patchcheck_start,
"PATCHCHECK_CHERRY" => \$patchcheck_cherry,
"PATCHCHECK_END" => \$patchcheck_end, "PATCHCHECK_END" => \$patchcheck_end,
); );
...@@ -1448,6 +1450,12 @@ sub wait_for_monitor { ...@@ -1448,6 +1450,12 @@ sub wait_for_monitor {
} }
} }
print "** Monitor flushed **\n"; print "** Monitor flushed **\n";
# if stop is defined but wasn't hit, return error
# used by reboot (which wants to see a reboot)
if (defined($stop) && !$booted) {
$bug = 1;
}
return $bug; return $bug;
} }
...@@ -2336,15 +2344,17 @@ sub success { ...@@ -2336,15 +2344,17 @@ sub success {
sub answer_bisect { sub answer_bisect {
for (;;) { for (;;) {
doprint "Pass or fail? [p/f]"; doprint "Pass, fail, or skip? [p/f/s]";
my $ans = <STDIN>; my $ans = <STDIN>;
chomp $ans; chomp $ans;
if ($ans eq "p" || $ans eq "P") { if ($ans eq "p" || $ans eq "P") {
return 1; return 1;
} elsif ($ans eq "f" || $ans eq "F") { } elsif ($ans eq "f" || $ans eq "F") {
return 0; return 0;
} elsif ($ans eq "s" || $ans eq "S") {
return -1;
} else { } else {
print "Please answer 'P' or 'F'\n"; print "Please answer 'p', 'f', or 's'\n";
} }
} }
} }
...@@ -2726,15 +2736,17 @@ sub bisect { ...@@ -2726,15 +2736,17 @@ sub bisect {
run_command "git bisect start$start_files" or run_command "git bisect start$start_files" or
dodie "could not start bisect"; dodie "could not start bisect";
run_command "git bisect good $good" or
dodie "could not set bisect good to $good";
run_git_bisect "git bisect bad $bad" or
dodie "could not set bisect bad to $bad";
if (defined($replay)) { if (defined($replay)) {
run_command "git bisect replay $replay" or run_command "git bisect replay $replay" or
dodie "failed to run replay"; dodie "failed to run replay";
} else {
run_command "git bisect good $good" or
dodie "could not set bisect good to $good";
run_git_bisect "git bisect bad $bad" or
dodie "could not set bisect bad to $bad";
} }
if (defined($start)) { if (defined($start)) {
...@@ -3181,9 +3193,16 @@ sub patchcheck { ...@@ -3181,9 +3193,16 @@ sub patchcheck {
my $start = $patchcheck_start; my $start = $patchcheck_start;
my $cherry = $patchcheck_cherry;
if (!defined($cherry)) {
$cherry = 0;
}
my $end = "HEAD"; my $end = "HEAD";
if (defined($patchcheck_end)) { if (defined($patchcheck_end)) {
$end = $patchcheck_end; $end = $patchcheck_end;
} elsif ($cherry) {
die "PATCHCHECK_END must be defined with PATCHCHECK_CHERRY\n";
} }
# Get the true sha1's since we can use things like HEAD~3 # Get the true sha1's since we can use things like HEAD~3
...@@ -3197,24 +3216,38 @@ sub patchcheck { ...@@ -3197,24 +3216,38 @@ sub patchcheck {
$type = "boot"; $type = "boot";
} }
open (IN, "git log --pretty=oneline $end|") or if ($cherry) {
dodie "could not get git list"; open (IN, "git cherry -v $start $end|") or
dodie "could not get git list";
} else {
open (IN, "git log --pretty=oneline $end|") or
dodie "could not get git list";
}
my @list; my @list;
while (<IN>) { while (<IN>) {
chomp; chomp;
# git cherry adds a '+' we want to remove
s/^\+ //;
$list[$#list+1] = $_; $list[$#list+1] = $_;
last if (/^$start/); last if (/^$start/);
} }
close(IN); close(IN);
if ($list[$#list] !~ /^$start/) { if (!$cherry) {
fail "SHA1 $start not found"; if ($list[$#list] !~ /^$start/) {
fail "SHA1 $start not found";
}
# go backwards in the list
@list = reverse @list;
} }
# go backwards in the list doprint("Going to test the following commits:\n");
@list = reverse @list; foreach my $l (@list) {
doprint "$l\n";
}
my $save_clean = $noclean; my $save_clean = $noclean;
my %ignored_warnings; my %ignored_warnings;
......
...@@ -906,6 +906,16 @@ ...@@ -906,6 +906,16 @@
# #
# PATCHCHECK_END is the last patch to check (default HEAD) # PATCHCHECK_END is the last patch to check (default HEAD)
# #
# PATCHCHECK_CHERRY if set to non zero, then git cherry will be
# performed against PATCHCHECK_START and PATCHCHECK_END. That is
#
# git cherry ${PATCHCHECK_START} ${PATCHCHECK_END}
#
# Then the changes found will be tested.
#
# Note, PATCHCHECK_CHERRY requires PATCHCHECK_END to be defined.
# (default 0)
#
# PATCHCHECK_TYPE is required and is the type of test to run: # PATCHCHECK_TYPE is required and is the type of test to run:
# build, boot, test. # build, boot, test.
# #
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册