Commit graph

43,923 commits

Message SHA1
[MS68.4] Address comments at aosp/1958144
Test: atest TrafficStatsTest NetworkUsageStatsTest FrameworksNetTests
Bug: 204830222
Ignore-AOSP-First: merge conflict

(cherry-picked from ag/16811186)

Change-Id: I2578e13e2844591adac1d1902f2454ec7079ceea
Merged-In: I2578e13e2844591adac1d1902f2454ec7079ceea

Frank   commited 2022-03-02 03:09:09 +08:00
eeeb76d3bb
Merge "Add some debugs to diagnose test failure."
Sudheer Shanka   authored and   Gerrit Code Review   commited 2022-03-01 01:05:01 +00:00
87db609348
Merge "Move assumptions out of BeforeClass annotated method"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-02-28 11:07:04 +00:00
d239146987
Merge changes from topic "ms52-movenetstats"
* changes:
  Update API files to unhide MATCH_PROXY.
  Update tests for NetworkStats code move.
  Add setPollForce to module API
  Add JNI stats libraries to apex Android.bp
  Add JNI stats libraries to connectivity
  [MS62.2] Add NetworkStatsService into service initializer
  [MS54.8] Add hiddenapi-unsupported-t.txt to apex Android.bp
  [MS54.3] Move NetworkStats to updatable sources

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-28 05:32:23 +00:00
cebdfba1bb
Update API files to unhide MATCH_PROXY.
Bug: 204830222
Test: m
Ignore-AOSP-First: part of topic with internal-only code
  (cherry-picked from ag/16786006)
Change-Id: I9e11eea30ea9c988498e005c33f173ba2d0a32ec
Merged-In: I9e11eea30ea9c988498e005c33f173ba2d0a32ec

Lorenzo Colitti   authored and   Junyu Lai   commited 2022-02-28 04:17:19 +00:00
9e066c9faf
Update tests for NetworkStats code move.
NetworkStatsFactory is moving from services.core to
service-connectivity-tiramisu. Update FrameworksNetSmokeTests and
FrameworksNetIntegrationTests to depend on the latter instead of the
former.

Test: atest FrameworksNetSmokeTests FrameworksNetIntegrationTests
Ignore-AOSP-First: part of large internal topic to avoid merge conflicts
  (cherry-picked from ag/16786005)
Change-Id: Ie48dac421decf83440b7c88adea18152e05f03bb
Merged-In: Ie48dac421decf83440b7c88adea18152e05f03bb

Lorenzo Colitti   authored and   Junyu Lai   commited 2022-02-28 04:17:13 +00:00
3d52172838
Add setPollForce to module API
The API was test API in S, but this is not supported in module API
surfaces. Make it module API instead.

Ignore-AOSP-First: Avoiding merge conflicts. Cherry-pick will follow
Bug: 197717846
Test: Tests already using this API
  (cherry-picked from ag/16780903)
Change-Id: I53959f0ad4c7a41950e9349d539be82b9166b707
Merged-In: I53959f0ad4c7a41950e9349d539be82b9166b707

Remi NGUYEN VAN   authored and   Junyu Lai   commited 2022-02-28 04:17:06 +00:00
73a61e7c28
Add JNI stats libraries to apex Android.bp
This is separated from ag/16766427 to avoid merge
conflict at downstream branches. For some downstream branches,
the library does not exist and this part is commented out.

Bug: 197717846
Test: atest FrameworksNetTests
Merged-In: Idb6da7ce678fbb3f4839604726cbdbdf223144c1
Merged-In: Iae44344701a3267110e5cbf271120201134d59e5
Change-Id: I9d7f6cea1cdb3c8117e677d8c204e3985295ada0

junyulai   authored and   Junyu Lai   commited 2022-02-28 04:16:58 +00:00
6187e7c79a
Add JNI stats libraries to connectivity
Add new symbols to libservice-connectivity loaded on T only, and the
framework libraries to apex and tests.

Bug: 197717846
Test: atest FrameworksNetTests
  (cherry-picked and splitting apex Android.bp to aosp/1994130)
Change-Id: Iae44344701a3267110e5cbf271120201134d59e5
Merged-In: Iae44344701a3267110e5cbf271120201134d59e5

