diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-12 07:32:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-12 07:32:26 -0400 |
commit | 6bbcb1d3a2e0a31593e3b7d9bfd112fa7f447141 (patch) | |
tree | 557ab55cc4346347f64ec1f3d9d96707aea07b36 /tools/testing | |
parent | 8df6be116c87314e35c2ac9de35561b57f87739f (diff) | |
parent | d832d743385dd5e735660951aa9d7d36a6a4176a (diff) |
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
Diffstat (limited to 'tools/testing')
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 61 | ||||
-rw-r--r-- | tools/testing/ktest/sample.conf | 10 |
2 files changed, 57 insertions, 14 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 55ab700f6ba5..bf1398180785 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl | |||
@@ -194,6 +194,7 @@ my $config_bisect_check; | |||
194 | 194 | ||
195 | my $patchcheck_type; | 195 | my $patchcheck_type; |
196 | my $patchcheck_start; | 196 | my $patchcheck_start; |
197 | my $patchcheck_cherry; | ||
197 | my $patchcheck_end; | 198 | my $patchcheck_end; |
198 | 199 | ||
199 | # set when a test is something other that just building or install | 200 | # set when a test is something other that just building or install |
@@ -320,6 +321,7 @@ my %option_map = ( | |||
320 | 321 | ||
321 | "PATCHCHECK_TYPE" => \$patchcheck_type, | 322 | "PATCHCHECK_TYPE" => \$patchcheck_type, |
322 | "PATCHCHECK_START" => \$patchcheck_start, | 323 | "PATCHCHECK_START" => \$patchcheck_start, |
324 | "PATCHCHECK_CHERRY" => \$patchcheck_cherry, | ||
323 | "PATCHCHECK_END" => \$patchcheck_end, | 325 | "PATCHCHECK_END" => \$patchcheck_end, |
324 | ); | 326 | ); |
325 | 327 | ||
@@ -1448,6 +1450,12 @@ sub wait_for_monitor { | |||
1448 | } | 1450 | } |
1449 | } | 1451 | } |
1450 | print "** Monitor flushed **\n"; | 1452 | print "** Monitor flushed **\n"; |
1453 | |||
1454 | # if stop is defined but wasn't hit, return error | ||
1455 | # used by reboot (which wants to see a reboot) | ||
1456 | if (defined($stop) && !$booted) { | ||
1457 | $bug = 1; | ||
1458 | } | ||
1451 | return $bug; | 1459 | return $bug; |
1452 | } | 1460 | } |
1453 | 1461 | ||
@@ -2336,15 +2344,17 @@ sub success { | |||
2336 | 2344 | ||
2337 | sub answer_bisect { | 2345 | sub answer_bisect { |
2338 | for (;;) { | 2346 | for (;;) { |
2339 | doprint "Pass or fail? [p/f]"; | 2347 | doprint "Pass, fail, or skip? [p/f/s]"; |
2340 | my $ans = <STDIN>; | 2348 | my $ans = <STDIN>; |
2341 | chomp $ans; | 2349 | chomp $ans; |
2342 | if ($ans eq "p" || $ans eq "P") { | 2350 | if ($ans eq "p" || $ans eq "P") { |
2343 | return 1; | 2351 | return 1; |
2344 | } elsif ($ans eq "f" || $ans eq "F") { | 2352 | } elsif ($ans eq "f" || $ans eq "F") { |
2345 | return 0; | 2353 | return 0; |
2354 | } elsif ($ans eq "s" || $ans eq "S") { | ||
2355 | return -1; | ||
2346 | } else { | 2356 | } else { |
2347 | print "Please answer 'P' or 'F'\n"; | 2357 | print "Please answer 'p', 'f', or 's'\n"; |
2348 | } | 2358 | } |
2349 | } | 2359 | } |
2350 | } | 2360 | } |
@@ -2726,15 +2736,17 @@ sub bisect { | |||
2726 | run_command "git bisect start$start_files" or | 2736 | run_command "git bisect start$start_files" or |
2727 | dodie "could not start bisect"; | 2737 | dodie "could not start bisect"; |
2728 | 2738 | ||
2729 | run_command "git bisect good $good" or | ||
2730 | dodie "could not set bisect good to $good"; | ||
2731 | |||
2732 | run_git_bisect "git bisect bad $bad" or | ||
2733 | dodie "could not set bisect bad to $bad"; | ||
2734 | |||
2735 | if (defined($replay)) { | 2739 | if (defined($replay)) { |
2736 | run_command "git bisect replay $replay" or | 2740 | run_command "git bisect replay $replay" or |
2737 | dodie "failed to run replay"; | 2741 | dodie "failed to run replay"; |
2742 | } else { | ||
2743 | |||
2744 | run_command "git bisect good $good" or | ||
2745 | dodie "could not set bisect good to $good"; | ||
2746 | |||
2747 | run_git_bisect "git bisect bad $bad" or | ||
2748 | dodie "could not set bisect bad to $bad"; | ||
2749 | |||
2738 | } | 2750 | } |
2739 | 2751 | ||
2740 | if (defined($start)) { | 2752 | if (defined($start)) { |
@@ -3181,9 +3193,16 @@ sub patchcheck { | |||
3181 | 3193 | ||
3182 | my $start = $patchcheck_start; | 3194 | my $start = $patchcheck_start; |
3183 | 3195 | ||
3196 | my $cherry = $patchcheck_cherry; | ||
3197 | if (!defined($cherry)) { | ||
3198 | $cherry = 0; | ||
3199 | } | ||
3200 | |||
3184 | my $end = "HEAD"; | 3201 | my $end = "HEAD"; |
3185 | if (defined($patchcheck_end)) { | 3202 | if (defined($patchcheck_end)) { |
3186 | $end = $patchcheck_end; | 3203 | $end = $patchcheck_end; |
3204 | } elsif ($cherry) { | ||
3205 | die "PATCHCHECK_END must be defined with PATCHCHECK_CHERRY\n"; | ||
3187 | } | 3206 | } |
3188 | 3207 | ||
3189 | # Get the true sha1's since we can use things like HEAD~3 | 3208 | # Get the true sha1's since we can use things like HEAD~3 |
@@ -3197,24 +3216,38 @@ sub patchcheck { | |||
3197 | $type = "boot"; | 3216 | $type = "boot"; |
3198 | } | 3217 | } |
3199 | 3218 | ||
3200 | open (IN, "git log --pretty=oneline $end|") or | 3219 | if ($cherry) { |
3201 | dodie "could not get git list"; | 3220 | open (IN, "git cherry -v $start $end|") or |
3221 | dodie "could not get git list"; | ||
3222 | } else { | ||
3223 | open (IN, "git log --pretty=oneline $end|") or | ||
3224 | dodie "could not get git list"; | ||
3225 | } | ||
3202 | 3226 | ||
3203 | my @list; | 3227 | my @list; |
3204 | 3228 | ||
3205 | while (<IN>) { | 3229 | while (<IN>) { |
3206 | chomp; | 3230 | chomp; |
3231 | # git cherry adds a '+' we want to remove | ||
3232 | s/^\+ //; | ||
3207 | $list[$#list+1] = $_; | 3233 | $list[$#list+1] = $_; |
3208 | last if (/^$start/); | 3234 | last if (/^$start/); |
3209 | } | 3235 | } |
3210 | close(IN); | 3236 | close(IN); |
3211 | 3237 | ||
3212 | if ($list[$#list] !~ /^$start/) { | 3238 | if (!$cherry) { |
3213 | fail "SHA1 $start not found"; | 3239 | if ($list[$#list] !~ /^$start/) { |
3240 | fail "SHA1 $start not found"; | ||
3241 | } | ||
3242 | |||
3243 | # go backwards in the list | ||
3244 | @list = reverse @list; | ||
3214 | } | 3245 | } |
3215 | 3246 | ||
3216 | # go backwards in the list | 3247 | doprint("Going to test the following commits:\n"); |
3217 | @list = reverse @list; | 3248 | foreach my $l (@list) { |
3249 | doprint "$l\n"; | ||
3250 | } | ||
3218 | 3251 | ||
3219 | my $save_clean = $noclean; | 3252 | my $save_clean = $noclean; |
3220 | my %ignored_warnings; | 3253 | my %ignored_warnings; |
diff --git a/tools/testing/ktest/sample.conf b/tools/testing/ktest/sample.conf index 911e45ad657a..6c58cd8bbbae 100644 --- a/tools/testing/ktest/sample.conf +++ b/tools/testing/ktest/sample.conf | |||
@@ -906,6 +906,16 @@ | |||
906 | # | 906 | # |
907 | # PATCHCHECK_END is the last patch to check (default HEAD) | 907 | # PATCHCHECK_END is the last patch to check (default HEAD) |
908 | # | 908 | # |
909 | # PATCHCHECK_CHERRY if set to non zero, then git cherry will be | ||
910 | # performed against PATCHCHECK_START and PATCHCHECK_END. That is | ||
911 | # | ||
912 | # git cherry ${PATCHCHECK_START} ${PATCHCHECK_END} | ||
913 | # | ||
914 | # Then the changes found will be tested. | ||
915 | # | ||
916 | # Note, PATCHCHECK_CHERRY requires PATCHCHECK_END to be defined. | ||
917 | # (default 0) | ||
918 | # | ||
909 | # PATCHCHECK_TYPE is required and is the type of test to run: | 919 | # PATCHCHECK_TYPE is required and is the type of test to run: |
910 | # build, boot, test. | 920 | # build, boot, test. |
911 | # | 921 | # |