Commit Graph

3778 Commits

Author SHA1 Message Date
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
Hungming Chen
358d582730 [CLATJ#24] ClatCoordinatorTest: add basic unit tests
Introduce ClatCoordinatorTest for unit tests of class ClatCoordinator.
Add the tests:
- testStartStopClatd
- testGetFwmark
- testAdjustMtu

Bug: 212345928
Test: atest FrameworksNetTests
Change-Id: I6908eac05b14077b450d51e1432d340c8a247eb1
2022-01-25 20:32:25 +08:00
Frank
c8856596c5 [DU09-1]Adding the NetworkStatsCollection Builder
The purpose is provide NetworkStatsCollection.Builder as
public API for adding the stats {@link NetworkStatsHistory}

Bug: 215862801
Test: atest NetworkStatsCollectionTest
Change-Id: Id83c6fa67880ba361b8e0e15c4d86b90e44ac879
2022-01-25 19:43:23 +08:00
Mark Chien
7586d33f22 Merge "Replace some netd calls in NetworkManagementService" 2022-01-25 03:34:54 +00:00
Mark Chien
f3cf7c00a6 Merge "Replace INetd#trafficSwapActiveStatsMap with ConnectivityManager API" 2022-01-25 03:34:14 +00:00
Junyu Lai
3f9584bfda Merge "[MS67.2] Modify tests for registerUsageCallback" 2022-01-25 01:23:45 +00:00
Maciej Żenczykowski
d512ec646c Merge "Add unit test for BpfInterfaceMapUpdate" 2022-01-24 19:05:28 +00:00
Sooraj Sasindran
0311ea0bc6 Merge "Add support for Multiple enterprise slice" 2022-01-24 16:26:03 +00:00
junyulai
0a007c248c [MS68.2] Adapt NetworkPolicyManagerService to use registerUsageCallback
This change also address comments at aosp/1958145.

Test: atest FrameworksNetTests
Bug: 204830222
Change-Id: I415d74df34caa91b1e1160478ebff30fbd1c7b6f
2022-01-24 22:12:42 +08:00
junyulai
f8a1d3e5e6 [MS67.2] Modify tests for registerUsageCallback
Test: atest FrameworksNetTests
Bug: 204830222
Change-Id: Ia4ff535cd703807516d65b582727684cbb670360
2022-01-24 18:59:23 +08:00
Ken Chen
f426b2b287 Rename libnetdbpf to libnetworkstats
Two reason for renaming:
1. Avoid module name collision in sc-mainline-prod branch.
2. The libnetdbpf was misnamed before.

Bug: 202086915
Test: atest libnetworkstats_test FrameworksNetTests
      ConnectivityCoverageTests FrameworksNetSmokeTests
      CtsAppOpsTestCases
Change-Id: I87fcf4b1a9d58780a45743a9aa91b9b936e54266
2022-01-24 11:53:59 +08:00
Junyu Lai
6d95db48d0 [MS56.2] Add unit test for NetworkStatsHistory#Builder
Test: atest NetworkStatsHistoryTest#testBuilder
Bug: 204830222
Change-Id: Id876340bcab7290d5e191dbdfcce7fb4d8ecf96c
2022-01-23 20:52:31 +08:00
Junyu Lai
84413a92c3 [MS65.4] Address comments at aosp/1954383
Test: atest NetworkIdentityTest#testBuilder
Bug: 204830222
Change-Id: I3d0f8175ee782c76839cbbdb5eb8a1219a61d874
2022-01-23 20:52:31 +08:00
Sooraj Sasindran
f4a58dcd45 Add support for Multiple enterprise slice
Bug: 194332512
Test: unit test
CTS-Coverage-Bug: 211133973
Change-Id: Ie8be08a7cfa9155168d1da146d02fd1643248bdc
2022-01-22 14:39:40 -08:00
Les Lee
c71f2d7425 wifi data usage: Update calling API name
Bug: 213387087
Test: atest -c NetworkTemplateTest
Test: atest -c NetworkStatsServiceTest
Test: atest -c FrameworksWifiApiTests
Test: atest -c NetworkPolicyManagerServiceTest
Change-Id: I6f65af5e2ff121a2fe5b2429d3eead01e434f8be
Merged-In: I6f65af5e2ff121a2fe5b2429d3eead01e434f8be
2022-01-23 00:07:02 +08:00
Sooraj Sasindran
a2e98bdc1a Merge "Ability to specify which all applications fall under enterprise slice." 2022-01-21 16:01:44 +00:00
markchien
adf119a8ed Add unit test for BpfInterfaceMapUpdate
Bug: 215095957
Test: atest FrameworkNetTests

Change-Id: I92d45e5a606f466ce42504629cb3f87fd9e25d22
2022-01-21 23:34:25 +08:00
markchien
f243be2267 Replace some netd calls in NetworkManagementService
This is the corresponding test change with netd usage replacement
in NetworkManagementService.

Bug: 209935649
Test: atest NetworkManagementServiceTest

Change-Id: Id25f2d7d291eef7c8bb12a7fcf67b1619cce6da5
2022-01-21 17:49:29 +08:00
Junyu Lai
7f3f9c1be0 Merge "[MS65.2] Add unit test of NetworkIdentity#Builder" 2022-01-21 09:36:08 +00:00
Sooraj Sasindran
499117f279 Ability to specify which all applications fall under enterprise slice.
Bug: 194332512
Test: unit test
Change-Id: I94549a41aaa717add22b0a3e5035beacf6f1b8f2
2022-01-21 01:05:12 -08:00
Frank Li
413a3b1306 Merge "[DU03-2]Remove INetworkStatsService from BatteryStatsImpl" 2022-01-21 08:15:25 +00:00
markchien
daf30ef9a8 Replace INetd#trafficSwapActiveStatsMap with ConnectivityManager API
This is the corresponding test change with INetd#trafficSwapActiveStatsMap
usage replacement.

Bug: 209935649
Test: atest NetworkStatsFactoryTest
Change-Id: Ic5e29f6a928c4230322ed658fe8ddbd71d7ea56a
2022-01-21 16:02:26 +08:00