Remi NGUYEN VAN   authored and   Junyu Lai   commited 2022-02-28 04:16:17 +00:00
d95048929c
[MS62.2] Add NetworkStatsService into service initializer
NetworkStatsService is going to be moved into Connectivity mainlne
module and it will be not visible to SystemServiceResistry after
migration done. Thus, register service in
NetworkStatsServiceInitialalizer and register manager in
ConnectivityFrameworkInitializerTiramisu instead.

Ignore-AOSP-First: Avoiding conflicts; cherry-pick will follow
Test: FrameworksNetTests
      CtsNetTestCases
Bug: 204830222
  (cherry-picked from ag/16727131)
Change-Id: I03d947cc54dd995f6b5b4544ee3bf03cf029d143
Merged-In: I03d947cc54dd995f6b5b4544ee3bf03cf029d143

Junyu Lai   commited 2022-02-28 04:16:07 +00:00
e764686003
[MS54.8] Add hiddenapi-unsupported-t.txt to apex Android.bp
This is separated from ag/16657723 to avoid merge
conflict at downstream branches. For some downstream branches,
the library does not exist and this part is commented out.

Test: TH
Bug: 197717846
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I33e0d699086c87ce8e940036c9a52908bbbcf6c5
Change-Id: I031e5687fa47594b50ca1b40570e01cdec356827

junyulai   authored and   Junyu Lai   commited 2022-02-28 04:15:51 +00:00
4eccfdec89
[MS54.3] Move NetworkStats to updatable sources
This CL builds NetworkStats related codes with the
connectivity module instead of platform.

Test: TH
Bug: 197717846
Change-Id: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c
Merged-In: I4eeb7ea9cfc3139991caf0fc22474e0052a0391c

Junyu Lai   commited 2022-02-28 03:24:19 +00:00
eb6f4bef96
Merge "Fix HostsideVpnTests flakyness"
Taras Antoshchuk   authored and   Gerrit Code Review   commited 2022-02-25 12:02:13 +00:00
116bd6e1a2
Merge "Notify linkproperties change in all scenarios"
Mark Chien   authored and   Gerrit Code Review   commited 2022-02-25 11:13:12 +00:00
cc0dc24205
Notify linkproperties change in all scenarios
In scenarios where linkproperties event is received on default internet
callback, linkproperties are cached and network state is updated with
new link properties but Tethering class is notified about the change.
Later when event is received on mobile request or listen all cb, since
the network state is already updated with these linkproperties, change
in link properties will not be notified. This results in tethering
failures where the ip addresses of the tethering interface will not be
updated.

This change handles this issue by triggering the link properties change
in all scenarios.

Update the correponding test case as well.

Tests: Builds, Boots, TetheringTests
Bug: 216281561
Change-Id: I7452ed07d2665843c86141764b71aab0c00417fe

Pavan Kumar M   commited 2022-02-25 12:29:10 +05:30
68e96aba07
Merge "Make sure the right NetworkMonitor start method is called on S-/T+"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-25 02:23:09 +00:00
894912c85e
Merge "only account for ingress packets addressed to us"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-24 22:45:52 +00:00
333c34c434
only account for ingress packets addressed to us
Test: builds && boots
Change-Id: I06c537dc1488e7f36e474760ab49dc299347003d

Patrick Rohr   commited 2022-02-24 14:12:32 +01:00
148aea8e69
Merge "Fix a flake where network caps change innocuously."
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-24 11:53:04 +00:00
da5e11c95f
Add some debugs to diagnose test failure.
Bug: 218308105
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: I096258d8c55cf56478015a655b5f3be19f29ace1
Merged-In: I096258d8c55cf56478015a655b5f3be19f29ace1

Sudheer Shanka   commited 2022-02-23 20:37:30 +00:00
5f09f8da8c
Merge "Fix rate limit API review comments"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-02-23 18:39:23 +00:00
a45195924e
Move assumptions out of BeforeClass annotated method
Assumptions that are placed in BeforeClass annotated methods are not
reported correctly. See b/203722419 for more information.

Test: atest RateLimitTest
Bug: 220801455
Change-Id: Ia7f0eaddc75d0ee091e107615f1677c75865dbcb

