Commit Graph

4468 Commits

Author SHA1 Message Date
Robert Horvath
aa197190c6 Add Low Power Standby test to NetworkManagementServiceTest
Bug: 190822356
Test: atest NetworkManagementServiceTest
Change-Id: I8ee0f5bc77efb94ba04957f68ec9b829d41bff83
2022-02-02 22:54:21 +01:00
Jean Chalard
2bc73d3b18 Merge changes Ic6a1aa92,I685f924a,I50fab91e
* changes:
  Use packBitList to prevent long-related mistakes
  Introduce ensureListenableCapabilities
  Accept accessUids from telephony when it's the carrier config app
2022-02-02 07:40:06 +00:00
Chalard Jean
ac9ace0bbe Accept accessUids from telephony when it's the carrier config app
Test: FrameworksNetTests, new test in this patch
Change-Id: I50fab91e107c51d33a5e529c73b83db198a88d2c
2022-02-02 13:52:25 +09:00
Patrick Rohr
d817436f17 Add libservice-connectivity to integration tests
Test: atest FrameworksNetIntegrationTests
Change-Id: I1548793872bef2f8247558d7d4222cd8162c1601
2022-02-01 14:31:08 +01:00
Treehugger Robot
d36de12652 Merge "Clean up BpfNetMaps" 2022-02-01 12:50:28 +00:00
Ken Chen
f5f51339af Clean up BpfNetMaps
Cleans up BpfNetMaps.java before enabling mainline code path.

Bug: 202086915
Test: atest FrameworksNetTests
Change-Id: I28e5d63ed4624df540b1ca47b71899cff7321ded
2022-02-01 12:31:03 +01:00
Lorenzo Colitti
687c383d78 Fix lint errors in NetworkStatsManagerTest.
Test: atest CtsNetTestCases:android.net.cts.NetworkStatsManagerTest
Change-Id: I45bd097da3c7667138ec81d1de728f78adfae4f7
2022-02-01 11:24:52 +00:00
Lorenzo Colitti
eb8d8554bb Rename NetworkUsageStatsTest and move to networking CTS tests.
NetworkUsageStatsTest is the CTS test for the NetworkStatsManager
public APIs. Rename it to NetworkStatsManagerTest, since that is
a better name for it.

Also move it to the networking CTS tests, where it will run on
presubmit on every supported Android version (S, T), and can
access hidden networking APIs. This is important because
NetworkStatsManager is being mainlined in T.

Bug: 204830222
Test: atest CtsNetTestCases:NetworkStatsManagerTest
Change-Id: Ie0fd267aa8bf94594fcc939a8493bef8ab14d3fe
2022-02-01 11:24:39 +00:00
Treehugger Robot
6ac2893743 Merge "Add ConnectivityFrameworkInitializerTiramisu cts tests" 2022-02-01 11:15:35 +00:00
Treehugger Robot
f36a025f38 Merge "Fix DscpPolicyTest EBADF" 2022-02-01 09:42:23 +00:00
Remi NGUYEN VAN
6a20eeda42 Reorganize connectivity framework dependencies
Allow framework-connectivity to depend on framework-connectivity-t
stubs, and framework-connectivity-t to depend on prebuilt (to avoid
circular dependencies) framework-connectivity stubs to compile its own
stubs, and framework-connectivity.impl to compile its implementation.

Also reorganize jarjar rules so that service and framework jar can use
static libraries in framework-connectivity without packaging their own,
reducing duplicate code.

