# Copyright (c) 2014 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.

from autotest_lib.server import utils

AUTHOR = "Chrome OS Team"
NAME = "power_BrightnessResetAfterReboot"
PURPOSE = "default brightness test."
CRITERIA = "This test will fail if unable to set the default brightness after reboot."
TIME = "SHORT"
TEST_CATEGORY = "Functional"
TEST_CLASS = "power"
TEST_TYPE = "server"
ATTRIBUTES = "suite:bvt-perbuild, suite:partners"
REQUIRE_SSP = False

DOC = """
This test:
1. Checks for the default brightness after initial boot.
2. Changes the birghtness level to min (0%) and max (100%).
3. Checks for the brightness level after rebooting the device.

The test fails if:
-Device not able to change brightness to min and max levels.
-Device not able to set the brightness level to default after reboot.

Example usage:
test_that -b <board> <host> power_BrightnessResetAfterReboot
"""

def run(machine):
    host = hosts.create_host(machine)
    job.run_test("power_BrightnessResetAfterReboot", host=host,
                 disable_sysinfo=True, client_autotest="desktopui_SimpleLogin")

parallel_simple(run, machines)