# 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_ConfigurableCfmTestSanity.verifications" PURPOSE = "Verifies the configurable CfM test infra with a simple scenario" CRITERIA = "No errors occur" ATTRIBUTES = "suite:hotrod, suite:bluestreak-pre-cq" TIME = "SHORT" TEST_CATEGORY = "Functional" TEST_TYPE = "server" DEPENDENCIES="meet_app" DOC = """ Verifies that we can specify and run verification and assertion steps in a configurable CFM test. """ cfm_test = CfmTest( scenario=Scenario( AssertUsbDevices([ATRUS], lambda devices: True), RetryAssertAction( AssertFileDoesNotContain('/var/log/messages', ['FOOERRORBAR']), 5, 0.1), Sleep(0.1), AssertFileDoesNotContain('/var/log/eventlog.txt', ['FOOERRORBAR']), # Create some silly scenarios to be selected at random. The purpose # of this is only to test the SelectScenarioAtRandom action. # Since the predicate always return true for the assert actions # we do not actually verify the devices exist. SelectScenarioAtRandom(scenarios=[ Scenario(AssertUsbDevices([ATRUS], lambda devices: True), AssertFileDoesNotContain('/var/log/messages', ['FOOERRORBAR'])), Scenario(AssertUsbDevices([HUDDLY_GO], lambda devices: True)), Scenario(AssertUsbDevices([ATRUS], lambda devices: True))], run_times=3), AssertNoNewCrashes() ), configuration=Configuration( run_test_only = True ) ) def run_test(machine): job.run_test("enterprise_CFM_ConfigurableCfmTestSanity", cfm_test = cfm_test, tag = 'verifications', host = hosts.create_host(machine)) parallel_simple(run_test, machines)