xref: /aosp_15_r20/system/apex/apexd/ApexServiceTestCases.xml (revision 33f3758387333dbd2962d7edbd98681940d895da)
1*33f37583SAndroid Build Coastguard Worker<?xml version="1.0" encoding="utf-8"?>
2*33f37583SAndroid Build Coastguard Worker<!-- Copyright (C) 2018 The Android Open Source Project
3*33f37583SAndroid Build Coastguard Worker
4*33f37583SAndroid Build Coastguard Worker     Licensed under the Apache License, Version 2.0 (the "License");
5*33f37583SAndroid Build Coastguard Worker     you may not use this file except in compliance with the License.
6*33f37583SAndroid Build Coastguard Worker     You may obtain a copy of the License at
7*33f37583SAndroid Build Coastguard Worker
8*33f37583SAndroid Build Coastguard Worker          http://www.apache.org/licenses/LICENSE-2.0
9*33f37583SAndroid Build Coastguard Worker
10*33f37583SAndroid Build Coastguard Worker     Unless required by applicable law or agreed to in writing, software
11*33f37583SAndroid Build Coastguard Worker     distributed under the License is distributed on an "AS IS" BASIS,
12*33f37583SAndroid Build Coastguard Worker     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*33f37583SAndroid Build Coastguard Worker     See the License for the specific language governing permissions and
14*33f37583SAndroid Build Coastguard Worker     limitations under the License.
15*33f37583SAndroid Build Coastguard Worker-->
16*33f37583SAndroid Build Coastguard Worker<configuration description="Runs ApexServiceTestCases">
17*33f37583SAndroid Build Coastguard Worker    <option name="test-suite-tag" value="apct" />
18*33f37583SAndroid Build Coastguard Worker    <option name="test-suite-tag" value="apct-native" />
19*33f37583SAndroid Build Coastguard Worker    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
20*33f37583SAndroid Build Coastguard Worker        <option name="cleanup" value="true" />
21*33f37583SAndroid Build Coastguard Worker        <!-- Note: despite how this line reads, it will push the complete testcase directory, thus
22*33f37583SAndroid Build Coastguard Worker                   all apexes that are required by the blueprint's data[] tag. -->
23*33f37583SAndroid Build Coastguard Worker        <option name="push" value="ApexServiceTestCases->/data/local/tmp/ApexServiceTestCases" />
24*33f37583SAndroid Build Coastguard Worker    </target_preparer>
25*33f37583SAndroid Build Coastguard Worker
26*33f37583SAndroid Build Coastguard Worker    <!-- The test runs as root to prepare the temporary directory, make selinux adjustments
27*33f37583SAndroid Build Coastguard Worker         and so on to provide files that apexd can consume. This is done to avoid dependencies
28*33f37583SAndroid Build Coastguard Worker         on higher levels (e.g., PackageInstaller). -->
29*33f37583SAndroid Build Coastguard Worker    <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
30*33f37583SAndroid Build Coastguard Worker
31*33f37583SAndroid Build Coastguard Worker    <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
32*33f37583SAndroid Build Coastguard Worker      <option name="cleanup" value="true" />
33*33f37583SAndroid Build Coastguard Worker      <option name="remount-system" value="true" />
34*33f37583SAndroid Build Coastguard Worker      <option name="push" value="apex.apexd_test.apex->/system_ext/apex/apex.apexd_test.apex" />
35*33f37583SAndroid Build Coastguard Worker      <option name="push" value="apex.apexd_test_different_app.apex->/system_ext/apex/apex.apexd_test_different_app.apex" />
36*33f37583SAndroid Build Coastguard Worker    </target_preparer>
37*33f37583SAndroid Build Coastguard Worker
38*33f37583SAndroid Build Coastguard Worker    <!-- system_server might still hold a reference to apexservice. This means that apexd is still
39*33f37583SAndroid Build Coastguard Worker         running, and test apexes pushed in the PushFilePreparer above are not yet scanned.
40*33f37583SAndroid Build Coastguard Worker         One way to solve this is to reboot a device, but that would significantly increase
41*33f37583SAndroid Build Coastguard Worker         execution of this test module. Instead, force a GC in system_server by sending kill -10. -->
42*33f37583SAndroid Build Coastguard Worker    <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
43*33f37583SAndroid Build Coastguard Worker      <option name="run-command" value="shell kill -10 $(pidof system_server)" />
44*33f37583SAndroid Build Coastguard Worker      <option name="teardown-command" value="shell kill -10 $(pidof system_server)" />
45*33f37583SAndroid Build Coastguard Worker    </target_preparer>
46*33f37583SAndroid Build Coastguard Worker
47*33f37583SAndroid Build Coastguard Worker    <test class="com.android.tradefed.testtype.GTest" >
48*33f37583SAndroid Build Coastguard Worker        <!-- Note: despite how these lines read, the test will run nicely separated out
49*33f37583SAndroid Build Coastguard Worker                   of a subfolder. -->
50*33f37583SAndroid Build Coastguard Worker        <option name="native-test-device-path" value="/data/local/tmp" />
51*33f37583SAndroid Build Coastguard Worker        <option name="module-name" value="ApexServiceTestCases" />
52*33f37583SAndroid Build Coastguard Worker    </test>
53*33f37583SAndroid Build Coastguard Worker</configuration>
54