Home | History | Annotate | Download | only in enterprise_CFM_ConfigurableCfmTestSanity
      1 # Copyright 2017 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 from autotest_lib.server.cros.cfm.configurable_test.dsl import *
      5 from autotest_lib.server import utils
      6 
      7 AUTHOR = "kerl (a] google.com, chromeos-meetings (a] google.com"
      8 NAME = "enterprise_CFM_ConfigurableCfmTestSanity.verifications"
      9 PURPOSE = "Verifies the configurable CfM test infra with a simple scenario"
     10 CRITERIA = "No errors occur"
     11 ATTRIBUTES = "suite:bluestreak-perbuild, suite:bluestreak-pre-cq"
     12 TIME = "SHORT"
     13 TEST_CATEGORY = "Functional"
     14 TEST_TYPE = "server"
     15 DEPENDENCIES="meet_app"
     16 
     17 DOC = """
     18 Verifies that we can specify and run verification and assertion steps in a
     19 configurable CFM test.
     20 """
     21 
     22 cfm_test = CfmTest(
     23     scenario=Scenario(
     24         AssertUsbDevices([ATRUS], lambda devices: True),
     25         RetryAssertAction(
     26             AssertFileDoesNotContain('/var/log/messages', ['FOOERRORBAR']),
     27             5,
     28             0.1),
     29         Sleep(0.1),
     30         AssertFileDoesNotContain('/var/log/eventlog.txt', ['FOOERRORBAR']),
     31         # Create some silly scenarios to be selected at random. The purpose
     32         # of this is only to test the SelectScenarioAtRandom action.
     33         # Since the predicate always return true for the assert actions
     34         # we do not actually verify the devices exist.
     35         SelectScenarioAtRandom(scenarios=[
     36                 Scenario(AssertUsbDevices([ATRUS], lambda devices: True),
     37                     AssertFileDoesNotContain('/var/log/messages',
     38                                              ['FOOERRORBAR'])),
     39                 Scenario(AssertUsbDevices([HUDDLY_GO], lambda devices: True)),
     40                 Scenario(AssertUsbDevices([ATRUS], lambda devices: True))],
     41             run_times=3),
     42         AssertNoNewCrashes()
     43     ),
     44 
     45     configuration=Configuration(
     46         run_test_only = True
     47     )
     48 )
     49 
     50 args_dict = utils.args_to_dict(args)
     51 servo_args = hosts.CrosHost.get_servo_arguments(args_dict)
     52 def run_test(machine):
     53     job.run_test("enterprise_CFM_ConfigurableCfmTestSanity",
     54                  cfm_test = cfm_test,
     55                  tag = 'verifications',
     56                  host = hosts.create_host(machine, servo_args=servo_args))
     57 
     58 
     59 parallel_simple(run_test, machines)
     60