diff options
Diffstat (limited to 'tools/testing/ktest/ktest.pl')
-rwxr-xr-x | tools/testing/ktest/ktest.pl | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index c95209bac65a..e55bd52367a6 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl | |||
@@ -37,6 +37,7 @@ $default{"POWEROFF_ON_SUCCESS"} = 0; | |||
37 | $default{"BUILD_OPTIONS"} = ""; | 37 | $default{"BUILD_OPTIONS"} = ""; |
38 | $default{"BISECT_SLEEP_TIME"} = 60; # sleep time between bisects | 38 | $default{"BISECT_SLEEP_TIME"} = 60; # sleep time between bisects |
39 | $default{"CLEAR_LOG"} = 0; | 39 | $default{"CLEAR_LOG"} = 0; |
40 | $default{"BISECT_MANUAL"} = 0; | ||
40 | $default{"SUCCESS_LINE"} = "login:"; | 41 | $default{"SUCCESS_LINE"} = "login:"; |
41 | $default{"BOOTED_TIMEOUT"} = 1; | 42 | $default{"BOOTED_TIMEOUT"} = 1; |
42 | $default{"DIE_ON_FAILURE"} = 1; | 43 | $default{"DIE_ON_FAILURE"} = 1; |
@@ -81,6 +82,7 @@ my $addconfig; | |||
81 | my $in_bisect = 0; | 82 | my $in_bisect = 0; |
82 | my $bisect_bad = ""; | 83 | my $bisect_bad = ""; |
83 | my $reverse_bisect; | 84 | my $reverse_bisect; |
85 | my $bisect_manual; | ||
84 | my $in_patchcheck = 0; | 86 | my $in_patchcheck = 0; |
85 | my $run_test; | 87 | my $run_test; |
86 | my $redirect; | 88 | my $redirect; |
@@ -1046,6 +1048,21 @@ sub get_version { | |||
1046 | doprint "$version\n"; | 1048 | doprint "$version\n"; |
1047 | } | 1049 | } |
1048 | 1050 | ||
1051 | sub answer_bisect { | ||
1052 | for (;;) { | ||
1053 | doprint "Pass or fail? [p/f]"; | ||
1054 | my $ans = <STDIN>; | ||
1055 | chomp $ans; | ||
1056 | if ($ans eq "p" || $ans eq "P") { | ||
1057 | return 1; | ||
1058 | } elsif ($ans eq "f" || $ans eq "F") { | ||
1059 | return 0; | ||
1060 | } else { | ||
1061 | print "Please answer 'P' or 'F'\n"; | ||
1062 | } | ||
1063 | } | ||
1064 | } | ||
1065 | |||
1049 | sub child_run_test { | 1066 | sub child_run_test { |
1050 | my $failed = 0; | 1067 | my $failed = 0; |
1051 | 1068 | ||
@@ -1214,6 +1231,9 @@ sub run_bisect { | |||
1214 | 1231 | ||
1215 | my $ret = run_bisect_test $type, $buildtype; | 1232 | my $ret = run_bisect_test $type, $buildtype; |
1216 | 1233 | ||
1234 | if ($bisect_manual) { | ||
1235 | $ret = answer_bisect; | ||
1236 | } | ||
1217 | 1237 | ||
1218 | # Are we looking for where it worked, not failed? | 1238 | # Are we looking for where it worked, not failed? |
1219 | if ($reverse_bisect) { | 1239 | if ($reverse_bisect) { |
@@ -1524,7 +1544,9 @@ sub run_config_bisect { | |||
1524 | } | 1544 | } |
1525 | 1545 | ||
1526 | $ret = run_config_bisect_test $type; | 1546 | $ret = run_config_bisect_test $type; |
1527 | 1547 | if ($bisect_manual) { | |
1548 | $ret = answer_bisect; | ||
1549 | } | ||
1528 | if ($ret) { | 1550 | if ($ret) { |
1529 | process_passed %current_config; | 1551 | process_passed %current_config; |
1530 | return 0; | 1552 | return 0; |
@@ -1555,7 +1577,13 @@ sub run_config_bisect { | |||
1555 | $half = int($#start_list / 2); | 1577 | $half = int($#start_list / 2); |
1556 | } while ($half > 0); | 1578 | } while ($half > 0); |
1557 | 1579 | ||
1558 | # we found a single config, try it again | 1580 | # we found a single config, try it again unless we are running manually |
1581 | |||
1582 | if ($bisect_manual) { | ||
1583 | process_failed $start_list[0]; | ||
1584 | return 1; | ||
1585 | } | ||
1586 | |||
1559 | my @tophalf = @start_list[0 .. 0]; | 1587 | my @tophalf = @start_list[0 .. 0]; |
1560 | 1588 | ||
1561 | $ret = run_config_bisect_test $type; | 1589 | $ret = run_config_bisect_test $type; |
@@ -1925,6 +1953,7 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) { | |||
1925 | $poweroff_after_halt = set_test_option("POWEROFF_AFTER_HALT", $i); | 1953 | $poweroff_after_halt = set_test_option("POWEROFF_AFTER_HALT", $i); |
1926 | $sleep_time = set_test_option("SLEEP_TIME", $i); | 1954 | $sleep_time = set_test_option("SLEEP_TIME", $i); |
1927 | $bisect_sleep_time = set_test_option("BISECT_SLEEP_TIME", $i); | 1955 | $bisect_sleep_time = set_test_option("BISECT_SLEEP_TIME", $i); |
1956 | $bisect_manual = set_test_option("BISECT_MANUAL", $i); | ||
1928 | $store_failures = set_test_option("STORE_FAILURES", $i); | 1957 | $store_failures = set_test_option("STORE_FAILURES", $i); |
1929 | $timeout = set_test_option("TIMEOUT", $i); | 1958 | $timeout = set_test_option("TIMEOUT", $i); |
1930 | $booted_timeout = set_test_option("BOOTED_TIMEOUT", $i); | 1959 | $booted_timeout = set_test_option("BOOTED_TIMEOUT", $i); |