| # Copyright 2017 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.cros.cfm.configurable_test.dsl import * |
| from autotest_lib.server import utils |
| |
| AUTHOR = "kerl@google.com, chromeos-meetings@google.com" |
| NAME = "enterprise_CFM_LowLevelPeripheralTest.atrus_power_cycle_stress" |
| PURPOSE = "Stresses an Atrus device by repeatedly power cycling its USB port." |
| CRITERIA = ("Atrus detectable as a USB device after each cycle " |
| "and no crash files appear") |
| ATTRIBUTES = "suite:hotrod-remora" |
| TIME = "MEDIUM" |
| TEST_CATEGORY = "Stress" |
| TEST_TYPE = "server" |
| DEPENDENCIES="atrus" |
| |
| DOC = """ |
| Repeatedly power cycle the connected Atrus and verify it appears |
| as a USB device after each cycle. Verifies that no new crash files |
| appear. |
| """ |
| |
| cfm_test = CfmTest( |
| configuration=Configuration(skip_enrollment=True), |
| scenario=Scenario( |
| AssertUsbDevices([ATRUS]), |
| RepeatTimes(10, Scenario( |
| # Atruses take a while to boot, often close to 10 seconds. |
| # Increase the timeout to 30 to ensure we give it enough time. |
| PowerCycleUsbPort([ATRUS], wait_for_change_timeout=30), |
| AssertNoNewCrashes() |
| )) |
| ), |
| ) |
| |
| def run_test(machine): |
| job.run_test("enterprise_CFM_LowLevelPeripheralTest", |
| cfm_test = cfm_test, |
| tag = 'atrus_power_cycle_stress', |
| host = hosts.create_host(machine)) |
| |
| |
| parallel_simple(run_test, machines) |