"SCP_TO_TARGET"            => "scp \$SRC_FILE \$SSH_USER\@\$MACHINE:\$DST_FILE",
     "SCP_TO_TARGET_INSTALL"    => "\${SCP_TO_TARGET}",
     "REBOOT"                   => "ssh \$SSH_USER\@\$MACHINE reboot",
+    "REBOOT_RETURN_CODE"       => 255,
     "STOP_AFTER_SUCCESS"       => 10,
     "STOP_AFTER_FAILURE"       => 60,
     "STOP_TEST_AFTER"          => 600,
 my $reboot_script;
 my $power_cycle;
 my $reboot;
+my $reboot_return_code;
 my $reboot_on_error;
 my $switch_to_good;
 my $switch_to_test;
     "POST_BUILD_DIE"           => \$post_build_die,
     "POWER_CYCLE"              => \$power_cycle,
     "REBOOT"                   => \$reboot,
+    "REBOOT_RETURN_CODE"       => \$reboot_return_code,
     "BUILD_NOCLEAN"            => \$noclean,
     "MIN_CONFIG"               => \$minconfig,
     "OUTPUT_MIN_CONFIG"                => \$output_minconfig,
     my $dord = 0;
     my $dostdout = 0;
     my $pid;
+    my $command_orig = $command;
 
     $command =~ s/\$SSH_USER/$ssh_user/g;
     $command =~ s/\$MACHINE/$machine/g;
     # shift 8 for real exit status
     $run_command_status = $? >> 8;
 
+    if ($command_orig eq $default{REBOOT} &&
+       $run_command_status == $reboot_return_code) {
+       $run_command_status = 0;
+    }
+
     close(CMD);
     close(LOG) if ($dolog);
     close(RD)  if ($dord);
 
 # The variables SSH_USER and MACHINE are defined.
 #REBOOT = ssh $SSH_USER@$MACHINE reboot
 
+# The return code of REBOOT
+# (default 255)
+#REBOOT_RETURN_CODE = 255
+
 # The way triple faults are detected is by testing the kernel
 # banner. If the kernel banner for the kernel we are testing is
 # found, and then later a kernel banner for another kernel version