Use hardware reboot instead of software reboot as FAFT default reboot action.

We don't use software reboot as default because the time of software reboot
is various. It is hard to determine the delay time of firmware screen showed.
So we use hardware reboot instead.

BUG=chromium-os:19710
TEST=run_remote_tests.sh --remote=$REMOTE_IP -a \
         "servo_vid=0x18d1 servo_pid=0x5001" firmware_UserRequestRecovery

Change-Id: I6f1f60b7b30ec05f2e1fdc83078dc30f6a764873
Reviewed-on: https://gerrit.chromium.org/gerrit/11040
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
diff --git a/server/cros/faftsequence.py b/server/cros/faftsequence.py
index a57e9e8..b0d8e37 100644
--- a/server/cros/faftsequence.py
+++ b/server/cros/faftsequence.py
@@ -29,7 +29,7 @@
             returning True if valid, otherwise, False to break the whole
             test sequence.
         userspace_action: a function to describe the action ran in userspace.
-        reboot_action: a function to do reboot, default: software_reboot.
+        reboot_action: a function to do reboot, default: sync_and_hw_reboot.
         firmware_action: a function to describe the action ran after reboot.
 
     And configurations:
@@ -40,8 +40,8 @@
              is lost. So need to install it again.
 
     The default FAFT_STEP checks nothing in state_checker and does nothing in
-    userspace_action and firmware_action. Its reboot_action is simply a
-    software reboot. You can change the default FAFT_STEP by calling
+    userspace_action and firmware_action. Its reboot_action is a hardware
+    reboot. You can change the default FAFT_STEP by calling
     self.register_faft_template(FAFT_STEP).
 
     A FAFT test case consists of several FAFT_STEP's, namely FAFT_SEQUENCE.
@@ -75,7 +75,7 @@
         self.register_faft_template({
             'state_checker': (None),
             'userspace_action': (None),
-            'reboot_action': (self.faft_client.software_reboot),
+            'reboot_action': (self.sync_and_hw_reboot),
             'firmware_action': (None)
         })
 
@@ -191,6 +191,16 @@
         return True
 
 
+    def sync_and_hw_reboot(self):
+        """Request the client sync and do a warm reboot.
+
+        This is the default reboot action on FAFT.
+        """
+        self.faft_client.run_shell_command('sync')
+        time.sleep(5)
+        self.servo.warm_reset()
+
+
     def _str_action(self, action):
         """Convert the action function into a readable string.