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 5from autotest_lib.server import utils 6 7AUTHOR = "mzhuo@chromium.org" 8NAME = "enterprise_CFM_Test.demo" 9TIME = "LONG" 10TEST_CATEGORY = "Functional" 11TEST_CLASS = "enterprise" 12TEST_TYPE = "server" 13DEPENDENCIES = "" 14JOB_RETRIES = 1 15 16DOC = """ 17This test runs various tests and verifications for CfM devices. 18Tests and verifications can be selected in control file. 19action_list defines the list of all available tests, which are keys for dict 20action_list, value for the key defines how many times this test will be run 21in each loop. 22verification_list defineds the list of all available verifications, 23which are keys for dict verification_list. True means this verification specified 24by this key will be performed. 25Testing flow can be set in control file. 26 27Example to run it: 28test_that --autotest_dir ~/trunk/src/third_party/autotest/files/ --board=guado 29100.123.174.2 enterprise_CFM_Testd.demo 30 31Note: 321. Modify dict error_key_words to meet each test's need. 332. Modify meeting code which works for domain device is enrolled in. 34""" 35 36args_dict = utils.args_to_dict(args) 37 38error_key_words = {'usb': [ 39 'unable to enumerate USB device', 40 'hub_port_status failed', 41 'Device not responding to setup address', 42 'device not accepting address' 43 ], 44 'kernel': [ 45 'stuck on bsd ring', 46 'stuck on render ring', 47 'GPU crash dump saved to', 48 'ERROR Transfer event TRB DMA ptr', 49 'crashes with segfault', 50 'segfault at', 51 'Out of memory: Kill process', 52 'Killed process' 53 ], 54 'video': [ 55 'uvcvideo: Failed to set UVC commit control', 56 'uvcvideo: UVC non compliance', 57 'No streaming interface found' 58 ], 59 'audio': [ 60 'hw_params: Input/output error: rate:', 61 'usb_set_interface failed', 62 ], 63 'chrome': [ 64 'segfault at', 65 'Watchdog resetting firmware', 66 'Failed to create scanout buffer', 67 'Failed to enable controller', 68 'Failed to export buffer to dma_buf', 69 'Failed to take control of the display', 70 'Failed to modeset controller', 71 'Failed to encode frame.' 72 ], 73 'atrus': [ 74 'write: Connection timed out', 75 'Error: report failed', 76 'write: Broken pipe', 77 'protocol error' 78 ], 79 'usb_stability': [ 80 'USB disconnect', 81 'New USB device found' 82 ] 83} 84 85 86# !!! Please change meeting code working for CfM. 87# !!! If meeting_code for different domain is used, meeting might be timeout. 88# vol_change_mode: if set to 1, make one call to set voluem to target volume, 89# else, make multiple calls to update volume until volume 90# equals to target volume. 91test_config = { 92 'gpio_list': ['218','219', '209'], 93 'gpiopause': 8, 94 'puts': "", 95 'is_meeting': 1, 96 'meeting_code': 'otg-dkps-ovj', # this works for crosprq4.com 97 'repeat': 2, 98 'rebeot_timeout': 60, 99 'loop_timeout': 30, 100 'action_timeout': 20, 101 'min_timeout': 10, 102 'debug_timeout': 5, 103 'vol_change_step': 6, 104 'vol_change_mode': 1, 105 'reboot_after_min_meets': 1, 106 'gpio_after_min_meets': 1 107} 108 109#action_config['meeting_test'] should be 0, 1. 110# 0: no meeting test to be done 111# 1: In each loop first CfM joins meeting, after all tests are done, 112# CfM leaves meeting. 113#the value of 'mute_unmute_camera_test', 'mute_unmute_mic_test' and 114#'speaker_volume_test" and etc is number of test for each key to be done in 115#one meeting. 116action_config = { 117 'meeting_test': 1, 118 'mute_unmute_camera_test': 1, 119 'mute_unmute_mic_test': 1, 120 'speaker_volume_test': 1, 121 'gpio_test': 0, 122 'reboot_test': 0, 123 'reset_usb_test': 0, 124 'flap_monitor_test': 0 125} 126 127 128verification_config = { 129 'check_usb_enumeration':True, 130 'check_usb_inf_init': True, 131 'check_v4l2_interface': True, 132 'check_audio_card': False, 133 'check_cras_speaker': True, 134 'check_cras_mic': True, 135 'check_cras_pspeaker': True, 136 'check_cras_pmic': True, 137 'check_cras_speaker_vol': True, 138 'check_cras_mic_mute': True, 139 'check_prefer_camera': False, 140 'check_camera_mute': False, 141 'check_audio_stream': True, 142 'check_video_stream': True, 143 'check_hotrod_speaker': False, 144 'check_hotrod_mic': False, 145 'check_hotrod_camera': False, 146 'check_hotrod_pspeaker': False, 147 'check_hotrod_pmic': False, 148 'check_hotrod_pcamera': False, 149 'check_hotrod_speaker_vol': False, 150 'check_hotrod_mic_state': False, 151 'check_hotrod_camera_state': False, 152 'check_usb_errorlog': False, 153 'check_kernel_errorlog': False, 154 'check_video_errorlog': False, 155 'check_audio_errorlog': False, 156 'check_chrome_errorlog': False, 157 'check_atrus_errorlog': False, 158 'check_usb_stability': False, 159 'check_process_crash': True, 160 'check_kernel_panic': False, 161 'check_chrome_restarted': True, 162 'check_cfm_rebooted': True 163} 164 165 166test_flow_control = { 167 'reboot_before_start': False, 168 'run_test_only': True, 169 'setup_cleanup': True, 170 'abort_on_failure': True, 171 'random_mode': True, 172 'recovery_on_fatal_failure': True, 173 'skip_cfm_check': True, 174 'report': True 175} 176 177def run_test(machine): 178 host = hosts.create_host(machine) 179 run_test_only = test_flow_control['run_test_only'] 180 job.run_test('enterprise_CFM_Test', host=host, 181 run_test_only=run_test_only, 182 test_config=test_config, action_config=action_config, 183 verification_config=verification_config, 184 error_key_words=error_key_words, 185 test_flow_control=test_flow_control, 186 tag='demo') 187 188 189parallel_simple(run_test, machines) 190