Bug: 204830222
Test: m
Change-Id: I75c34986e7c479de23cdb2e9b360fa1fede018c9
2022-02-01 13:33:48 +09:00
Maciej Żenczykowski
76709a18e9 Merge changes Ifd6be50a,I857e40c9,I1b9f4fde,Ib3b43cf2
* changes:
  Prevent native_init from starting TrafficController
  Remove libutils dependency from libservice-connectivity
  Merge libtraffic_controller_jni into libservice-connectivity
  [NETD-TC#15] Make ConnectivityService and PermissionMonitor calls BpfNetMaps on T
2022-02-01 03:02:36 +00:00
Jean Chalard
4fcb8ad292 Merge changes Id5e5b911,I8301abad,I7262811a,I658e579b,I7d43ef0e
* changes:
  Expose access UIDs.
  Send access UIDs to netd
  Add accessUids to NetworkCapabilities.
  Clean up restrictions on network agent capabilities
  Sanitize NetworkCapabilities from agent on the handler thread
2022-02-01 00:45:55 +00:00
Lorenzo Colitti
d508855bb9 Merge "Fix kernelToTag import in NetworkStatsFactoryTest." 2022-01-31 13:35:30 +00:00
Wayne Ma
2fde98c87b [NETD-TC#15] Make ConnectivityService and PermissionMonitor
calls BpfNetMaps on T

Since TrafficController moves to mainline module for T, so some netd binder
interfaces revelant to BPF are going to deprecated. Provide JNI APIs to
call TrafficController inside mainline module for T.

Bug: 209935649
Test: atest CtsHostsideNetworkTests
Change-Id: Ib3b43cf2840e02806395af9f1e019ca6fccd032e
2022-01-31 09:19:08 +01:00
Chalard Jean
e6c9527554 Send access UIDs to netd
Test: FrameworkNetTests CtsNetTestCases
Change-Id: I8301abaddf5850071fa23d41e8e736ab7071e299
2022-01-31 17:04:58 +09:00
Chalard Jean
9a30acf744 Add accessUids to NetworkCapabilities.
For now, all entry points reject this. Followup changes
will allow the supported use cases.

Test: new unit tests and CTS for this in this patch
Change-Id: I7262811a2e46336d3bb63c80886fc0578a36da94
2022-01-31 17:04:58 +09:00
Sooraj Sasindran
e9cd2084e4 Allow Carrier app to request for CBS capability
Test: unit test and CTS
Bug: 194332512
Change-Id: I29680b56d790106ad082f1a398c2bddb030f834a
2022-01-30 12:12:17 -08:00
Lorenzo Colitti
f59770f769 Fix kernelToTag import in NetworkStatsFactoryTest.
NetworkManagementSocketTagger#kernelToTag is moving to
NetworkStatsFactory. Fix the import path in the test.

Test: atest FrameworksNetTest
Change-Id: I8797d9e589e68b4980ff5b38ba09d091420d30fd
2022-01-29 21:35:06 +09:00
Patrick Rohr
e3b307e2f8 Fix DscpPolicyTest EBADF
FdEventsReader#stop() calls FdEventsReader#unregisterAndDestroyFd()
which then races against the Os.close() call. If
unregisterAndDestroyFd() gets executed second, it silently ignores the
exception. Removing superfluous Os.close() to fix this.

Test: atest android.net.cts.DscpPolicyTest
Change-Id: I467bbbb29326a1ff5df8565a3e3517a419deec45
2022-01-28 13:19:44 +01:00
Treehugger Robot
c5ad7cd775 Merge "Adjust NetworkStatsServiceTest to mock out the JNI." 2022-01-28 11:51:44 +00:00
Lorenzo Colitti
9fdbb7ec7d Adjust NetworkStatsServiceTest to mock out the JNI.
Test: atest NetworkStatsServiceTest
Change-Id: Icdea9f871199f1e859aef647e5ba3dec7ac02d73
2022-01-28 18:16:39 +09:00
Treehugger Robot
dd5bc74532 Merge "Increase the number of test service names" 2022-01-28 08:08:01 +00:00
Treehugger Robot
2be7b1d5fb Merge "Conditionally disable TetheringApiCurrentLib" 2022-01-28 05:21:22 +00:00
Lorenzo Colitti
82ed9e6058 Allow service JNI in FrameworksNetIntegrationTests.
Add libcom_android_connectivity_com_android_net_module_util_jni
to the JNI libraries for FrameworksNetIntegrationTests. This is
needed for service code (e.g., ConnectivityService,
DscpPolicyTracker) to use JNI.

Test: atest FrameworksNetIntegrationTests
Change-Id: Iebe7ef31057c7a3b10bd7bad42ca74a25fe24473
2022-01-27 12:00:36 +00:00
Tyler Wear
723882126a Process DSCP QoS events for policies
New events to handle adding and removing of DSCP QoS policies.
Async indication sends status back to client if the policy
has been added, failed, or if the policy limit has been
reached.

Bug: 202871011
Change-Id: I7988d22ae625ad0dd415927d2943de4a749e6fb8
2022-01-27 10:19:27 +00:00
Lorenzo Colitti
0c26c9ed37 Allow using BpfMap and TcUtils in unit tests.
Create a Java library that allows the BpfMap class and the
TcUtils class to find their JNI code when they are jarjard to the
package name we use in our unit tests.

Test: atest ConnectivityServiceTest
Change-Id: I2f17b1c366b2b8164eac34b94c9659bc7c0f68e0
2022-01-27 10:18:35 +00:00
Mark Chien
dd26c5709e Merge "Test UidCounterSetMap in NetworkStatsServiceTest" 2022-01-27 10:02:35 +00:00
Remi NGUYEN VAN
1d4e537a2b Increase the number of test service names
Append a random number between 0 and 999999999 to the service name,
instead of 0 to 999 (and historically 0 to 9999). This reduces chances
that a collision can happen, if the test is run simultaneously on
devices on the same network.

Bug: 190249673
Test: atest NsdManagerTest
Change-Id: I14a7a60a45c41b920f50d9ccc4dd3f98fd623c42
2022-01-27 18:49:32 +09:00
Remi NGUYEN VAN
f826bce37a Conditionally disable TetheringApiCurrentLib
The "current" targets are only necessary in branches that can use
non-stable APIs, and can fail to build otherwise.

Apply ConnectivityNextEnableDefaults so they are disabled on such
branches. Also deprecate NetworkStackNextEnableDefaults, so
ConnectivityNextEnableDefaults is used everywhere.

Bug: 190249673
Test: m
Change-Id: I1b152f3cc22f1bed6444d280f0066e480980e949
2022-01-27 18:49:19 +09:00
markchien
8f3917501b Test UidCounterSetMap in NetworkStatsServiceTest
Test: atest FrameworksNetTests
Change-Id: I1ae720fcc3192712b3dcbe69619f97f7df1a1f5e
2022-01-27 17:28:19 +08:00
Junyu Lai
bfdd0f3c3c Merge "[MS59.2] Add unit test for NetworkStatsDataMigrationUtils" 2022-01-27 09:20:10 +00:00
Aaron Huang
85a2ef3dd5 Merge "Change NETWORK_TYPE_5G_NSA reference package" 2022-01-27 08:36:23 +00:00
paulhu
9f247f52e1 Add ConnectivityFrameworkInitializerTiramisu cts tests
- Add cts tests for moudle API in
  ConnectivityFrameworkInitializerTiramisu.

Bug: 206702844
Test: atest CtsNetTestCases
Change-Id: I060a3888ea6591ba6d0a3bec0f0b25516fe41464
2022-01-27 05:33:50 +00:00
Wei Li
c7231f3e79 Merge "Set exclude_kotlinc_generated_files to false explicitly since kotlin reflection is used in some Connectivity test cases kotlin code." 2022-01-27 00:22:49 +00:00
Wei Li
8a177f694a Set exclude_kotlinc_generated_files to false explicitly since kotlin reflection is used in some Connectivity test cases kotlin code.
Property "exclude_kotlinc_generated_files" is recently added to exclude some kotlinc generated files that are not needed if kotlin reflection is not used. Currently it defaults to false since there are test failures(b/213966211) which is in FullScoreTest#testToString and FullScoreTest#testMinMaxPolicyConstants that uses kotlin reflection and fails if exclude_kotlinc_generated_files defaults to true. By setting explicitly exclude_kotlinc_generated_files to false on tests like FullScoreTest#testToString, we will be able to finally default this property to true so the kotlinc generated files can be removed for most modules that don't need them.
Bug: 204888276
Bug: 213966211
Test: atest
FrameworksNetTests: com.android.server.connectivity.FullScoreTest
Change-Id: I4ed2d27c27841cb7127f669c8db34c90b4a41b1f
2022-01-26 18:25:23 +00:00
junyulai
a1bb3a36cd [MS59.2] Add unit test for NetworkStatsDataMigrationUtils
Test: atest NetworkStatsDataMigrationUtilsTest
Bug: 204830222
Change-Id: Ia6e8aec9a828072a2a1e63bec600c2e20d3699b3
2022-01-26 16:53:06 +00:00
Aaron Huang
b4ce0fa9b1 Change NETWORK_TYPE_5G_NSA reference package
NETWORK_TYPE_5G_NSA is moved to NetworkStatsManager

Bug: 210073043
Test: builds, FrameworksNetTests
Change-Id: I9226119ee4f67688a1b4ffdab7e5a86ec0b8e974
2022-01-26 23:41:17 +08:00
Nucca Chen
f8ed984e9c Merge changes Ie826477d,I5125a3ac
* changes:
  [CLATJ#26] ClatCoordinator: reword clatd starting failure logging
  [CLATJ#25] ClatCoordinator: stop clatd process gracefully
2022-01-26 14:50:11 +00:00
Hungming Chen
6fb21144b8 [CLATJ#26] ClatCoordinator: reword clatd starting failure logging
Bug: 212345928
Test: build
Change-Id: Ie826477d27db26cc49d113ec8bfacaaa3006e26e
2022-01-26 12:23:45 +00:00
Junyu Lai
30f06afda3 [MS78.2] Fix NetworkIdentity#Builder crashing on 5G NSA networks
Test: atest NetworkIdentityTest
Fix: 216193400
Change-Id: I00abc97a98dfdf17d5f0c2e6b45d28be9899c5c3
2022-01-26 07:53:57 +00:00
Maciej Żenczykowski
43f9729e90 Merge changes from topic "preparation_fork_clatd_from_system_server"
* changes:
  [CLATJ#24] ClatCoordinatorTest: add basic unit tests
  [CLATJ#23] Close the file descriptor manually
  [CLATJ#22] ClatCoordinator: stop clatd
  [CLATJ#21] ClatCoordinator: start clatd
2022-01-26 00:26:48 +00:00
Maciej Żenczykowski
e1f8ad4d59 Merge changes from topic "libnetworkstats"
* changes:
  Rename libnetdbpf to libnetworkstats
  Copy libnetdbpf from system/net to tethering module
2022-01-25 23:52:06 +00:00
Sooraj Sasindran
d8645e27c7 Merge "Add low latency and high bandwidth network capabilities" 2022-01-25 21:06:16 +00:00
Maciej Żenczykowski
e0904b5a12 Merge "adjust BpfCompatTest now that clatd & netd bpf program have been mainlined" 2022-01-25 19:07:13 +00:00
Maciej Żenczykowski
45f940a9ee adjust BpfCompatTest now that clatd & netd bpf program have been mainlined
The purpose of this test is to verify that the bpfloader related
stuff in the platform is compatible with mainline module bpf .o's.

To be more precise: the test is trying to check that platform/OEM
BPF programs (and, by implication, the platform/OEM bpfloader) have
a struct layout that is known, and thus that BPF programs shipped
in mainline modules will be compatible (with the OEM bpfloader).

(ie. basically this is trying to make sure that the vendor/oem
haven't made incompatible changes to the bpfloader parsed structs,
these can only be extended safely in aosp master)

Since clatd/netd.o have been moved to mainline they are no longer
a useful representation of the state of the platform side of things.
(we'd simply be testing that mainline is compatible with mainline,
which of course it is...)

As such we pick two other bpf .o files that are still shipped
as part of the platform.

Verified on cuttlefish via 'atest CtsNativeNetTestCases':
  x86 CtsNativeNetTestCases
  -------------------------
  CtsNativeNetTestCases (2 Test(s))
  [1/2] BpfTest#bpfStructSizeTestPreT: IGNORED (0ms)
  [2/2] BpfTest#bpfStructSizeTest: PASSED (0ms)

  Summary (Test executed with 1 device(s).)
  -------
  x86 CtsNativeNetTestCases: Passed: 1, Failed: 0, Ignored: 1, Assumption Failed: 0,

  All tests passed!

Note: it's not clear to me if this code can even ever be run on pre-T devices...
but I guess it shouldn't hurt.

Bug: 215718693
Test: atest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1b2d76e5ef95d8e4b94068f5525263653879d1f4
2022-01-25 19:06:51 +00:00
Sooraj Sasindran
f8eb713874 Add low latency and high bandwidth network capabilities
Bug: 194332512
Test: build
Change-Id: I415ca1ba90ea54c4106f806fe855bcb84d3e38ba
2022-01-25 09:35:30 -08:00
Junyu Lai
41483efa02 Merge "[DU09-1]Adding the NetworkStatsCollection Builder" 2022-01-25 16:44:16 +00:00
Junyu Lai
bc8328bda4 Merge "[MS68.2] Adapt NetworkPolicyManagerService to use registerUsageCallback" 2022-01-25 13:30:57 +00:00
Lorenzo Colitti
4e9ab4dde0 Merge "Add a simple test for ConnectivityService#dump." 2022-01-25 13:30:17 +00:00