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
18class RequirementState(object):
19    """Enum for test case requirement check state.
20
21    Attributes:
22        UNCHECKED: test case requirement has not been checked
23        SATISFIED: all the requirements are satisfied
24        UNSATISFIED: some of the requirements are not satisfied. Test case will
25                     not be executed
26    """
27    UNCHECKED = 0
28    SATISFIED = 2
29    UNSATISFIED = 3
30
31
32class ConfigKeys(object):
33    RUN_STAGING = "run_staging"
34    RUN_32BIT = "run_32bit"
35    RUN_64BIT = "run_64bit"
36    LTP_NUMBER_OF_THREADS = "ltp_number_of_threads"
37
38
39class ShellEnvKeys(object):
40    """Shell env keys to run LTP (Linux Test Project) testcases.
41
42    Contains constant strings starting with prefix "_KEY_ENV_" are used as dict
43        key in environment variable dictionary
44    """
45    TMP = 'TMP'
46    TMPBASE = 'TMPBASE'
47    LTPTMP = 'LTPTMP'
48    TMPDIR = 'TMPDIR'
49    LTP_DEV_FS_TYPE = 'LTP_DEV_FS_TYPE'
50    LTPROOT = 'LTPROOT'
51    PATH = 'PATH'
52
53
54class Delimiters(object):
55    TESTCASE_FILTER = ','
56    TESTCASE_DEFINITION = '\t'
57
58
59class TestExitCode(object):
60    """Exit return codes of LTP test case binary
61
62    Attributes:
63        TPASS: int, exit_code for Test pass
64        TCONF: int, the test case is not for current configuration of kernel
65        TBROK: int, test assumption failed, such as missing system binary and
66               and permission issue not explicitly checked by the test case.
67        SEGFAULT: int, test case results in segmentation fault
68    """
69    TPASS = 0
70    TCONF = 32
71    TBROK = 2
72    SEGFAULT = 139
73
74
75class Requirements(object):
76    """Enum for all ltp requirements"""
77    LOOP_DEVICE_SUPPORT = 1
78    LTP_TMP_DIR = 2
79    BIN_IN_PATH_LDD = 3
80