• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5from autotest_lib.client.common_lib import error
6from autotest_lib.server import test
7
8class platform_CloseOpenLid(test.test):
9    """Uses servo to send the host to sleep and wake back up.
10
11    Uses pwr_button and lid_open gpios in various combinations.
12    """
13    version = 1
14
15
16    def run_once(self, host):
17        # lid only
18        boot_id = host.get_boot_id()
19        host.servo.lid_close()
20        host.test_wait_for_shutdown()
21
22        host.servo.lid_open()
23        host.servo.pass_devmode()
24        host.test_wait_for_boot(boot_id)
25
26        # pwr_button and open lid
27        boot_id = host.get_boot_id()
28        host.servo.power_long_press()
29        if host.is_up():
30            raise error.TestError('DUT still up after long press power')
31
32        host.servo.lid_close()
33        host.servo.lid_open()
34        host.servo.pass_devmode()
35        host.test_wait_for_boot(boot_id)
36