This is a no-op, test only refactoring.
Move ethernet state management logic from EthernetManagerTest into a
dedicated JUnit test rule, RestoreEthernetRule. This new rule is
responsible for saving the initial ethernet state, allowing tests to
enable or disable it, and restoring the original state upon test
completion. This refactoring simplifies EthernetManagerTest and
promotes code reuse.
Flag: EXEMPT EXEMPT test only refacotring
Test: atest NetworkStaticLibTests:com.android.testutils.RestoreEthernetRuleTest \
CtsNetTestCases:android.net.cts.EthernetManagerTest --update-device
Bug: 410731080
Change-Id: If3dd869d6af4e0c659386621fb5d92012aa574d1
88 lines
2.4 KiB
Text
88 lines
2.4 KiB
Text
//########################################################################
|
|
// Build NetworkStaticLibTests package
|
|
//########################################################################
|
|
|
|
package {
|
|
default_team: "trendy_team_fwk_core_networking",
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
}
|
|
|
|
android_library {
|
|
name: "NetworkStaticLibTestsLib",
|
|
srcs: [
|
|
"src/**/*.java",
|
|
"src/**/*.kt",
|
|
],
|
|
min_sdk_version: "30",
|
|
defaults: ["framework-connectivity-test-defaults"],
|
|
static_libs: [
|
|
"androidx.test.rules",
|
|
"mockito-kotlin2",
|
|
"mockito-target-extended-minus-junit4",
|
|
"netd-client",
|
|
"net-tests-utils",
|
|
"net-utils-framework-common",
|
|
"net-utils-device-common",
|
|
"net-utils-device-common-async",
|
|
"net-utils-device-common-bpf",
|
|
"net-utils-device-common-ip",
|
|
"net-utils-device-common-struct-base",
|
|
"net-utils-device-common-wear",
|
|
"net-utils-service-connectivity",
|
|
"truth",
|
|
],
|
|
libs: [
|
|
"android.test.runner.stubs",
|
|
"android.test.base.stubs",
|
|
],
|
|
visibility: [
|
|
"//frameworks/base/packages/Tethering/tests/integration",
|
|
"//packages/modules/Connectivity/tests:__subpackages__",
|
|
"//packages/modules/Connectivity/Tethering/tests:__subpackages__",
|
|
"//packages/modules/NetworkStack/tests/integration",
|
|
],
|
|
lint: {
|
|
strict_updatability_linting: true,
|
|
test: true,
|
|
},
|
|
}
|
|
|
|
android_test {
|
|
name: "NetworkStaticLibTests",
|
|
certificate: "platform",
|
|
static_libs: [
|
|
"NetworkStaticLibTestsLib",
|
|
],
|
|
jni_libs: [
|
|
// For mockito extended
|
|
"libdexmakerjvmtiagent",
|
|
"libstaticjvmtiagent",
|
|
"libcom_android_net_moduletests_util_jni",
|
|
],
|
|
jarjar_rules: "jarjar-rules.txt",
|
|
test_suites: ["device-tests"],
|
|
lint: {
|
|
strict_updatability_linting: true,
|
|
},
|
|
}
|
|
|
|
python_test_host {
|
|
name: "NetworkStaticLibHostPythonTests",
|
|
srcs: [
|
|
"host/python/*.py",
|
|
],
|
|
main: "host/python/run_tests.py",
|
|
libs: [
|
|
"absl-py",
|
|
"mobly",
|
|
"net-tests-utils-host-python-common",
|
|
],
|
|
test_config: "host/python/test_config.xml",
|
|
test_suites: [
|
|
"general-tests",
|
|
],
|
|
// MoblyBinaryHostTest doesn't support unit_test.
|
|
test_options: {
|
|
unit_test: false,
|
|
},
|
|
}
|