xref: /aosp_15_r20/external/linux-kselftest/android/kselftest_template.xml (revision 053f45be4e351dfd5e965df293cd45b779f579ee)
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 ktest_dir "/data/local/tmp/{MODULE}">
15]>
16<configuration description="Configuration for {MODULE} test">
17    <option name="test-suite-tag" value="vts" />
18    <option name="config-descriptor:metadata" key="component" value="kselftests" />
19
20    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
21    <target_preparer class="com.android.tradefed.targetprep.StopServicesSetup" />
22
23    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
24        <option name="cleanup" value="true" />
25        <option name="push-file" key="{MODULE}" value="&ktest_dir;" />
26        <option name="post-push" value='chmod -R 755 &ktest_dir;; find &ktest_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?" || echo "There were no files to process"' />
27    </target_preparer>
28
29    <test class="com.android.tradefed.testtype.binary.KernelTargetTest" >
30        <option name="exit-code-skip" value="4" />
31        <option name="skip-binary-check" value="true" />
32        <option name="abort-if-device-lost" value="true" />
33        <option name="abort-if-root-lost" value="true" />
34        <option name="test-command-line" key="{MODULE}" value='if [ -d &ktest_dir;/*/. ]; then cd &ktest_dir;/*/.; ./{MODULE}; else echo "{MODULE} skipped"; exit 4; fi' />
35    </test>
36</configuration>
37
38