Commit graph

43,112 commits

Message SHA1
Rename tethering util folder and its package name
Move tethering util files from android.net.util into
com.android.networkstack.tethering.util. The goal is move all of
tethering internal files into its own namespace
com.android.networkstack.tethering.util.

Bug: 205088391
Test: atest TetheringTests
      atest CtsTetheringTest
      atest TetheringPrivilegedTests

Change-Id: I6559fb4f873b3cad5b210b10e49df1b6c6914a70

markchien   commited 2021-11-09 17:02:47 +08:00
d02f9af918
Merge "Add TetheredInterface{Request, Callback} interface"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-11-08 09:54:54 +00:00
7269fb17fd
Add TetheredInterface{Request, Callback} interface
Define interfaces that match the signature of the existing
EthernetManager.TetheredInterfaceRequest and TetheredInterfaceCallback
classes and make EthernetManager.TetheredInterfaceRequest and
TetheredInterfaceCallback implement/subinterface these interfaces. The
new bluetooth API could also implement these interfaces to make API surface
consistent.

Test: TH would test the existing tests that use the subclass.
Bug: 190438212
Change-Id: I093972c111cb1d921076782492716d5a046be8fc

markchien   commited 2021-11-08 16:44:34 +08:00
48e271bdcb
Merge "Separate tethering build target to Tethering and TetheringNext"
Mark Chien   authored and   Gerrit Code Review   commited 2021-11-08 07:29:55 +00:00
7509c7a67e
Merge "Include the failing stats in stats failure assertions."
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-11-08 06:20:39 +00:00
27979bd116
Include the failing stats in stats failure assertions.
Currently debugging IpSecManagerTest counter test failures is
difficult because the assertion message does not say how many
bytes/packets were expected.

Add this information to the assertion message.

Bug: 204860049
Test: test-only change
Change-Id: I4e12be9a58a688fcee3362dceb31d9f21e981d6c

Lorenzo Colitti   commited 2021-11-08 13:25:45 +09:00
5156e787f3
Merge "Add test case to test normalize"
Les Lee   authored and   Gerrit Code Review   commited 2021-11-06 00:54:14 +00:00
b5ee639fe0
Merge "Add IFF_MULTICAST to test interfaces"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-11-05 20:01:41 +00:00
aa5532cb6f
Add test case to test normalize
Bug: 194939211
Test: atest -c NetworkTemplateTest
Change-Id: I2f5790b9217357ddcf3f466cec1b2b1afbb47210

Les Lee   commited 2021-11-05 16:59:10 +08:00
5299a2b307
Add IFF_MULTICAST to test interfaces
This allows using test interfaces for multicast scenarios, such as
testing mDNS behavior.

Test: atest CtsNetTestCases
Change-Id: Ib5d8a997176f910d499021fdcd12c361aff1233d

Remi NGUYEN VAN   commited 2021-11-05 17:15:20 +09:00
6fc44359eb
Merge "Use ConnectivityCheckTargetPreparer in CTS"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-11-05 04:27:47 +00:00
defc74fb2f
Merge "Fix TetheringPrivilegedTests crash"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2021-11-04 10:37:04 +00:00
4e141d9514
Separate tethering build target to Tethering and TetheringNext
To avoid much code diverge between aosp and its downstream, we need to
separate the build target which build with latest stable sdk in release
branch and build with unfreeze sdk in dev branch. So we could use new
API with APIshim in dev branch without impacting release branch.

BYPASS_INCLUSIVE_LANGUAGE_REASON=the wording is the file name of
existing file.
Bug: 204265450
Test: m
Change-Id: I949fd83b1eed7461e0b381193b190cf15080bc1b

markchien   authored and   Mark Chien   commited 2021-11-04 08:53:12 +00:00
5a8c806e55
Fix TetheringPrivilegedTests crash
After separat BpfMap to a library, its package name is jarjar to
com.android.network.stack.util*. Also jarjar BpfMap of
TetheringPrivilegedTests to fix crash in jni registered.

