blob: be782d8b7c5c74739b815954ca62871829ccb4c6 [file] [log] [blame]
# Copyright (c) 2012 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 time
from autotest_lib.client.common_lib import error
from autotest_lib.server import test
class platform_LongPressPower(test.test):
"""Uses servo pwr_button gpio to power the host off and back on.
"""
version = 1
def run_once(self, host):
boot_id = host.get_boot_id()
# turn off device
host.servo.power_long_press()
# ensure host is now off
if host.is_up():
raise error.TestError('DUT still up after long press power')
# ensure host boots
host.servo.boot_devmode()
host.test_wait_for_boot(boot_id)