Patrick Rohr   commited 2022-02-23 10:53:20 +01:00
9fa0b3bf18
Merge "Add proper kernel support assumption to RateLimitTest"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-02-22 20:43:22 +00:00
3dd5cc1631
Fix a flake where network caps change innocuously.
Caps are changing before the code is checking for no callback,
but the network is not validating ; something like RSSI or
link speed has been updated, which is fine as long as the
network doesn't validate.

Test: ConnectivityManagerTest
Change-Id: Ie9a167d3599b0157cc1cf6e93c36e9689e9cc2e0

Chalard Jean   commited 2022-02-23 04:52:04 +09:00
c46c3b55da
Merge "Fix : recent Connectivity module with old NetworkStack module"
Jean Chalard   authored and   Gerrit Code Review   commited 2022-02-22 19:32:54 +00:00
b30e957777
Make sure the right NetworkMonitor start method is called on S-/T+
Test: ConnectivityServiceTest
Change-Id: I6a7f0143082236e30d2e3878147df2c921ff5539

Chalard Jean   commited 2022-02-23 04:31:26 +09:00
cd8210843f
Add proper kernel support assumption to RateLimitTest
As it turns out, /proc/config.gz can be accessed via shell command from
within a CTS test. This adds a proper kernel support check for the
RateLimitTest.

Bug: 220801455
Test: atest RateLimitTest
Change-Id: I4d3a6848c1c05c313cb74b235294cee982eecf57

Patrick Rohr   commited 2022-02-22 15:55:30 +01:00
2140575fce
Merge "Run CTS EthernetNetworkSpecifier in 12"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-22 12:47:12 +00:00
7a195e16c6
Merge changes Ie68356a4,I2b63c24b
* changes:
  Attempt to deflake NetworkAgentTest#testRejectedUpdates.
  Fix a couple of JavaDoc errors in NetworkAgentInfo.

Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-22 10:41:37 +00:00
d6a5303cd8
Merge changes Ib1cd342a,Iab23d414
* changes:
  Add an IS_DESTROYED flag to FullScore.
  Use MessageUtils instead of hardcoded strings in policyNameOf.

Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-22 09:26:38 +00:00
1c5ce5542a
Merge "Mock more resources for VPNs."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-22 09:10:42 +00:00
16040b1833
Attempt to deflake NetworkAgentTest#testRejectedUpdates.
This test is highly flaky in presubmit with error messages that
look like:

java.lang.AssertionError: Did not receive callback after 200ms

The test itself looks correct, so it's possible that 200ms just
isn't enough time for the callbacks to be delivered. Set the
timeout to DEFAULT_TIMEOUT_MS like most of the other
TestableNetworkCallbacks in this class.

Fix: 218389790
Test: test-only change
Change-Id: Ie68356a48e9618e5fea3865aa06bfbfc457b89c4

Lorenzo Colitti   commited 2022-02-22 18:04:31 +09:00
e3ef5a8024
Merge "Remove redundant "using" statement"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-22 08:23:24 +00:00
fa017ea2e4
Add an IS_DESTROYED flag to FullScore.
This is being added as the lowest priority score factor, just
above the tie-breakers. It ensures that a network that has been
destroyed will lose to another identical network that has not
been destroyed, but will otherwise be scored identically.

The flag is a CS-managed flag that is stored in NetworkAgentInfo.
Currently it is always false, but it will be populated in
future CLs.

Bug: 216567577
Test: atest FrameworksNetTests
Change-Id: Ib1cd342ab7dfc4df45715da19b743d711fe8d605

Lorenzo Colitti   commited 2022-02-22 16:39:44 +09:00
8c7a8860f9
Fix a couple of JavaDoc errors in NetworkAgentInfo.
These don't break compilation because NetworkAgentInfo doesn't
expose any APIs and thus doesn't generate javadoc, but they
are flagged by the IDE.

Test: treehugger
Change-Id: I2b63c24b2afbc98950f53c38f80d27474aab0622

Lorenzo Colitti   commited 2022-02-22 16:39:44 +09:00
38bbdbd1aa
Remove redundant "using" statement
Test: presubmit
Bug: 219872355
Change-Id: Ie4fc87e5231e31799644c26943bbc13000091e92