Bug: 179733303
Test: atest TetheringPrivilegedTests
Change-Id: Ia9bc819a44fe26bf2ff7a46351ea60f2eeb02933

markchien   commited 2021-11-04 16:40:18 +08:00
45dc794fb4
Merge "Move fromStableParcelable to KeepaliveController"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-11-04 06:19:17 +00:00
1d1b1fe999
Merge "bpfmap: Move to Common Location"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2021-11-04 01:50:15 +00:00
bb4c6073ec
Merge "Add permission update logs"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-11-02 02:27:56 +00:00
f475961aca
Merge "Replace "mts" with "mts-tethering"."
Kimberly Kreider   authored and   Gerrit Code Review   commited 2021-11-01 23:43:53 +00:00
200e42063c
Merge "Shorten a timeout"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-11-01 12:19:28 +00:00
a200fe8c1c
Merge "Replace mDeps with a custom object"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-11-01 10:31:53 +00:00
31ac212428
Shorten a timeout
This timeout is not very useful but will be incurred every
time

Test: ConnectivityServiceTest
Change-Id: Ia7c76c7c7a148f14844d098be267e16c215776f5

Chalard Jean   commited 2021-11-01 19:30:10 +09:00
f63e4597a3
Add permission update logs
Save permission update result when package added /
package removed / setting changed.

Log:
Permission Monitor:
  Interface filtering rules:

  Update log:
    2021-10-27T11:04:23.472 - Package remove: name=com.vzw.apnlib, uid=10001, nPerm=(NONE/NONE), tPerm=UNINSTALLED
    2021-10-27T11:03:38.307 - Setting change: update={}, remove={10001=1}
    2021-10-27T11:02:22.589 - Setting change: update={10001=2}, remove={}
    2021-10-27T11:01:08.615 - Package add: name=com.vzw.apnlib, uid=10001, nPerm=(NONE/NONE), tPerm=NONE

Bug: 204260474
Test: build / flash / adb shell dumpsys connectivity
Change-Id: I889a8f2c82751f227655b39a4281a6f044508a86

paulhu   commited 2021-11-01 16:35:06 +08:00
819e8625e6
Merge "Add tests for testing if [start|finish]Op is called or not"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-11-01 08:33:36 +00:00
5bf4cd9a73
Merge "Log received wifiP2p intent into dumpsys for debugging"
Mark Chien   authored and   Gerrit Code Review   commited 2021-11-01 08:04:55 +00:00
3a5c822ec1
Replace mDeps with a custom object
Mockito's mocks are not thread-safe. The dependencies object
is used both on the test thread (to set it up) and in the CS
handler thread. This can't work with a mock.

Bug: 195626111
Test: ConnectivityServiceTest
Change-Id: Ia989dd71c3133513a90bc1d1957419fb1b74c300

Chalard Jean   commited 2021-11-01 16:30:56 +09:00
21f4f70d46
Move fromStableParcelable to KeepaliveController
TcpKeepaliveController is the only user of
KeepalivePacketDataUtil.fromStableParcelable. Because of
fromStableParcelable, networkstack-client needs to depend on
net-utils-framework-commonm, which pulls a lot of unnecessary classes.
This is particularly problematic considering that networkstack-client
may need to be redistributed as a prebuilt.

Move the method to TcpKeepaliveController, simplifying dependencies.
This also shows that fromStableParcelable could be removed altogether
(or moved to tests) if TcpKeepaliveController built a
TcpKeepalivePacketData class directly.

Test: atest ConnectivityCoverageTests
Change-Id: I554318f6bcd07c73d153598a0231e9fcaf912e90

Remi NGUYEN VAN   commited 2021-11-01 13:23:27 +09:00
5d99aa78f7
bpfmap: Move to Common Location
Move bpfmap to frameworks/libs/net/common/native.

Bug: 179733303
Change-Id: Id08b216ec6a64968d66d7990f91ea7ce222a1154

Tyler Wear   commited 2021-10-29 09:05:33 -07:00
e8043ca762
Move to f/l/n instead of RouteUtils
Test: TetheringTests
Change-Id: I35b36538463a7fc2f02e142719c898d1694b2d6b

