Merge EthernetServiceTests into FrameworksNetTests

As per the TODO, merge EthernetServiceTests into the larger
FrameworksNetTests suite.

Similarly to NetworkStats, NSD or IpSec tests, the tests are also marked
as "non-connectivity-module-test", where "module" actually refers to
modules being built for release (from an S-based branch) today. This is
necessary as the tests and associated code cannot build without T APIs.

Also add FrameworksNetTests to presubmit as non-connectivity-module
tests are not run in presubmit without this.

Test: TH
Merged-In: Id533cdb4ac184b963f570af299dea04754ba88e9
Change-Id: I9950fcb49fdc2217134a59e993941cbe5da0b556
This commit is contained in:
Remi NGUYEN VAN
2022-04-01 11:59:45 +09:00
parent 075dd6f8ff
commit 40da62da48
9 changed files with 7 additions and 95 deletions

View File

@@ -3,6 +3,10 @@
{
"name": "ConnectivityCoverageTests"
},
{
// In addition to ConnectivityCoverageTests, runs non-connectivity-module tests
"name": "FrameworksNetTests"
},
// Run in addition to mainline-presubmit as mainline-presubmit is not
// supported in every branch.
// CtsNetTestCasesLatestSdk uses stable API shims, so does not exercise

View File

@@ -72,18 +72,3 @@ java_library {
"//packages/modules/IPsec/tests/iketests",
],
}
// Ethernet related libraries.
// TODO: remove when ethernet tests are merged into connectivity tests
filegroup {
name: "ethernet-service-test-sources",
srcs: [
"src/com/android/server/ethernet/**/*.java",
"src/com/android/server/net/DelayedDiskWrite.java",
"src/com/android/server/net/IpConfigStore.java",
],
path: "src",
visibility: [
"//packages/modules/Connectivity/tests:__subpackages__",
],
}

View File

@@ -1,52 +0,0 @@
// Copyright (C) 2018 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.
//
package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
// TODO: merge the tests into service-connectivity tests after
// ethernet service migration completes. So far just import the
// ethernet service source to fix the dependencies.
android_test {
name: "EthernetServiceTests",
srcs: [
":ethernet-service-test-sources",
"java/**/*.java",
],
certificate: "platform",
platform_apis: true,
libs: [
"android.test.runner",
"android.test.base",
"android.test.mock",
"framework-connectivity.impl",
"framework-connectivity-t.impl",
"ServiceConnectivityResources",
],
static_libs: [
"androidx.test.rules",
"frameworks-base-testutils",
"mockito-target-minus-junit4",
"net-tests-utils",
"services.core",
"services.net",
],
test_suites: ["general-tests"],
}

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2018 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.ethernet.tests">
<application>
<uses-library android:name="android.test.runner" />
</application>
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="com.android.server.ethernet.tests"
android:label="Ethernet Service Tests" />
</manifest>

View File

@@ -76,6 +76,7 @@ filegroup {
"java/com/android/server/IpSecServiceParameterizedTest.java",
"java/com/android/server/IpSecServiceRefcountedResourceTest.java",
"java/com/android/server/IpSecServiceTest.java",
"java/com/android/server/NativeDaemonConnectorTest.java",
"java/com/android/server/NetworkManagementServiceTest.java",
"java/com/android/server/NsdServiceTest.java",
"java/com/android/server/connectivity/IpConnectivityEventBuilderTest.java",
@@ -83,8 +84,10 @@ filegroup {
"java/com/android/server/connectivity/MultipathPolicyTrackerTest.java",
"java/com/android/server/connectivity/NetdEventListenerServiceTest.java",
"java/com/android/server/connectivity/VpnTest.java",
"java/com/android/server/ethernet/*.java",
"java/com/android/server/net/ipmemorystore/*.java",
"java/com/android/server/net/BpfInterfaceMapUpdaterTest.java",
"java/com/android/server/net/IpConfigStoreTest.java",
"java/com/android/server/net/NetworkStats*.java",
"java/com/android/server/net/TestableUsageCallback.kt",
]