Merge changes from topic "b/262254794" into tm-dev

* changes:
  Cleanup after test suite split.
  Moving PackageManagerServiceTests to their own suite.
This commit is contained in:
Patrick Baumann
2022-12-20 17:03:41 +00:00
committed by Android (Google) Code Review
191 changed files with 533 additions and 72 deletions

View File

@@ -15,6 +15,22 @@
] ]
} }
], ],
"presubmit-pm": [
{
"name": "PackageManagerServiceServerTests",
"options": [
{
"include-annotation": "android.platform.test.annotations.Presubmit"
},
{
"exclude-annotation": "androidx.test.filters.FlakyTest"
},
{
"exclude-annotation": "org.junit.Ignore"
}
]
}
],
"presubmit": [ "presubmit": [
{ {
"name": "ManagedProvisioningTests", "name": "ManagedProvisioningTests",
@@ -167,6 +183,20 @@
"exclude-annotation": "org.junit.Ignore" "exclude-annotation": "org.junit.Ignore"
} }
] ]
},
{
"name": "PackageManagerServiceServerTests",
"options": [
{
"include-annotation": "android.platform.test.annotations.Presubmit"
},
{
"exclude-annotation": "androidx.test.filters.FlakyTest"
},
{
"exclude-annotation": "org.junit.Ignore"
}
]
} }
] ]
} }

View File

