Home | History | Annotate | Download | only in ltp
      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 
     17 import os
     18 
     19 from vts.utils.python.os import path_utils
     20 
     21 from vts.testcases.kernel.ltp import ltp_enums
     22 
     23 VTS_LTP_OUTPUT = os.path.join('DATA', 'nativetest', 'ltp')
     24 LTP_RUNTEST_DIR = os.path.join(VTS_LTP_OUTPUT, 'runtest')
     25 LTP_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
     30 LTPDIR = '/data/local/tmp/ltp'
     31 # Directory for environment variable 'TMP' needed by some test cases
     32 TMP = path_utils.JoinTargetPath(LTPDIR, 'tmp')
     33 # Directory for environment variable 'TMPBASE' needed by some test cases
     34 TMPBASE = path_utils.JoinTargetPath(TMP, 'tmpbase')
     35 # Directory for environment variable 'LTPTMP' needed by some test cases
     36 LTPTMP = path_utils.JoinTargetPath(TMP, 'ltptemp')
     37 # Directory for environment variable 'TMPDIR' needed by some test cases
     38 TMPDIR = path_utils.JoinTargetPath(TMP, 'tmpdir')
     39 # Path where ltp test binary exists
     40 LTPBINPATH = path_utils.JoinTargetPath(LTPDIR, 'testcases', 'bin')
     41 # Add LTP's binary path to PATH
     42 PATH = '/system/bin:%s' % LTPBINPATH
     43 
     44 # Default number of threads to run LTP tests. Zero means matching to number
     45 # of CPU threads
     46 DEFAULT_NUMBER_OF_THREADS = 0
     47 
     48 # File system type for loop device
     49 LTP_DEV_FS_TYPE = 'ext4'
     50 
     51 # File name suffix for low memory scenario group scripts
     52 LOW_MEMORY_SCENARIO_GROUP_SUFFIX = '_low_mem'
     53 
     54 # Binaries required by LTP test cases that should exist in PATH
     55 INTERNAL_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
     66 INTERNAL_SHELL_COMMANDS = [
     67     'export',
     68     'cd',
     69 ]
     70 
     71 # Requirement to testcase dictionary.
     72 REQUIREMENTS_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
    109 REQUIREMENT_FOR_ALL = [ltp_enums.Requirements.LTP_TMP_DIR]
    110 
    111 # Requirement to test suite dictionary
    112 REQUIREMENT_TO_TESTSUITE = {}
    113 
    114 # List of LTP test suites to run
    115 TEST_SUITES = [
    116     'admin_tools',
    117     'can',
    118     'cap_bounds',
    119     'commands',
    120     'connectors',
    121     'containers',
    122 #     'controllers',
    123     'cpuhotplug',
    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     'modules',
    141     'nptl',
    142     'numa',
    143     'pipes',
    144     'power_management_tests',
    145     'pty',
    146     'sched',
    147     'syscalls',
    148     'timers',
    149     # The following are not included in default LTP scenario group
    150     'securebits',
    151     'tracing',
    152 ]
    153 
    154 # List of LTP test suites to run
    155 TEST_SUITES_LOW_MEM = [
    156     'admin_tools',
    157     'can',
    158     'cap_bounds',
    159     'commands',
    160     'connectors',
    161     'containers',
    162 #     'controllers',
    163     'cpuhotplug',
    164     'dio',
    165     'fcntl-locktests_android',
    166     'filecaps',
    167     'fs',
    168     'fs_bind',
    169     'fs_ext4',
    170     'fs_perms_simple',
    171     'fsx',
    172     'hugetlb',
    173     'hyperthreading',
    174     'input',
    175     'io',
    176     'ipc',
    177     'kernel_misc',
    178     'math',
    179     'mm',
    180     'modules',
    181     'nptl',
    182     'numa',
    183     'pipes',
    184     'power_management_tests',
    185     'pty',
    186     'sched_low_mem',
    187     'syscalls',
    188     'timers',
    189     # The following are not included in default LTP scenario group
    190     'securebits',
    191     'tracing',
    192 ]
    193 
    194 # List of LTP test suites that will not run in multi-thread mode
    195 TEST_SUITES_REQUIRE_SINGLE_THREAD_MODE = [
    196     'admin_tools',
    197     'can',
    198     'cap_bounds',
    199     'commands',
    200     'connectors',
    201     'containers',
    202     'controllers',
    203     'cpuhotplug',
    204     'dio',
    205     'fcntl-locktests_android',
    206     'filecaps',
    207     'fs',
    208     'fs_bind',
    209     'fs_ext4',
    210     'fs_perms_simple',
    211     'fsx',
    212     'hugetlb',
    213     'hyperthreading',
    214     'input',
    215     'io',
    216     'ipc',
    217     'kernel_misc',
    218     'math',
    219     'mm',
    220     'modules',
    221     'nptl',
    222     'numa',
    223     'pipes',
    224     'power_management_tests',
    225     'pty',
    226     'sched',
    227     'sched_low_mem',
    228     'syscalls',
    229     'timers',
    230     'securebits',
    231     'tracing',
    232 ]
    233