Skip to content

Commit 32876f3

Browse files
committed
init_kill_services_test: reboot device first.
This test is killing critical device services, and if it runs repeatedly or some of the critical services have already died, it'll force the device to reboot again and potentially consider the test a failure. This forces the test to reboot first, so that it is in a fresh state and we can avoid this type of flake on the device. Bug: 153444614 Test: atest init_kill_services_test Change-Id: Ia81a319af1d209f58e70f824bb8eb7f11973637c
1 parent 73d44bb commit 32876f3

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

init/test_kill_services/Android.bp

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ cc_test {
33
srcs: ["init_kill_services_test.cpp"],
44
shared_libs: ["libbase"],
55
test_suites: ["general-tests"],
6-
require_root: true,
6+
7+
// TODO(b/153565474): switch back to auto-generation
8+
// and add back:
9+
// require_root: true,
10+
auto_gen_config: false,
711
}
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (C) 2020 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+
<configuration description="Runs init_kill_services_test.">
17+
<option name="test-suite-tag" value="apct" />
18+
<option name="test-suite-tag" value="apct-native" />
19+
20+
<!-- cannot be autogenerated: b/153565474 -->
21+
<target_preparer class="com.android.tradefed.targetprep.RebootTargetPreparer" />
22+
23+
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
24+
25+
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
26+
<option name="cleanup" value="true" />
27+
<option name="push" value="init_kill_services_test->/data/local/tmp/init_kill_services_test" />
28+
</target_preparer>
29+
30+
<test class="com.android.tradefed.testtype.GTest" >
31+
<option name="native-test-device-path" value="/data/local/tmp" />
32+
<option name="module-name" value="init_kill_services_test" />
33+
</test>
34+
</configuration>

0 commit comments

Comments
 (0)