aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/ktest
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-16 20:53:27 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-16 20:53:27 -0500
commit5d48421be3c8a9f753d61b826ecb3ad287d867c0 (patch)
tree69a20e537b5b76643484fd4e9b1e17e1eda60fb3 /tools/testing/ktest
parent6e03db2ba17b5d32431b4c2012e6a41153318a90 (diff)
parentbe405f95f0a090d1dfc26a5bb4d781c00f34479c (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-xtools/testing/ktest/compare-ktest-sample.pl4
-rwxr-xr-xtools/testing/ktest/ktest.pl682
-rw-r--r--tools/testing/ktest/sample.conf87
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
3open (IN,"ktest.pl"); 3open (IN,"ktest.pl");
4while (<IN>) { 4while (<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
12open (IN, "sample.conf"); 14open (IN, "sample.conf");
13while (<IN>) { 15while (<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;
18my %opt; 18my %opt;
19my %repeat_tests; 19my %repeat_tests;
20my %repeats; 20my %repeats;
21my %default;
22 21
23#default opts 22#default opts
24$default{"NUM_TESTS"} = 1; 23my %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
56my $ktest_config; 66my $ktest_config;
57my $version; 67my $version;
@@ -73,6 +83,8 @@ my $reboot_script;
73my $power_cycle; 83my $power_cycle;
74my $reboot; 84my $reboot;
75my $reboot_on_error; 85my $reboot_on_error;
86my $switch_to_good;
87my $switch_to_test;
76my $poweroff_on_error; 88my $poweroff_on_error;
77my $die_on_failure; 89my $die_on_failure;
78my $powercycle_after_reboot; 90my $powercycle_after_reboot;
@@ -92,17 +104,24 @@ my $start_minconfig;
92my $start_minconfig_defined; 104my $start_minconfig_defined;
93my $output_minconfig; 105my $output_minconfig;
94my $ignore_config; 106my $ignore_config;
107my $ignore_errors;
95my $addconfig; 108my $addconfig;
96my $in_bisect = 0; 109my $in_bisect = 0;
97my $bisect_bad = ""; 110my $bisect_bad_commit = "";
98my $reverse_bisect; 111my $reverse_bisect;
99my $bisect_manual; 112my $bisect_manual;
100my $bisect_skip; 113my $bisect_skip;
101my $config_bisect_good; 114my $config_bisect_good;
115my $bisect_ret_good;
116my $bisect_ret_bad;
117my $bisect_ret_skip;
118my $bisect_ret_abort;
119my $bisect_ret_default;
102my $in_patchcheck = 0; 120my $in_patchcheck = 0;
103my $run_test; 121my $run_test;
104my $redirect; 122my $redirect;
105my $buildlog; 123my $buildlog;
124my $testlog;
106my $dmesg; 125my $dmesg;
107my $monitor_fp; 126my $monitor_fp;
108my $monitor_pid; 127my $monitor_pid;
@@ -112,6 +131,7 @@ my $bisect_sleep_time;
112my $patchcheck_sleep_time; 131my $patchcheck_sleep_time;
113my $ignore_warnings; 132my $ignore_warnings;
114my $store_failures; 133my $store_failures;
134my $store_successes;
115my $test_name; 135my $test_name;
116my $timeout; 136my $timeout;
117my $booted_timeout; 137my $booted_timeout;
@@ -124,10 +144,34 @@ my $stop_after_failure;
124my $stop_test_after; 144my $stop_test_after;
125my $build_target; 145my $build_target;
126my $target_image; 146my $target_image;
147my $checkout;
127my $localversion; 148my $localversion;
128my $iteration = 0; 149my $iteration = 0;
129my $successes = 0; 150my $successes = 0;
130 151
152my $bisect_good;
153my $bisect_bad;
154my $bisect_type;
155my $bisect_start;
156my $bisect_replay;
157my $bisect_files;
158my $bisect_reverse;
159my $bisect_check;
160
161my $config_bisect;
162my $config_bisect_type;
163
164my $patchcheck_type;
165my $patchcheck_start;
166my $patchcheck_end;
167
168# set when a test is something other that just building or install