Currently, when an agent calls setUnderlyingNetworks, the
transports of the network are hardcoded to TRANSPORT_VPN only.
This is being fixed in another CL in this topic. The new code
reports the same transports sent by the agent.
This test registers an agent with TRANSPORT_TEST|TRANSPORT_VPN.
Update the test to expect both transports in the callbacks it
receives.
Bug: 173331190
Test: passes when run with other CL in topic
Change-Id: Iede61d74fa02a4fec1f345f6d18835c1acab7337
- Use a more realistic routing config (instead of a LinkAddress
with prefix length 0, an address with a mask of 32 and a
default route).
- Use InetAddresses to parse IP addresses since it's a public API.
- Import the NET_CAPABILITY_xxx and TRANSPORT_xxx constants for
readability.
Bug: 173331190
Test: test-only change
Change-Id: I9703d7dd5781f60fb3d531267d3f5370cbccd64f
Drops use of deprecated API in libnativehelper and uses a common
helper that will be stable across releases.
Bug: 158749603
Test: m
Change-Id: Ic1a1811ffb9a1c207f562a180417e99df31e3502
The CL that introduced testSetUnderlyingNetworks allowed tests to
pass in NetworkCapabilities when registering an agent, but
incorrectly always set the agent's capabilities anyway. This
resulted in testSetUnderlyingNetworks registering an agent with
TRANSPORT_VPN and NET_CAPABILITY_NOT_VPN.
Fix this by ensuring that createNetworkAgent either uses the
passed-in capabilities unmodified, or creates its own. Assert
that the test VPN network does not have NET_CAPABILITY_NOT_VPN.
While I'm at it, remove the manual unregistration of the callback
by using the registerNetworkCallback helper method.
Also add a little bit of extra test coverage.
Bug: 173331190
Test: test-only change
Change-Id: I114d876a1b2bf5344dd7c6fa23862df1c0a412c3
Also jarjar com.android.net.module.util* to
com.android.networkstack.tethering.util*.
Bug: 171670016
Test: atest TetheringCoverageTests
Change-Id: I3bde9ad3c41adf36da99bd944303d88ce992201c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1473223
Compare with original change, this change also add visibility
rules for packages/modules/Connectivity/Tethering in new file
(tests/Android.bp).
Merged-In: I3f1d7019f1a12647b78630a412df3adf03e9e95a
Change-Id: I40c22e2f39d795abfd961a3f797e510e51c8ed7c
frameworks-base-testutils is unused in tethering integration tests, so
the dependency can be removed.
That test library also contains test classes, so removing the dependency
allows tethering tests to stop running the associated tests.
Also add jarjar rules to the unit tests to zap (remove) the test classes
from the output APK. Ideally the unit tests should stop depending on
that library too (TestableLooper can be used instead of TestLooper), or
the frameworks-base-testutils library should stop including test
classes.
Bug: 167968946
Test: m CtsTetheringTest TetheringTests
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1433924
Merged-In: I3f1d7019f1a12647b78630a412df3adf03e9e95a
Change-Id: Id189676b7447c6cb0f8d9b216c42a34c6513ba61
r.android.com/1424920 changed the code but forgot to update the
unit test.
Also fix some lint errors.
Bug: 149109043
Test: atest TetheringTests TetheringPrivilegedTests
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440767
Merged-In: I3f1d7019f1a12647b78630a412df3adf03e9e95a
Change-Id: I9fb3be173ddb9314334dab72aebc86c22b7c5aeb
Add the netfilter generic message header to
the netlink req. This is needed so the kernel
won't ignore the request for invalid params.
Bug: 149109043
Test: ConntrackSocketTest
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1424920/
Merged-In: I3f1d7019f1a12647b78630a412df3adf03e9e95a
Change-Id: I63ca166851d6ca2c4737b263dde14c8d794a7d10
Create TetheringPrivilegedTests which have MAINLINE_NETWORK_STACK
permission, the test can perform various network-related operations
which need CAP_NET_RAW and CAP_NET_ADMIN capabilities.
Bug: 145490751
Test: make TetheringPrivilegedTests
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1345361
Merged-In: I3f1d7019f1a12647b78630a412df3adf03e9e95a
Change-Id: I93f8f6510e12a2a44bc576a4a801c0aac629df25
Also reorganize the files to have one toplevel CTS owners file, and only
additional owners in subdirectories.
Change-Id: I28ce193896e1ade2034589327805870774a4d608
Test: m
* changes:
Add OWNERS for packages/modules/Connectivity.
Add repo hooks for packages/modules/Connectivity.
Add a .gitignore in packages/modules/Connectivity.
Specify the owners here instead of including them from other
places (e.g., frameworks/base, NetworkStack) because we hope that
this project will eventually contain all the code.
Test: none
Change-Id: I82811a9758480f16654145c4d55ef784be09de2b