<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2024 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<configuration description="Config for {MODULE}">
    <option name="test-suite-tag" value="kernel_tests"/>
    <option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />

    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
        <option name="run-command" value="mkdir -p /data/igt_tests" />
    </target_preparer>

    <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
        <option name="cleanup" value="true" />
        <option name="append-bitness" value="false" />
        <option name="push" value="{MODULE}->/data/igt_tests/" />
        <option name="push-file" key="setup_vkms_connectors_for_atest" value="/data/local/tmp/setup_vkms_connectors_for_atest"/>
        <option name="push-file" key="teardown_vkms" value="/data/local/tmp/teardown_vkms"/>
    </target_preparer>

    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
        <!-- Create symlinks to flatten the directory structure, removing the architecture subdir-->
        <option name="run-command" value="find /data/igt_tests -mindepth 2 -type f -exec ln -sf {} /data/igt_tests/ \;" />
        <option name="run-command" value="stop"/>
        <option name="run-command" value="stop vendor.hwcomposer-3" />
        <!-- If we're running on an AVD (product name includes "cf_"), setup VKMS with an eDP + 1DP + 1HDMI -->
        <option name="run-command" value="getprop ro.product.name | grep -q 'cf_' &amp;&amp; /data/local/tmp/setup_vkms_connectors_for_atest --config eDP,0,REDRIX DP,1,HP_Spectre32_4K_DP HDMIA,2,ACI_9155_ASUS_VH238_HDMI" />
        <option name="teardown-command" value="getprop ro.product.name | grep -q 'cf_' &amp;&amp; /data/local/tmp/teardown_vkms"/>
        <option name="teardown-command" value="start vendor.hwcomposer-3" />
        <option name="teardown-command" value="start"/>
    </target_preparer>

    <test class="com.android.tradefed.testtype.GTest">
        <option name="native-test-device-path" value="/data/igt_tests" />
        <option name="module-name" value="{MODULE}" />
        <option name="native-test-timeout" value="1800000"/>
    </test>

</configuration>