1# 2# Copyright (C) 2016 The Android Open Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the 'License'); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an 'AS IS' BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16 17import os 18 19from vts.utils.python.os import path_utils 20 21from vts.testcases.kernel.ltp import ltp_enums 22 23VTS_LTP_OUTPUT = os.path.join('DATA', 'nativetest', 'ltp') 24LTP_RUNTEST_DIR = os.path.join(VTS_LTP_OUTPUT, 'runtest') 25LTP_DISABLED_BUILD_TESTS_CONFIG_PATH = os.path.join(VTS_LTP_OUTPUT, 26 'disabled_tests.txt') 27 28# Environment paths for ltp test cases 29# string, ltp build root directory on target 30LTPDIR = '/data/local/tmp/ltp' 31# Directory for environment variable 'TMP' needed by some test cases 32TMP = path_utils.JoinTargetPath(LTPDIR, 'tmp') 33# Directory for environment variable 'TMPBASE' needed by some test cases 34TMPBASE = path_utils.JoinTargetPath(TMP, 'tmpbase') 35# Directory for environment variable 'LTPTMP' needed by some test cases 36LTPTMP = path_utils.JoinTargetPath(TMP, 'ltptemp') 37# Directory for environment variable 'TMPDIR' needed by some test cases 38TMPDIR = path_utils.JoinTargetPath(TMP, 'tmpdir') 39# Path where ltp test binary exists 40LTPBINPATH = path_utils.JoinTargetPath(LTPDIR, 'testcases', 'bin') 41# Add LTP's binary path to PATH 42PATH = '/system/bin:%s' % LTPBINPATH 43 44# Default number of threads to run LTP tests. Zero means matching to number 45# of CPU threads 46DEFAULT_NUMBER_OF_THREADS = 1 47 48# File system type for loop device 49LTP_DEV_FS_TYPE = 'ext4' 50 51# File name suffix for low memory scenario group scripts 52LOW_MEMORY_SCENARIO_GROUP_SUFFIX = '_low_mem' 53 54# Binaries required by LTP test cases that should exist in PATH 55INTERNAL_BINS = [ 56 'mktemp', 57 'cp', 58 'chmod', 59 'chown', 60 'ls', 61 'mkfifo', 62 'ldd', 63] 64 65# Internal shell command required by some LTP test cases 66INTERNAL_SHELL_COMMANDS = [ 67 'export', 68 'cd', 69] 70 71# Requirement to testcase dictionary. 72REQUIREMENTS_TO_TESTCASE = { 73 ltp_enums.Requirements.LOOP_DEVICE_SUPPORT: [ 74 'syscalls.mount01', 75 'syscalls.fchmod06', 76 'syscalls.ftruncate04', 77 'syscalls.ftruncate04_64', 78 'syscalls.inotify03', 79 'syscalls.link08', 80 'syscalls.linkat02', 81 'syscalls.mkdir03', 82 'syscalls.mkdirat02', 83 'syscalls.mknod07', 84 'syscalls.mknodat02', 85 'syscalls.mmap16', 86 'syscalls.mount01', 87 'syscalls.mount02', 88 'syscalls.mount03', 89 'syscalls.mount04', 90 'syscalls.mount06', 91 'syscalls.rename11', 92 'syscalls.renameat01', 93 'syscalls.rmdir02', 94 'syscalls.umount01', 95 'syscalls.umount02', 96 'syscalls.umount03', 97 'syscalls.umount2_01', 98 'syscalls.umount2_02', 99 'syscalls.umount2_03', 100 'syscalls.utime06', 101 'syscalls.utimes01', 102 'syscalls.mkfs01', 103 'fs.quota_remount_test01', 104 ], 105 ltp_enums.Requirements.BIN_IN_PATH_LDD: ['commands.ldd'], 106} 107 108# Requirement for all test cases 109REQUIREMENT_FOR_ALL = [ltp_enums.Requirements.LTP_TMP_DIR] 110 111# Requirement to test suite dictionary 112REQUIREMENT_TO_TESTSUITE = {} 113 114# List of LTP test suites to run 115TEST_SUITES = [ 116 'can', 117 'cap_bounds', 118 'commands', 119 'connectors', 120 'containers', 121 'controllers', 122 'cpuhotplug', 123 'cve', 124 'dio', 125 'fcntl-locktests_android', 126 'filecaps', 127 'fs', 128 'fs_bind', 129 'fs_ext4', 130 'fs_perms_simple', 131 'fsx', 132 'hugetlb', 133 'hyperthreading', 134 'input', 135 'io', 136 'ipc', 137 'kernel_misc', 138 'math', 139 'mm', 140 'nptl', 141 'power_management_tests', 142 'pty', 143 'sched', 144 'securebits', 145 'syscalls', 146 'timers', 147 'tracing', 148] 149 150# List of LTP test suites to run 151TEST_SUITES_LOW_MEM = [ 152 'can', 153 'cap_bounds', 154 'commands', 155 'connectors', 156 'containers', 157 'cpuhotplug', 158 'cve', 159 'dio', 160 'fcntl-locktests_android', 161 'filecaps', 162 'fs', 163 'fs_bind', 164 'fs_ext4', 165 'fs_perms_simple', 166 'fsx', 167 'hugetlb', 168 'hyperthreading', 169 'input', 170 'io', 171 'ipc', 172 'kernel_misc', 173 'math', 174 'mm', 175 'nptl', 176 'power_management_tests', 177 'pty', 178 'sched_low_mem', 179 'securebits', 180 'syscalls', 181 'timers', 182 'tracing', 183] 184 185# List of LTP test suites that will not run in multi-thread mode 186TEST_SUITES_REQUIRE_SINGLE_THREAD_MODE = [ 187 'dio', 188 'io', 189 'mm', 190 'timers', 191] 192