summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi NGUYEN VAN <reminv@google.com>2019-10-30 18:20:36 +0900
committerRemi NGUYEN VAN <reminv@google.com>2019-11-05 14:53:42 +0900
commitae18aed8046c68e3f03690acdbb7e5425a4754e1 (patch)
tree2741ccbca7d82571a243ef8eb5e11fb7e122bb86
parentdfc4f7c2547eeb26be2e7b2f63318933eec1fb75 (diff)
Use the test lib for NetworkStackIntegrationTests
Use TestNetworkStackLib instead of NetworkStackApiCurrentLib for integration tests. TestNetworkStackLib is closer to the actual NetworkStack; in particular it uses the jarjared classes. The integration tests must use these same classes to avoid conflicts with the framework versions. Also use AndroidManifestBase instead of AndroidManifest in TestNetworkStackLib, because the real AndroidManifest contains privileged permissions that a test (which is not installed in /system/priv-app) should not request; and tests should not declare services that conflict with the real NetworkStack services. Test: atest NetworkStackIntegrationTests FrameworksNetIntegrationTests Change-Id: I7f4896c71bb244b81a9d232d369d6b215cd61903
-rw-r--r--Android.bp2
-rw-r--r--tests/integration/Android.bp2
-rw-r--r--tests/integration/src/android/net/ip/IpClientIntegrationTest.java4
3 files changed, 4 insertions, 4 deletions
diff --git a/Android.bp b/Android.bp
index f17f1b1..8c8f8c8 100644
--- a/Android.bp
+++ b/Android.bp
@@ -185,7 +185,7 @@ android_library {
name: "TestNetworkStackLib",
defaults: ["NetworkStackAppDefaults", "NetworkStackApiCurrentLevel"],
static_libs: ["NetworkStackApiCurrentLib"],
- manifest: "AndroidManifest.xml",
+ manifest: "AndroidManifestBase.xml",
}
cc_library_shared {
diff --git a/tests/integration/Android.bp b/tests/integration/Android.bp
index 89b3968..fdc9a53 100644
--- a/tests/integration/Android.bp
+++ b/tests/integration/Android.bp
@@ -24,8 +24,8 @@ android_test {
"androidx.test.rules",
"mockito-target-extended-minus-junit4",
"net-tests-utils",
- "NetworkStackApiCurrentLib",
"testables",
+ "TestNetworkStackLib",
],
libs: [
"android.test.runner",
diff --git a/tests/integration/src/android/net/ip/IpClientIntegrationTest.java b/tests/integration/src/android/net/ip/IpClientIntegrationTest.java
index 63f4319..20f3658 100644
--- a/tests/integration/src/android/net/ip/IpClientIntegrationTest.java
+++ b/tests/integration/src/android/net/ip/IpClientIntegrationTest.java
@@ -24,8 +24,8 @@ import static android.net.dhcp.DhcpPacket.DHCP_SERVER;
import static android.net.dhcp.DhcpPacket.ENCAP_L2;
import static android.net.dhcp.DhcpPacket.INFINITE_LEASE;
import static android.net.ipmemorystore.Status.SUCCESS;
-import static android.net.shared.Inet4AddressUtils.getBroadcastAddress;
-import static android.net.shared.Inet4AddressUtils.getPrefixMaskAsInet4Address;
+import static android.net.networkstack.shared.Inet4AddressUtils.getBroadcastAddress;
+import static android.net.networkstack.shared.Inet4AddressUtils.getPrefixMaskAsInet4Address;
import static android.system.OsConstants.ETH_P_IPV6;
import static android.system.OsConstants.IPPROTO_ICMPV6;
import static android.system.OsConstants.IPPROTO_TCP;