@@ -2,11 +2,45 @@
"presubmit": [ "presubmit": [
{ {
"name": "AppEnumerationInternalTests" "name": "AppEnumerationInternalTests"
},
{
"name": "PackageManagerServiceServerTests",
"options": [
{
"include-filter": "com.android.server.pm."
},
{
"include-annotation": "android.platform.test.annotations.Presubmit"
},
{
"exclude-annotation": "androidx.test.filters.FlakyTest"
},
{
"exclude-annotation": "org.junit.Ignore"
}
]
} }
], ],
"postsubmit": [ "postsubmit": [
{ {
"name": "PackageManagerServiceHostTests" "name": "PackageManagerServiceHostTests"
},
{
"name": "PackageManagerServiceServerTests",
"options": [
{
"include-filter": "com.android.server.pm."
},
{
"include-annotation": "android.platform.test.annotations.Postsubmit"
},
{
"exclude-annotation": "androidx.test.filters.FlakyTest"
},
{
"exclude-annotation": "org.junit.Ignore"
}
]
} }
], ],
"imports": [ "imports": [

View File

@@ -37,12 +37,24 @@ android_test_helper_app {
manifest: "AndroidManifest-r5.xml", manifest: "AndroidManifest-r5.xml",
} }
android_test_helper_app {
name: "FrameworksServicesTests_install_uses_sdk_r1000",
defaults: ["FrameworksServicesTests_apks_defaults"],
manifest: "AndroidManifest-r1000.xml",
}
android_test_helper_app { android_test_helper_app {
name: "FrameworksServicesTests_install_uses_sdk_r0_s0", name: "FrameworksServicesTests_install_uses_sdk_r0_s0",
defaults: ["FrameworksServicesTests_apks_defaults"], defaults: ["FrameworksServicesTests_apks_defaults"],
manifest: "AndroidManifest-r0-s0.xml", manifest: "AndroidManifest-r0-s0.xml",
} }
android_test_helper_app {
name: "FrameworksServicesTests_install_uses_sdk_r0_s1000",
defaults: ["FrameworksServicesTests_apks_defaults"],
manifest: "AndroidManifest-r0-s1000.xml",
}
android_test_helper_app { android_test_helper_app {
name: "FrameworksServicesTests_install_uses_sdk_r0_s5", name: "FrameworksServicesTests_install_uses_sdk_r0_s5",
defaults: ["FrameworksServicesTests_apks_defaults"], defaults: ["FrameworksServicesTests_apks_defaults"],

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 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.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.frameworks.servicestests.install_uses_sdk">
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="29">
<!-- This fails because 31 is not version 5 -->
<extension-sdk android:sdkVersion="30" android:minExtensionVersion="0" />
<extension-sdk android:sdkVersion="31" android:minExtensionVersion="5" />
</uses-sdk>
<application>
</application>
</manifest>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 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.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.frameworks.servicestests.install_uses_sdk">
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="29">
<!-- This will fail to install, because minExtensionVersion is not met -->
<extension-sdk android:sdkVersion="30" android:minExtensionVersion="5" />
</uses-sdk>
<application>
</application>
</manifest>

View File

@@ -0,0 +1,160 @@
//########################################################################
// Build PackageManagerServiceServerTests package
//########################################################################
package {
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "frameworks_base_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
default_applicable_licenses: ["frameworks_base_license"],
}
android_test {
name: "PackageManagerServiceServerTests",
// Include all test java files.
srcs: [
"src/**/*.java",
"src/**/*.kt",
],
static_libs: [
"frameworks-base-testutils",
"services.accessibility",
"services.appwidget",
"services.autofill",
"services.backup",
"services.companion",
"services.core",
"services.devicepolicy",
"services.net",
"services.people",
"services.usage",
"guava",
"guava-android-testlib",
"androidx.test.core",
"androidx.test.ext.truth",
"androidx.test.runner",
"androidx.test.rules",
"cts-wm-util",
"platform-compat-test-rules",
"mockito-target-minus-junit4",
"platform-test-annotations",
"ShortcutManagerTestUtils",
"truth-prebuilt",
"testables",
"ub-uiautomator",
"platformprotosnano",
"framework-protos",
"hamcrest-library",
"servicestests-core-utils",
"servicestests-dpm-utils",
"servicestests-utils",
"service-permission.impl",
"testng",
"truth-prebuilt",
"junit",
"junit-params",
"platform-compat-test-rules",
"ActivityContext",
"coretests-aidl",
],
libs: [
"android.hardware.power-V1-java",
"android.hardware.tv.cec-V1.0-java",
"android.hardware.vibrator-V2-java",
"android.hidl.manager-V1.0-java",
"android.test.mock",
"android.test.base",
"android.test.runner",
],
platform_apis: true,
test_suites: [
"device-tests",
"automotive-tests",
],
certificate: "platform",
// These are not normally accessible from apps so they must be explicitly included.
jni_libs: [
"libbase",
"libbinder",
"libc++",
"libcutils",
"liblog",
"liblzma",
"libnativehelper",
"libpsi",
"libui",
"libunwindstack",
"libutils",
"netd_aidl_interface-V5-cpp",
],
dxflags: ["--multi-dex"],
java_resources: [
":PackageParserTestApp1",
":PackageParserTestApp2",
":PackageParserTestApp3",
":PackageParserTestApp4",
":PackageParserTestApp5",
],
resource_zips: [":PackageManagerServiceServerTests_apks_as_resources"],
}
// Rules to copy all the test apks to the intermediate raw resource directory
java_genrule {
name: "PackageManagerServiceServerTests_apks_as_resources",
srcs: [
":FrameworksServicesTests_install",
":FrameworksServicesTests_install_bad_dex",
":FrameworksServicesTests_install_complete_package_info",
":FrameworksServicesTests_install_decl_perm",
":FrameworksServicesTests_install_intent_filters",
":FrameworksServicesTests_install_loc_auto",
":FrameworksServicesTests_install_loc_internal",
":FrameworksServicesTests_install_loc_sdcard",
":FrameworksServicesTests_install_loc_unspecified",
":FrameworksServicesTests_install_use_perm_good",
":FrameworksServicesTests_install_uses_feature",
":FrameworksServicesTests_install_uses_sdk_0",
":FrameworksServicesTests_install_uses_sdk_q0",
":FrameworksServicesTests_install_uses_sdk_q0_r0",
":FrameworksServicesTests_install_uses_sdk_r0",
":FrameworksServicesTests_install_uses_sdk_r5",
":FrameworksServicesTests_install_uses_sdk_r1000",
":FrameworksServicesTests_install_uses_sdk_r_none",
":FrameworksServicesTests_install_uses_sdk_r0_s0",
":FrameworksServicesTests_install_uses_sdk_r0_s5",
":FrameworksServicesTests_install_uses_sdk_r0_s1000",
":FrameworksServicesTests_keyset_permdef_sa_unone",
":FrameworksServicesTests_keyset_permuse_sa_ua_ub",
":FrameworksServicesTests_keyset_permuse_sb_ua_ub",
":FrameworksServicesTests_keyset_sa_ua",
":FrameworksServicesTests_keyset_sa_ua_ub",
":FrameworksServicesTests_keyset_sa_uab",
":FrameworksServicesTests_keyset_sa_ub",
":FrameworksServicesTests_keyset_sa_unone",
":FrameworksServicesTests_keyset_sab_ua",
":FrameworksServicesTests_keyset_sau_ub",
":FrameworksServicesTests_keyset_sb_ua",
":FrameworksServicesTests_keyset_sb_ub",
":FrameworksServicesTests_keyset_splat_api",
":FrameworksServicesTests_keyset_splata_api",
],
out: ["PackageManagerServiceServerTests_apks_as_resources.res.zip"],
tools: ["soong_zip"],
cmd: "mkdir -p $(genDir)/res/raw && " +
"for i in $(in); do " +
" x=$${i##*FrameworksCoreTests_}; cp $$i $(genDir)/res/raw/$${x%.apk};" +
" x=$${i##*FrameworksServicesTests_}; cp $$i $(genDir)/res/raw/$${x%.apk};" +
"done && " +
"$(location soong_zip) -o $(out) -C $(genDir)/res -D $(genDir)/res",
}

View File

@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2022 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.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.server.pm.test.service.server">
<uses-permission android:name="android.permission.READ_LOGS"/>
<uses-permission android:name="android.permission.ACCESS_VR_MANAGER"/>
<uses-permission android:name="android.permission.ACCOUNT_MANAGER"/>
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.BROADCAST_STICKY"/>
<uses-permission android:name="android.permission.UPDATE_DEVICE_STATS"/>
<uses-permission android:name="android.permission.MANAGE_APP_TOKENS"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS"/>
<uses-permission android:name="android.permission.REAL_GET_TASKS"/>
<uses-permission android:name="android.permission.GET_DETAILED_TASKS"/>
<uses-permission android:name="android.permission.REORDER_TASKS"/>
<uses-permission android:name="android.permission.MANAGE_NETWORK_POLICY"/>
<uses-permission android:name="android.permission.READ_NETWORK_USAGE_HISTORY"/>
<uses-permission android:name="android.permission.OBSERVE_NETWORK_POLICY"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.MANAGE_USERS"/>
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
<uses-permission android:name="android.permission.MANAGE_DEVICE_ADMINS"/>
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
<uses-permission android:name="android.permission.PACKET_KEEPALIVE_OFFLOAD"/>
<uses-permission android:name="android.permission.GET_INTENT_SENDER_INTENT"/>
<uses-permission android:name="android.permission.MANAGE_ACTIVITY_TASKS"/>
<uses-permission android:name="android.permission.INSTALL_PACKAGES"/>
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION"/>
<uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>
<uses-permission android:name="android.permission.DELETE_PACKAGES"/>
<uses-permission android:name="android.permission.GET_APP_OPS_STATS"/>
<uses-permission android:name="android.permission.UPDATE_APP_OPS_STATS"/>
<uses-permission android:name="android.permission.MANAGE_APP_OPS_MODES"/>
<uses-permission android:name="android.permission.DEVICE_POWER"/>
<uses-permission android:name="android.permission.FORCE_STOP_PACKAGES"/>
<uses-permission android:name="android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.STATUS_BAR"/>
<uses-permission android:name="android.permission.STATUS_BAR_SERVICE"/>
<uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER"/>
<uses-permission android:name="android.permission.READ_FRAME_BUFFER"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.STORAGE_INTERNAL"/>
<uses-permission android:name="android.permission.WATCH_APPOPS"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.SUSPEND_APPS"/>
<uses-permission android:name="android.permission.LOG_COMPAT_CHANGE"/>
<uses-permission android:name="android.permission.READ_COMPAT_CHANGE_CONFIG"/>
<uses-permission android:name="android.permission.CONTROL_KEYGUARD"/>
<uses-permission android:name="android.permission.MANAGE_BIND_INSTANT_SERVICE"/>
<uses-permission android:name="android.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS"/>
<uses-permission android:name="android.permission.CONTROL_DISPLAY_BRIGHTNESS"/>
<uses-permission android:name="android.permission.CONFIGURE_DISPLAY_BRIGHTNESS"/>
<uses-permission android:name="android.permission.READ_DEVICE_CONFIG"/>
<uses-permission android:name="android.permission.WRITE_DEVICE_CONFIG"/>
<uses-permission android:name="android.permission.HARDWARE_TEST"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE"/>
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT"/>
<uses-permission android:name="android.permission.BLUETOOTH_SCAN"/>
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS"/>
<uses-permission android:name="android.permission.DUMP"/>
<uses-permission android:name="android.permission.READ_DREAM_STATE"/>
<uses-permission android:name="android.permission.READ_DREAM_SUPPRESSION"/>
<uses-permission android:name="android.permission.WRITE_DREAM_STATE"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.MODIFY_DAY_NIGHT_MODE"/>
<uses-permission android:name="android.permission.MEDIA_RESOURCE_OVERRIDE_PID"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.ACCESS_VIBRATOR_STATE"/>
<uses-permission android:name="android.permission.VIBRATE_ALWAYS_ON"/>
<uses-permission android:name="android.permission.CONTROL_DEVICE_STATE"/>
<uses-permission android:name="android.permission.READ_PROJECTION_STATE"/>
<uses-permission android:name="android.permission.KILL_UID"/>
<uses-permission android:name="android.permission.MAINLINE_NETWORK_STACK"/>
<uses-permission
android:name="android.permission.OVERRIDE_COMPAT_CHANGE_CONFIG_ON_RELEASE_BUILD"/>
<uses-permission android:name="android.permission.ASSOCIATE_INPUT_DEVICE_TO_DISPLAY" />
<uses-permission android:name="android.permission.READ_NEARBY_STREAMING_POLICY" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_ROUTING" />
<uses-permission android:name="android.permission.PACKAGE_VERIFICATION_AGENT" />
<uses-permission android:name="android.permission.OBSERVE_ROLE_HOLDERS" />
<uses-permission android:name="android.permission.BATTERY_STATS" />
<!-- Uses API introduced in O (26) -->
<uses-sdk android:minSdkVersion="1" android:targetSdkVersion="26"/>
<application android:testOnly="true" android:debuggable="true">
<uses-library android:name="android.test.runner"/>
</application>
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="com.android.server.pm.test.service.server"
android:label="Package Manager Service Tests"/>
<key-sets>
<key-set android:name="A" >
<public-key android:name="keyA"
android:value="MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsMpNthdOxud7roPDZMMomOqXgJJdRfIWpkKEqmC61Mv+Nf6QY3TorEwJeghjSmqj7IbBKrtvfQq4E2XJO1HuspmQO4Ng2gvn+r+6EwNfKc9k55d6s+27SR867jKurBbHNtZMG+tjL1yH4r+tNzcuJCsgyAFqLmxFdcxEwzNvREyRpoYc5RDR0mmTwkMCUhJ6CId1EYEKiCEdNzxv+fWPEb21u+/MWpleGCILs8kglRVb2q/WOzAAvGr4FY5plfaE6N+lr7+UschQ+aMi1+uqewo2o0qPFVmZP5hnwj55K4UMzu/NhhDqQQsX4cSGES1KgHo5MTqRqZjN/I7emw5pFQIDAQAB"/>
</key-set>
<upgrade-key-set android:name="A"/>
</key-sets>
</manifest>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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="Runs Frameworks Services Tests.">
<option name="test-suite-tag" value="apct" />
<option name="test-suite-tag" value="apct-instrumentation" />
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
<option name="cleanup-apks" value="true" />
<option name="install-arg" value="-t" />
<option name="test-file-name" value="PackageManagerServiceServerTests.apk" />
</target_preparer>
<option name="test-tag" value="PackageManagerServiceServerTests" />
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="com.android.server.pm.test.service.server" />
<option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
<option name="hidden-api-checks" value="false"/>
<option name="exclude-annotation" value="androidx.test.filters.FlakyTest" />
</test>
</configuration>

Some files were not shown because too many files have changed in this diff Show More