Yi Kong   commited 2022-02-22 13:37:51 +08:00
38c4cd90db
Fix EthernetTetheringTest testTestNetworkUpstream flaky
The test assume the first tethering upstream would be test network. But
if there are mutiple networks available, this is a wrong assumption
because of race condtion. If tethering choose upstream while wifi or
celluar is available but test network may not available for tethering yet
(it depend on the NetworkCallback from ConnenectivityService), the first
upstream may not be the test network.

Bug: 215224286

Test: atest EthernetTetheringTest
Change-Id: Idfa972008643f1fb5119179383b06e2c8f65c667

markchien   commited 2022-02-22 12:42:15 +08:00
95cb089853
Merge "Mock resources used directly by LockdownVpnTracker."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-22 01:59:20 +00:00
2606d9c862
Mock more resources for VPNs.
These also cause ConnectivityCoverageTests to fail when built
from master and run on S. They are used in Vpn.java, not
LockdownVpnTracker.

They were not addressed in the previous CL because running this
test locally is difficult.

Test: forrest
Change-Id: I7d687338fd6bc7468b1abcae58898322554e647b

Lorenzo Colitti   commited 2022-02-22 10:17:09 +09:00
93a72d22a5
Mock resources used directly by LockdownVpnTracker.
LockdownVpnTracker directly uses resources from
com.android.internal.R. This is acceptable because it's platform
code. But ConnectivityServiceTest uses the LockdownVpnTracker
built from the module source tree, and when that code fetches
resources on a previous Android release, it crashes because the
resource IDs don't exist; non-public resource IDs aren't stable.

Fix this by mocking the resources used by LockdownVpnTracker.

Test: atest ConnectivityCoverageTests
Change-Id: I239a18a38d4f1082f76f5ff1b831c15ee753bdfd

Lorenzo Colitti   commited 2022-02-22 10:13:24 +09:00
19e6171926
Merge "CTS for ingress rate limiting"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-02-21 19:57:37 +00:00
c6cf669b8d
CTS for ingress rate limiting
This test creates a TUN interface and registers it with
ConnectivityService. For 15 seconds, it continuously writes data to that
interface and measures at what rate it is received.

Data accounting is currently not covered by this test.

Test: atest RateLimitTest
Bug: 172053704
Change-Id: I74f891f3b7113855375c48a10cefbfe47221931b

Patrick Rohr   commited 2022-02-21 18:05:21 +01:00
96c1ff4ae9
Remove out-of-date comment.
Test: m
Change-Id: I1575c85c382b4fb9e9e3c04b5e70dab55cef4c60

Lorenzo Colitti   commited 2022-02-21 12:50:11 +09:00
85c1765b01
Merge "Run bpf_existence_test in presubmit."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-21 03:45:33 +00:00
b81abf3abe
Merge "Rename one of the two EVENT_NETWORK_TESTED messages."
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-21 00:22:11 +00:00
4b654c9038
Merge "reduce log level when no interface is present for rate limiting"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-19 21:31:05 +00:00
19ce06b05f
Merge "Skip NetworkStatsServiceTest before T"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-19 20:20:24 +00:00
fc67ee8c71
Merge "Add tests for deleteKernelTagData"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-19 20:20:24 +00:00
8bf31e8061
Fix : recent Connectivity module with old NetworkStack module
This patch adjusts the behavior of the NetworkMonitor mock
to behave the same way as the real one – accept either
notifyNetworkConnected or notifyNetworkConnectedParcel as
a signal a network is connected. This is necessary because
the Connectivity module will call either of these depending
on versions of other software it finds on the device.

Test: ConnectivityServiceTest
      NetworkMonitorTest
Change-Id: I5900a019b3b033f4365d8a82b1e522336012064e

Chalard Jean   commited 2022-02-19 20:43:14 +09:00
a14b3f2184
Use MessageUtils instead of hardcoded strings in policyNameOf.
This makes the code easier to maintain because we do not need to
manually add string representations, and because it will throw at
static initialization time if the clas contains duplicate
POLICY_xxx values. The memory overhead is likely negligible.

Bug: 216567577
Test: new coverage in FullScoreTest
Change-Id: Iab23d414c8e28ff7f26060ad44fa996f277d361f

Lorenzo Colitti   commited 2022-02-19 19:45:43 +09:00
c6d3f3cf25