1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2020 The Android Open Source Project
3     Licensed under the Apache License, Version 2.0 (the "License");
4     you may not use this file except in compliance with the License.
5     You may obtain a copy of the License at
6          http://www.apache.org/licenses/LICENSE-2.0
7     Unless required by applicable law or agreed to in writing, software
8     distributed under the License is distributed on an "AS IS" BASIS,
9     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10     See the License for the specific language governing permissions and
11     limitations under the License.
12-->
13<!DOCTYPE configuration [
14<!ENTITY ltp_dir "/data/local/tmp/{MODULE}">
15<!ENTITY ltp_env "export LTPROOT=/data/local/tmp/{MODULE}/{target} LTP_DEV_FS_TYPE=ext4; export PATH=/system/bin:$LTPROOT TMP=$LTPROOT/tmp; export TMPBASE=$TMP/tmpbase LTPTMP=$TMP/ltptemp TMPDIR=$TMP/tmpdir">
16]>
17<configuration description="Runs vts_ltp_test.">
18    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
19    <target_preparer class="com.android.tradefed.targetprep.StopServicesSetup"/>
20
21    <object type="module_controller" class="com.android.tradefed.testtype.suite.module.KernelTestModuleController" >
22{module_controller_option}
23    </object>
24
25    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
26        <option name="cleanup" value="true" />
27        <option name="push-file" key="{MODULE}" value="&ltp_dir;" />
28        <option name="post-push" value='chmod -R 755 &ltp_dir;;  find &ltp_dir; -type f | xargs grep -l -e "bin/sh" -e "bin/bash" | xargs sed -i -e "s?/bin/echo?echo?" -i -e "s?#!/bin/sh?#!/system/bin/sh?" -i -e "s?#!/bin/bash?#!/system/bin/sh?" -i -e "s?bs=1M?#bs=1m?"' />
29    </target_preparer>
30
31    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
32        <option name="run-command" value='&ltp_env;; mkdir -p $LTPROOT/testcases/bin/data; mkdir -p $TMP; mkdir -p $TMPBASE; mkdir -p $LTPTMP; mkdir -p $TMPDIR; chmod -R 777 $TMP; restorecon -F -R $LTPROOT' />
33        <option name="teardown-command" value="rm -rf &ltp_dir;/{target}/tmp" />
34    </target_preparer>
35
36    <!-- Mandatory tests (must pass and cannot skip). -->
37    <test class="com.android.tradefed.testtype.binary.KernelTargetTest">
38        <option name="skip-binary-check" value="true" />
39        <option name="abort-if-device-lost" value="true" />
40        <option name="abort-if-root-lost" value="true" />
41        <!-- Set binary timeout to be 18 min which is greater than the default 5 min timeout. Otherwise TF will retry to the command and attempt to do device recovery. -->
42        <option name="per-binary-timeout" value="1080000" />
43{mandatory_test_cases}
44    </test>
45
46    <test class="com.android.tradefed.testtype.binary.KernelTargetTest">
47        <!-- Identify LTP's TCONF code (incompatible configuration) as a skip. -->
48        <option name="exit-code-skip" value="32" />
49        <option name="skip-binary-check" value="true" />
50        <option name="abort-if-device-lost" value="true" />
51        <option name="abort-if-root-lost" value="true" />
52        <!-- Set binary timeout to be 18 min which is greater than the default 5 min timeout. Otherwise TF will retry to the command and attempt to do device recovery. -->
53        <option name="per-binary-timeout" value="1080000" />
54{skippable_test_cases}
55    </test>
56
57</configuration>
58