blob: cc111c33b63c2cf304e1c7d4443ff0b8990c35a4 [file] [log] [blame]
# Copyright (c) 2012 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.
import logging
from autotest_lib.client.bin import test, utils
from autotest_lib.client.common_lib import error
from autotest_lib.client.cros import service_stopper
class graphics_LibDRM(test.test):
version = 1
_services = None
def initialize(self):
self._services = service_stopper.ServiceStopper(['ui'])
def cleanup(self):
if self._services:
def run_once(self):
num_errors = 0
keyvals = {}
# These are tests to run for all platforms.
tests_common = ['modetest']
# Determine which tests to run based on the architecture type.
tests_intel = ['gem_basic', 'gem_flink', 'gem_mmap', 'gem_readwrite']
tests_exynos5 = ['kmstest']
arch_tests = { 'arm' : [],
'exynos5': tests_exynos5,
'i386' : tests_intel,
'x86_64' : tests_intel }
arch = utils.get_cpu_soc_family()
if not arch in arch_tests:
raise error.TestFail('Architecture "%s" not supported.', arch)
tests = tests_common + arch_tests[arch]
# If UI is running, we must stop it and restore later.
for test in tests:
# Make sure the test exists on this system. Not all tests may be
# present on a given system.
if utils.system('which %s' % test):
logging.error('Could not find test %s.', test)
keyvals[test] = 'NOT FOUND'
num_errors += 1
# Run the test and check for success based on return value.
return_value = utils.system(test)
if return_value:
logging.error('%s returned %d', test, return_value)
num_errors += 1
keyvals[test] = 'FAILED'
keyvals[test] = 'PASSED'
if num_errors > 0:
raise error.TestError('One or more libdrm tests failed.')