Chalard Jean   commited 2021-10-29 16:05:46 +09:00
adcec9ebbe
Log received wifiP2p intent into dumpsys for debugging
Bug: 201480425
Test: m
Change-Id: I527c894eff3c068080995333ab8b372ab2aa38a0

markchien   commited 2021-10-29 14:45:14 +08:00
eb8599c4e3
Merge "Improve logs in checkNrisConsistency"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-10-28 19:09:27 +00:00
f58a955b37
Merge "Add RequiresDevice to relevant tests"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-10-28 08:30:44 +00:00
8e58917bc3
Use ConnectivityCheckTargetPreparer in CTS
The preparer does basic checks for device configuration before any test
is run, so that wrong device configuration can be identified at the
module level, rather than fail individual test cases.

If test devices are not properly configured with a wifi configuration
and data-enabled SIM cards, the run will fail before starting the test
module.

As the preparer uses much of CtsNetUtils code for connecting to wifi,
refactor that code out of CtsNetUtils.

Test: atest CtsNetCasesLatestSdk
Change-Id: I1214b6d6916e836bcd68d15c50486092c7fb9a6e

Remi NGUYEN VAN   commited 2021-10-28 15:15:53 +09:00
9c358cd831
Merge "Apply a workaround, and try to detect a system crash"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-10-28 03:46:28 +00:00
65571769cd
Improve logs in checkNrisConsistency
Test: ConnectivityServiceTest
Change-Id: If5235443217ad4abbdd40e89d5721d4f7832d52f

Chalard Jean   commited 2021-10-28 12:45:12 +09:00
ba551d4dbb
Add RequiresDevice to relevant tests
Replace SkipPresubmit with RequiresDevice on relevant tests, as
RequiresDevices is more standard and more specific.

This allows creating test configurations using virtual devices which are
not necessarily in presubmit.

Bug: 201014262
Test: TH needs to verify test mapping run with new annotation
Change-Id: I6758d2a41a9a987a5244e47e4795bc49889c4d61

Remi NGUYEN VAN   commited 2021-10-28 09:49:42 +09:00
9a689f81f4
Apply a workaround, and try to detect a system crash
This will prevent the system crash in b/194394697, and on T try to
detect the issue much earlier and crash the system at that time
together with much more expansive logs.

Bug: 194394697
Test: ConnectivityServiceTest
Change-Id: Ia4be82179160216d41bf4d88b896e4814385063a

Chalard Jean   commited 2021-10-27 16:00:56 +09:00
524f0b1d7f
Add a test for metered/non-metered mobile network
NetworkTemplate.buildTemplateMobileWithRatType() supports
to build a template with metered filter, so a mobile network
is metered or non-metered should be tested.

This commit also rename buildMobile3gState to buildMobileState
because originally this method uses NetworkInfo to simulate the
network type. The NetworkInfo related codes were removed.
Currently, setMobileRatTypeAndWaitForIdle is used to simulate
the network type in test.

Ignore-AOSP-First: The parent of this change contains a CL will
conflict with internal tree so ignore AOSP first.
Bug: 183776809
Test: this
Change-Id: I8e54e2acb06db81fb0eaf330c4fd7cb391b01ff3

Aaron Huang   commited 2021-10-26 12:16:18 +00:00
2685c929f4
Add a test for NetworkIdentity.getMetered()
NetworkIdentity has adapted NET_CAPABILITY_TEMPORARILY_NOT_METERED
network capability so add a test case for it.

Ignore-AOSP-First: The parent of this change contains a CL will
conflict with internal tree so ignore AOSP first.
Bug: 183776809
Test: this
Change-Id: I2ca2a8b4db664b76a5a5ee82fcff451efd87c8ff

Aaron Huang   commited 2021-10-26 12:16:03 +00:00
eaca5b1982
Merge changes Ib2d54e53,Ieb606d2b
* changes:
  Test if underlying networks are the same as what VpnService sets
  Convert VpnTest to JUnit4

