diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-16 20:53:27 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-16 20:53:27 -0500 |
| commit | 5d48421be3c8a9f753d61b826ecb3ad287d867c0 (patch) | |
| tree | 69a20e537b5b76643484fd4e9b1e17e1eda60fb3 /tools/testing/ktest | |
| parent | 6e03db2ba17b5d32431b4c2012e6a41153318a90 (diff) | |
| parent | be405f95f0a090d1dfc26a5bb4d781c00f34479c (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-ktest:
ktest: Add INGORE_ERRORS to ignore warnings in boot up
ktest: Still do reboot even for REBOOT_TYPE = script
ktest: Fix compare script to test if options are not documented
ktest: Detect typos in option names
ktest: Have all values be set by defaults
ktest: Change initialization of defaults hash to perl format
ktest: Add options SWITCH_TO_GOOD and SWITCH_TO_TEST
ktest: Allow overriding bisect test results
ktest: Evaluate options before processing them
ktest: Evaluate $KERNEL_VERSION in both install and post install
ktest: Only ask options needed for install
ktest: When creating a new config, ask for BUILD_OPTIONS
ktest: Do not ask for some options if the only test is build
ktest: Ask for type of test when creating a new config
ktest: Allow bisect test to restart where it left off
ktest: When creating new config, allow the use of ${THIS_DIR}
ktest: Add default for ssh-user, build-target and target-image
ktest: Allow success logs to be stored
ktest: Save test output
Diffstat (limited to 'tools/testing/ktest')
| -rwxr-xr-x | tools/testing/ktest/compare-ktest-sample.pl | 4 | ||||
| -rwxr-xr-x | tools/testing/ktest/ktest.pl | 682 | ||||
| -rw-r--r-- | tools/testing/ktest/sample.conf | 87 |
3 files changed, 581 insertions, 192 deletions
diff --git a/tools/testing/ktest/compare-ktest-sample.pl b/tools/testing/ktest/compare-ktest-sample.pl index 9a571e71683c..a373a5bfff68 100755 --- a/tools/testing/ktest/compare-ktest-sample.pl +++ b/tools/testing/ktest/compare-ktest-sample.pl | |||
| @@ -2,7 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | open (IN,"ktest.pl"); | 3 | open (IN,"ktest.pl"); |
| 4 | while (<IN>) { | 4 | while (<IN>) { |
| 5 | # hashes are now used | ||
| 5 | if (/\$opt\{"?([A-Z].*?)(\[.*\])?"?\}/ || | 6 | if (/\$opt\{"?([A-Z].*?)(\[.*\])?"?\}/ || |
| 7 | /^\s*"?([A-Z].*?)"?\s*=>\s*/ || | ||
| 6 | /set_test_option\("(.*?)"/) { | 8 | /set_test_option\("(.*?)"/) { |
| 7 | $opt{$1} = 1; | 9 | $opt{$1} = 1; |
| 8 | } | 10 | } |
| @@ -11,7 +13,7 @@ close IN; | |||
| 11 | 13 | ||
| 12 | open (IN, "sample.conf"); | 14 | open (IN, "sample.conf"); |
| 13 | while (<IN>) { | 15 | while (<IN>) { |
| 14 | if (/^\s*#?\s*(\S+)\s*=/) { | 16 | if (/^\s*#?\s*([A-Z]\S*)\s*=/) { |
| 15 | $samp{$1} = 1; | 17 | $samp{$1} = 1; |
| 16 | } | 18 | } |
| 17 | } | 19 | } |
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 8b4c2535b266..62a134dc421a 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl | |||
| @@ -18,40 +18,50 @@ $| = 1; | |||
| 18 | my %opt; | 18 | my %opt; |
| 19 | my %repeat_tests; | 19 | my %repeat_tests; |
| 20 | my %repeats; | 20 | my %repeats; |
| 21 | my %default; | ||
| 22 | 21 | ||
| 23 | #default opts | 22 | #default opts |
| 24 | $default{"NUM_TESTS"} = 1; | 23 | my %default = ( |
| 25 | $default{"REBOOT_TYPE"} = "grub"; | 24 | "NUM_TESTS" => 1, |
| 26 | $default{"TEST_TYPE"} = "test"; | 25 | "TEST_TYPE" => "build", |
| 27 | $default{"BUILD_TYPE"} = "randconfig"; | 26 | "BUILD_TYPE" => "randconfig", |
| 28 | $default{"MAKE_CMD"} = "make"; | 27 | "MAKE_CMD" => "make", |
| 29 | $default{"TIMEOUT"} = 120; | 28 | "TIMEOUT" => 120, |
| 30 | $default{"TMP_DIR"} = "/tmp/ktest/\${MACHINE}"; | 29 | "TMP_DIR" => "/tmp/ktest/\${MACHINE}", |
| 31 | $default{"SLEEP_TIME"} = 60; # sleep time between tests | 30 | "SLEEP_TIME" => 60, # sleep time between tests |
| 32 | $default{"BUILD_NOCLEAN"} = 0; | 31 | "BUILD_NOCLEAN" => 0, |
| 33 | $default{"REBOOT_ON_ERROR"} = 0; | 32 | "REBOOT_ON_ERROR" => 0, |
| 34 | $default{"POWEROFF_ON_ERROR"} = 0; | 33 | "POWEROFF_ON_ERROR" => 0, |
| 35 | $default{"REBOOT_ON_SUCCESS"} = 1; | 34 | "REBOOT_ON_SUCCESS" => 1, |
| 36 | $default{"POWEROFF_ON_SUCCESS"} = 0; | 35 | "POWEROFF_ON_SUCCESS" => 0, |
| 37 | $default{"BUILD_OPTIONS"} = ""; | 36 | "BUILD_OPTIONS" => "", |
| 38 | $default{"BISECT_SLEEP_TIME"} = 60; # sleep time between bisects | 37 | "BISECT_SLEEP_TIME" => 60, # sleep time between bisects |
| 39 | $default{"PATCHCHECK_SLEEP_TIME"} = 60; # sleep time between patch checks | 38 | "PATCHCHECK_SLEEP_TIME" => 60, # sleep time between patch checks |
| 40 | $default{"CLEAR_LOG"} = 0; | 39 | "CLEAR_LOG" => 0, |
| 41 | $default{"BISECT_MANUAL"} = 0; | 40 | "BISECT_MANUAL" => 0, |
| 42 | $default{"BISECT_SKIP"} = 1; | 41 | "BISECT_SKIP" => 1, |
| 43 | $default{"SUCCESS_LINE"} = "login:"; | 42 | "SUCCESS_LINE" => "login:", |
| 44 | $default{"DETECT_TRIPLE_FAULT"} = 1; | 43 | "DETECT_TRIPLE_FAULT" => 1, |
| 45 | $default{"NO_INSTALL"} = 0; | 44 | "NO_INSTALL" => 0, |
| 46 | $default{"BOOTED_TIMEOUT"} = 1; | 45 | "BOOTED_TIMEOUT" => 1, |
| 47 | $default{"DIE_ON_FAILURE"} = 1; | 46 | "DIE_ON_FAILURE" => 1, |
| 48 | $default{"SSH_EXEC"} = "ssh \$SSH_USER\@\$MACHINE \$SSH_COMMAND"; | 47 | "SSH_EXEC" => "ssh \$SSH_USER\@\$MACHINE \$SSH_COMMAND", |
| 49 | $default{"SCP_TO_TARGET"} = "scp \$SRC_FILE \$SSH_USER\@\$MACHINE:\$DST_FILE"; | 48 | "SCP_TO_TARGET" => "scp \$SRC_FILE \$SSH_USER\@\$MACHINE:\$DST_FILE", |
| 50 | $default{"REBOOT"} = "ssh \$SSH_USER\@\$MACHINE reboot"; | 49 | "REBOOT" => "ssh \$SSH_USER\@\$MACHINE reboot", |
| 51 | $default{"STOP_AFTER_SUCCESS"} = 10; | 50 | "STOP_AFTER_SUCCESS" => 10, |
| 52 | $default{"STOP_AFTER_FAILURE"} = 60; | 51 | "STOP_AFTER_FAILURE" => 60, |
| 53 | $default{"STOP_TEST_AFTER"} = 600; | 52 | "STOP_TEST_AFTER" => 600, |
| 54 | $default{"LOCALVERSION"} = "-test"; | 53 | |
| 54 | # required, and we will ask users if they don't have them but we keep the default | ||
| 55 | # value something that is common. | ||
| 56 | "REBOOT_TYPE" => "grub", | ||
| 57 | "LOCALVERSION" => "-test", | ||
| 58 | "SSH_USER" => "root", | ||
| 59 | "BUILD_TARGET" => "arch/x86/boot/bzImage", | ||
| 60 | "TARGET_IMAGE" => "/boot/vmlinuz-test", | ||
| 61 | |||
| 62 | "LOG_FILE" => undef, | ||
| 63 | "IGNORE_UNUSED" => 0, | ||
| 64 | ); | ||
| 55 | 65 | ||
| 56 | my $ktest_config; | 66 | my $ktest_config; |
| 57 | my $version; | 67 | my $version; |
| @@ -73,6 +83,8 @@ my $reboot_script; | |||
| 73 | my $power_cycle; | 83 | my $power_cycle; |
| 74 | my $reboot; | 84 | my $reboot; |
| 75 | my $reboot_on_error; | 85 | my $reboot_on_error; |
| 86 | my $switch_to_good; | ||
| 87 | my $switch_to_test; | ||
| 76 | my $poweroff_on_error; | 88 | my $poweroff_on_error; |
| 77 | my $die_on_failure; | 89 | my $die_on_failure; |
| 78 | my $powercycle_after_reboot; | 90 | my $powercycle_after_reboot; |
| @@ -92,17 +104,24 @@ my $start_minconfig; | |||
| 92 | my $start_minconfig_defined; | 104 | my $start_minconfig_defined; |
| 93 | my $output_minconfig; | 105 | my $output_minconfig; |
| 94 | my $ignore_config; | 106 | my $ignore_config; |
| 107 | my $ignore_errors; | ||
| 95 | my $addconfig; | 108 | my $addconfig; |
| 96 | my $in_bisect = 0; | 109 | my $in_bisect = 0; |
| 97 | my $bisect_bad = ""; | 110 | my $bisect_bad_commit = ""; |
| 98 | my $reverse_bisect; | 111 | my $reverse_bisect; |
| 99 | my $bisect_manual; | 112 | my $bisect_manual; |
| 100 | my $bisect_skip; | 113 | my $bisect_skip; |
| 101 | my $config_bisect_good; | 114 | my $config_bisect_good; |
| 115 | my $bisect_ret_good; | ||
| 116 | my $bisect_ret_bad; | ||
| 117 | my $bisect_ret_skip; | ||
| 118 | my $bisect_ret_abort; | ||
| 119 | my $bisect_ret_default; | ||
| 102 | my $in_patchcheck = 0; | 120 | my $in_patchcheck = 0; |
| 103 | my $run_test; | 121 | my $run_test; |
| 104 | my $redirect; | 122 | my $redirect; |
| 105 | my $buildlog; | 123 | my $buildlog; |
| 124 | my $testlog; | ||
| 106 | my $dmesg; | 125 | my $dmesg; |
| 107 | my $monitor_fp; | 126 | my $monitor_fp; |
| 108 | my $monitor_pid; | 127 | my $monitor_pid; |
| @@ -112,6 +131,7 @@ my $bisect_sleep_time; | |||
| 112 | my $patchcheck_sleep_time; | 131 | my $patchcheck_sleep_time; |
| 113 | my $ignore_warnings; | 132 | my $ignore_warnings; |
| 114 | my $store_failures; | 133 | my $store_failures; |
| 134 | my $store_successes; | ||
| 115 | my $test_name; | 135 | my $test_name; |
| 116 | my $timeout; | 136 | my $timeout; |
| 117 | my $booted_timeout; | 137 | my $booted_timeout; |
| @@ -124,10 +144,34 @@ my $stop_after_failure; | |||
| 124 | my $stop_test_after; | 144 | my $stop_test_after; |
| 125 | my $build_target; | 145 | my $build_target; |
| 126 | my $target_image; | 146 | my $target_image; |
| 147 | my $checkout; | ||
| 127 | my $localversion; | 148 | my $localversion; |
| 128 | my $iteration = 0; | 149 | my $iteration = 0; |
| 129 | my $successes = 0; | 150 | my $successes = 0; |
| 130 | 151 | ||
| 152 | my $bisect_good; | ||
| 153 | my $bisect_bad; | ||
| 154 | my $bisect_type; | ||
| 155 | my $bisect_start; | ||
| 156 | my $bisect_replay; | ||
| 157 | my $bisect_files; | ||
| 158 | my $bisect_reverse; | ||
| 159 | my $bisect_check; | ||
| 160 | |||
| 161 | my $config_bisect; | ||
| 162 | my $config_bisect_type; | ||
| 163 | |||
| 164 | my $patchcheck_type; | ||
| 165 | my $patchcheck_start; | ||
| 166 | my $patchcheck_end; | ||
| 167 | |||
| 168 | # set when a test is something other that just building or install | ||
