blob: bc4baf0a0f52caeb8590aa90f521ec8bcc7e8e6c [file] [log] [blame]
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import subprocess
from autotest_lib.server.cros.faftsequence import FAFTSequence
class firmware_CgptState(FAFTSequence):
Servo based executing the CgptState test on client side.
This test triggers the CgptState test on client side. In the client
CgptState test, it set kernels A and B with different cgpt states
(priority, tries, successful) and checks their boot results.
The test items and logic are now handled in client. This FAFT test
just handles the reboot logic.
See /usr/local/sbin/firmware/saft/ for more detail.
version = 1
host = None
not_finished = True
def run_test_step(self):
# Show the client log messages in another thread.
show_client_log = subprocess.Popen([
'ssh -o StrictHostKeyChecking=no '
'-o UserKnownHostsFile=/dev/null root@%s '
'tail -f /tmp/faft_log.txt' %], shell=True)
# Trigger the CgptState test logic on client side.
# TODO(waihong): Move the test items and logic in FAFT.
if self.faft_client.cgpt.run_test_loop():
self.not_finished = False
# Terminate the log-showing thread and prepare for reboot.
if show_client_log and show_client_log.poll() is None:
def setup(self, host=None):
super(firmware_CgptState, self).setup() = host
def cleanup(self):
super(firmware_CgptState, self).cleanup()
def run_once(self):
while self.not_finished:'======== Running CgptState test step %d ========',
self.faft_client.cgpt.get_test_step() + 1)
'userspace_action': self.run_test_step,
'reboot_action': self.full_power_off_and_on,