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 from vts.testcases.kernel.ltp import ltp_enums
     18 from vts.testcases.kernel.ltp import ltp_configs
     19 from vts.testcases.kernel.ltp.shell_environment.definitions import directory_exists
     20 from vts.testcases.kernel.ltp.shell_environment.definitions import loop_device_support
     21 from vts.testcases.kernel.ltp.shell_environment.definitions import path_permission
     22 from vts.testcases.kernel.ltp.shell_environment.definitions import bin_in_path
     23 
     24 
     25 def GetRequrementDefinitions():
     26     """Get requirement definition objects.
     27 
     28     Get a dictionary in which keys are requirement names and
     29     values are corresponding definition class object or a list
     30     of such objects.
     31     """
     32     return {
     33         ltp_enums.Requirements.LOOP_DEVICE_SUPPORT:
     34             loop_device_support.LoopDeviceSupport(),
     35         ltp_enums.Requirements.LTP_TMP_DIR: [
     36             directory_exists.DirectoryExists(
     37                 paths=[ltp_configs.TMP, ltp_configs.TMPBASE,
     38                        ltp_configs.LTPTMP, ltp_configs.TMPDIR],
     39                 to_check=False,
     40                 to_setup=True,
     41                 to_cleanup=True), path_permission.PathPermission(
     42                     paths=[ltp_configs.TMP, ltp_configs.TMPBASE,
     43                            ltp_configs.LTPTMP, ltp_configs.TMPDIR],
     44                     permissions=775,
     45                     to_check=False,
     46                     to_setup=True,
     47                     to_cleanup=False)
     48         ],
     49         ltp_enums.Requirements.BIN_IN_PATH_LDD:
     50             bin_in_path.BinInPath(paths='ldd'),
     51     }
     52