autotest: try to repair DUT with sysrq-x first
When the DUT was no longer accessible through SSH, try first to repair
it by pressing 3 times sysrq-x before trying the servo cold reset.
This way we can try to force the kernel to trigger a panic and get the
last kernel logs in the console ramoops after reboot.
BUG=chromium:615662
TEST=run a local autoserv instance:
sudo ./server/autoserv -R -m ...
after stopping 'shill' on the DUT to simulate a networking issue.
CQ-DEPEND=CL:361760
Change-Id: I31c4bf567655d4207c7aa9e490b1fcbcaa9ef8d2
Reviewed-on: https://chromium-review.googlesource.com/361691
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
diff --git a/server/cros/servo/servo.py b/server/cros/servo/servo.py
index e3a0acd..3f12981 100644
--- a/server/cros/servo/servo.py
+++ b/server/cros/servo/servo.py
@@ -380,6 +380,16 @@
self._server.imaginary_key(press_secs)
+ def sysrq_x(self, press_secs=''):
+ """Simulate Alt VolumeUp X simulataneous press.
+
+ This key combination is the kernel system request (sysrq) X.
+
+ @param press_secs : Str. Time to press key.
+ """
+ self._server.sysrq_x(press_secs)
+
+
def toggle_recovery_switch(self):
"""Toggle recovery switch on and off."""
self.enable_recovery_mode()