aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/ktest/ktest.pl
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-09-30 18:12:20 -0400
committerSteven Rostedt <rostedt@goodmis.org>2011-10-17 11:54:11 -0400
commit4ab1cce5bdd87948b75ed4fe4a8629c0f76267ae (patch)
tree941b91be6f4e1e92249d4736eef0b764f1e10161 /tools/testing/ktest/ktest.pl
parent2b803365a6fa177ea7e1f64f645be1cb5dd39d55 (diff)
ktest: Do not reboot on config or build issues
Even if REBOOT_ON_ERROR is set, it becomes annoying that the target machine is rebooted when a config option is incorrect or a build fails. There's no reason to reboot the target for host only issues. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/ktest/ktest.pl')
-rwxr-xr-xtools/testing/ktest/ktest.pl22
1 files changed, 20 insertions, 2 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl
index 51ddaa5ed556..057676a8e785 100755
--- a/tools/testing/ktest/ktest.pl
+++ b/tools/testing/ktest/ktest.pl
@@ -133,6 +133,9 @@ my %config_help;
133my %variable; 133my %variable;
134my %force_config; 134my %force_config;
135 135
136# do not force reboots on config problems
137my $no_reboot = 1;
138
136$config_help{"MACHINE"} = << "EOF" 139$config_help{"MACHINE"} = << "EOF"
137 The machine hostname that you will test. 140 The machine hostname that you will test.
138EOF 141EOF
@@ -640,7 +643,7 @@ sub reboot {
640sub do_not_reboot { 643sub do_not_reboot {
641 my $i = $iteration; 644 my $i = $iteration;
642 645
643 return $test_type eq "build" || 646 return $test_type eq "build" || $no_reboot ||
644 ($test_type eq "patchcheck" && $opt{"PATCHCHECK_TYPE[$i]"} eq "build") || 647 ($test_type eq "patchcheck" && $opt{"PATCHCHECK_TYPE[$i]"} eq "build") ||
645 ($test_type eq "bisect" && $opt{"BISECT_TYPE[$i]"} eq "build"); 648 ($test_type eq "bisect" && $opt{"BISECT_TYPE[$i]"} eq "build");
646} 649}
@@ -1285,6 +1288,10 @@ sub build {
1285 1288
1286 unlink $buildlog; 1289 unlink $buildlog;
1287 1290
1291 # Failed builds should not reboot the target
1292 my $save_no_reboot = $no_reboot;
1293 $no_reboot = 1;
1294
1288 if (defined($pre_build)) { 1295 if (defined($pre_build)) {
1289 my $ret = run_command $pre_build; 1296 my $ret = run_command $pre_build;
1290 if (!$ret && defined($pre_build_die) && 1297 if (!$ret && defined($pre_build_die) &&
@@ -1353,10 +1360,15 @@ sub build {
1353 1360
1354 if (!$build_ret) { 1361 if (!$build_ret) {
1355 # bisect may need this to pass 1362 # bisect may need this to pass
1356 return 0 if ($in_bisect); 1363 if ($in_bisect) {
1364 $no_reboot = $save_no_reboot;
1365 return 0;
1366 }
1357 fail "failed build" and return 0; 1367 fail "failed build" and return 0;
1358 } 1368 }
1359 1369
1370 $no_reboot = $save_no_reboot;
1371
1360 return 1; 1372 return 1;
1361} 1373}
1362 1374
@@ -2806,6 +2818,9 @@ sub set_test_option {
2806# First we need to do is the builds 2818# First we need to do is the builds
2807for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) { 2819for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
2808 2820
2821 # Do not reboot on failing test options
2822 $no_reboot = 1;
2823
2809 $iteration = $i; 2824 $iteration = $i;
2810 2825
2811 my $makecmd = set_test_option("MAKE_CMD", $i); 2826 my $makecmd = set_test_option("MAKE_CMD", $i);
@@ -2941,6 +2956,9 @@ for (my $i = 1; $i <= $opt{"NUM_TESTS"}; $i++) {
2941 die "failed to checkout $checkout"; 2956 die "failed to checkout $checkout";
2942 } 2957 }
2943 2958
2959 $no_reboot = 0;
2960
2961
2944 if ($test_type eq "bisect") { 2962 if ($test_type eq "bisect") {
2945 bisect $i; 2963 bisect $i;
2946 next; 2964 next;