Lucas Lin   authored and   Gerrit Code Review   commited 2021-10-26 06:07:19 +00:00
c5e61cc540
Merge "Update callers to use buildTemplateMobileWithRatType with metered"
Aaron Huang   authored and   Gerrit Code Review   commited 2021-10-26 05:54:05 +00:00
c5655055a3
Test if underlying networks are the same as what VpnService sets
If VpnService set null as the underlying networks, then the
underlying networks will be set as system defeult network.
If VpnService set an empty array as the underlying networks, then
the underlying networks of VPN will not be set to any networks.
If VpnService set a network which is not null or an empty array,
then the underlying networks of VPN should be the same as this
one.

Bug: 191918368
Test: atest CtsHostsideNetworkTests:HostsideVpnTests
Change-Id: Ib2d54e53960e5f899cb8d4cfaa6705ca676354ca

lucaslin   commited 2021-10-26 10:55:41 +08:00
cacd5b0d2a
Convert VpnTest to JUnit4
This is to fix the error in errorprone target, the error message
is: [JUnit4ClassUsedInJUnit3] Assume cannot be used inside a
JUnit3 class. Convert your class to JUnit4 style.
The error method is: assumeTrue()

Bug: 191918368
Test: atest CtsHostsideNetworkTests:HostsideVpnTests
Change-Id: Ieb606d2ba31cc19510425114c76fd77417227f2c

lucaslin   commited 2021-10-26 10:55:25 +08:00
d2de904def
Merge "No-op cleanup"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-10-26 02:39:47 +00:00
e88bfbc015
Add tests for testing if [start|finish]Op is called or not
Add a test for testing if [start|finish]Op will be called when
[start|stop]VpnProfile is called.
Also add a test to ensure that the startOp will not be called
again when seamless handover is happened.

Bug: 197135981
Test: atest FrameworksNetTests:VpnTest
Change-Id: I778ea4edf7c4a2d20b3b8e1877e7942feac5372a

lucaslin   commited 2021-10-26 03:46:46 +08:00
d4e7b00b2b
Update callers to use buildTemplateMobileWithRatType with metered
The method buildTemplateMobileWithRatType is updated to take
metered as a parameter so the callers should be updated to
the new version.

Bug: 183776809
Test: atest FrameworksNetTest
Change-Id: I859514b93705f9ee4f9ae4b0bcddcb61005a78ff
Merged-In: I859514b93705f9ee4f9ae4b0bcddcb61005a78ff

Aaron Huang   commited 2021-10-25 15:22:59 +00:00
6359ebd099
No-op cleanup
Binders from the system server don't help, because if the process
dies there is nobody to listen to its binder deaths.

Test: ConnectivityServiceTest
Change-Id: I993cb9481edfaeb652b875be7f90166db16d0e1d

Chalard Jean   commited 2021-10-25 19:24:48 +09:00
a3578a5465
Merge "Qualify references to WifiNetworkSuggestions"
Anton Hansson   authored and   Gerrit Code Review   commited 2021-10-21 11:53:06 +00:00
7ea2767864
Merge "Wait for network to be validated when setting a valid private DNS"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-10-21 11:34:35 +00:00
acd3e2be33
Wait for network to be validated when setting a valid private DNS
The previous design just set a valid private DNS and checked
whether onCapabilitiesChanged() has received and
NetworkCapabilities#isPrivateDnsBroken is false. It cannot ensure
that the private DNS is working until the network is validated.
So change the design to waiting the network to be validated after
setting a valid private DNS.

Bug: 196769780
Test: atest CtsNetTestCases:ConnectivityManagerTest
Change-Id: I9c173a70e2b81788efa2ecbf928acda0379846da

lucaslin   commited 2021-10-21 16:47:26 +08:00
4d441a9b8d
Merge "Add underlying networks into NetworkAgentInfo if any"
Lucas Lin   authored and   Gerrit Code Review   commited 2021-10-21 08:33:29 +00:00
9c9850b944