Commit graph

43,883 commits

Message SHA1
Merge "Remove redundant "using" statement"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-22 08:23:24 +00:00
fa017ea2e4
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 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
Rename one of the two EVENT_NETWORK_TESTED messages.
Currently, there are two EVENT_NETWORK_TESTED message types in
ConnectivityService. One is used by the ConnectivityService
handler to process validation results, and one is used by
ConnectivityDiagnosticsHandler to send connectivity reports.

The two messages have different contents so it is confusing that
they have the same integer and the same name. Rename the second
one to CMD_SEND_CONNECTIVITY_REPORT.

Test: atest ConnectivityServiceTest
Test: atest CtsNetTestCases:android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: I77d63dad477315e1fcc7225a5ef03aff2bed8c35

Lorenzo Colitti   commited 2022-02-19 02:24:02 +09:00
0261ced634
Merge "Don't check validation state in waitForAvailable(..., Network)."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-02-18 17:04:27 +00:00
dbb9280abc
Merge "Fix HostsideVpnTest#testExcludedRoutes"
Taras Antoshchuk   authored and   Gerrit Code Review   commited 2022-02-18 13:25:21 +00:00
d42d1645cb
Run bpf_existence_test in presubmit.
This has been green for a while. On S:

https://android-build.googleplex.com/builds/tests/view?invocationId=I42200010019333308&testResultId=TR79227903031586436

On R:
https://android-build.googleplex.com/builds/tests/view?invocationId=I28900010019347533&testResultId=TR73127903058200457

Test: treehugger
Change-Id: Iece7be238e069c7a71f150893a0f6cc155e7b09b

Lorenzo Colitti   commited 2022-02-18 17:35:04 +09:00
98c83d0148
reduce log level when no interface is present for rate limiting
TestNetworkAgentWrapper does not set the interface name in its
LinkProperties causing logwtf to fail tests on -eng build.

Test: atest FrameworksNetTests:ConnectivityServiceTest on -eng build
Change-Id: Ieba0453ce897aa1052cb98f1de4c7bb099383c8d

Patrick Rohr   commited 2022-02-18 09:18:20 +01:00
a517f20ef0
Skip NetworkStatsServiceTest before T
NetworkStatsService was mainlined in T, so the test does not need to be
run on previous Android versions.

Test: atest CtsNetTestCases:NetworkStatsServiceTest
Change-Id: I8e69746a03ef029b1121cc8fa71e299ac12c2905

Patrick Rohr   commited 2022-02-18 09:18:20 +01:00
e3b067f523
Address comment from aosp/1948169
Bug: 202086915
Test: m; flash; boot;
Change-Id: I9bd627cc4ec77e1ab6da3e3acc7d4d8bba7d43de

Wayne Ma   commited 2022-02-18 14:18:06 +08:00
5545291ef5
Merge "BpfBitmap Test"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-18 01:55:43 +00:00
b194d551bf
Merge "Support "dumpsys connectivity trafficcontroller""
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-17 23:10:10 +00:00
bce8cbabbb
Merge "libclat: Remove redundant "using android::net::.*""
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-17 22:59:44 +00:00
83acb39c6c
Merge changes Iddd50583,I7e6e84ba,If5ade0c0
* changes:
  Improve logging when using ingress rate limits
  Allow test networks to be rate limited
  Fix rate limiting settings observer

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-17 22:14:04 +00:00
c301b4412b
Improve logging when using ingress rate limits
Add some happy path logging that informs about active rate limits.

Test: TreeHugger
Bug: 218840346
Change-Id: Iddd50583ca2e90afe83a5c68611418fa794afb3f

Patrick Rohr   commited 2022-02-17 18:28:58 +01:00
64592df482
Allow test networks to be rate limited
Test: atest FrameworksNetTests
Change-Id: I7e6e84baf446ecf4b395f6a611e625871745a20e

Patrick Rohr   commited 2022-02-17 18:28:58 +01:00
ff3b3f8d96
Fix rate limiting settings observer
The obvserver accidentally observed Settings.Secure instad of
Settings.Global.

Test: atest CtsNetTestCases:RateLimitTest
Bug: 218840346
Change-Id: If5ade0c0e269c01b76428d5635d0913330d7015e

Patrick Rohr   commited 2022-02-17 18:28:58 +01:00
cdac749eb0
Merge "Ensure all NetworkMonitor messages store the netId in arg2."
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-17 17:26:19 +00:00
e7eb8b156f
libclat: Remove redundant "using android::net::.*"
They are already under the same namespace.

Test: presubmit
Bug: 219872355
Change-Id: I5f51cf2c38755c99f220870c2ffe66ee8c454514

Yi Kong   commited 2022-02-17 16:36:13 +00:00
9de79582a2
Ensure all NetworkMonitor messages store the netId in arg2.
All NetworkMonitor messages contain the netId of the source
NetworkMonitor. But the netId is in various places in the
message. It's most frequently in arg2, but sometimes it's boxed
into an Integer in obj, and sometimes it's in another object.

Always pass the netId into arg2. This allows us to write
common code at the beginning of the function that extracts the
netId and nai, and performs common actions on all messages.

Bug: 216567577
Test: atest FrameworksNetTests FrameworksNetIntegrationTests
Test: atest CtsNetTestCases:ConnectivityManageTest
Test: atest CtsNetTestCases:NetworkAgentTest
Change-Id: Idbbe3cddfc5475a2d56df387f840439dc4c9514c

Lorenzo Colitti   commited 2022-02-18 00:28:01 +09:00
d1b11dc70f
Merge "Cleanup and refine connectivity test config"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-02-17 09:45:39 +00:00
3035f6c554
Don't check validation state in waitForAvailable(..., Network).
The version of ConnectivityManagerTest#waitForAvailable that
takes a callback and a Network implicitly requires that the
network be validated, because it calls expectAvailableCallbacks
with validated=true.

This is incorrect because a network can become available without
being validated. In particular, testMobileDataPreferredUids is
flaky due to this problem, because it calls connectToCell, which
does not wait for validation, and then calls waitForAvailable,
which expects that the network is already validated.

Fix it by not requiring any particular validation state. This
method is only used by a few tests and they should not be
affected by this change:
- The first two calls in testSetOemNetworkPreferenceForTestPref
  happen after waiting for validation, so the network is
  validated already. The third call waits for a test network,
  and test networks are always validated.
- The first call in testSetOemNetworkPreferenceForTestOnlyPref
  waits for a test network, which is always validated. The
  second is incorrect because ensureWifiConnected does not
  wait for validation, and is fixed by this CL.
- The calls in testMobileDataPreferredUids similarly incorrectly
  assume that wifi is validated and are fixed by this CL.

Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testMobileDataPreferredUids
Change-Id: I614d0ba87c3931fcbe4011fed379e1736f5c4a44

Lorenzo Colitti   commited 2022-02-17 18:29:11 +09:00
d2bd9db36a
Support "dumpsys connectivity trafficcontroller"
Enable ConnectivityService to dump BPF maps from libtraffic_controller.

Bug: 202086915
Test: adb shell dumpsys connectivity trafficcontroller
Test: atest CtsNetTestCases:ConnectivityManagerTest#testDumpBpfNetMaps
Test: run CTS in I021789813f116940d581e2c4a1fd357ff47bfa08
Change-Id: Ib0e935ee2b714ac61daceba6d13fa7a20f97f68f

Ken Chen   commited 2022-02-17 16:58:47 +08:00
e6d511f785
Merge "DscpPolicyTest Check Kernel Version"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-17 07:15:11 +00:00
5a2f079722
Merge "CTS tests for EthernetNetworkSpecifier"
James Mattis   authored and   Gerrit Code Review   commited 2022-02-17 03:10:36 +00:00
700774f34e
Merge "Add test for IPv4 UDP forwarding rules in BPF map"
Nucca Chen   authored and   Gerrit Code Review   commited 2022-02-17 02:59:07 +00:00
dc62c75b1e
CTS tests for EthernetNetworkSpecifier
Bug: 210485380
Test: atest CtsNetTestCasesLatestSdk
:android.net.cts.EthernetNetworkSpecifierTest

Change-Id: I080bc111aa57c7889a6bf9564b8fc2c1dddd944d

James Mattis   commited 2022-02-16 16:46:49 -08:00
deaeefb283
Merge "Fix NetworkStatsServiceTest after adding deleteKernelTagData"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-02-16 19:59:14 +00:00
3226bfb631
Cleanup and refine connectivity test config
Remove the include for Connectivity/Tethering TEST_MAPPING as there is
no such file in that directory, add comments on ConnectivityModuleTest
usage, and skip the whole NetworkAgentTest on non-connectivity module
MTS runs.

Bug: 218611855
Test: atest CtsNetTestCasesLatestSdk
Change-Id: Id96ab8a5ae631b0c64f20faedd4a0430eb9318d4

Remi NGUYEN VAN   commited 2022-02-16 20:34:31 +09:00
73da478927
Merge "Skip BpfExistenceTest#TestPrograms on BPF unsupported device"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-02-16 11:22:47 +00:00
7d30b56f06
Skip BpfExistenceTest#TestPrograms on BPF unsupported device
BPF is supported after kernel 4.9. Skip the test on BPF
unsupported device. Ex: walleye.

Bug: 219696135
Test: atest bpf_existence_test on walleye
Change-Id: I583a858587c0501582c9e77c8b584b3136312cd5

Hungming Chen   commited 2022-02-16 16:06:59 +08:00
0456900bf2
Add tests for deleteKernelTagData
Test: atest NetworkStatsServiceTest
Change-Id: I6db6b79314868271f877acf2a0b21699cbf02df5

Patrick Rohr   authored and   markchien   commited 2022-02-16 14:23:30 +08:00
f9888898e3
Fix testing with/without connectivity module
Add missing @ConnectivityModuleTest annotations to tests that cover
functionalities that were introduced in a newer connectivity module
update.

Also add CtsNetTestCasesLatestSdk to postsubmit with only APK modules
installed, and with only the connectivity/tethering module installed.
This can then be moved to presubmit to catch such issues before they are
merged.

While doing this cleanup the TEST_MAPPING file in tests/ and merge its
contents into the root TEST_MAPPING file. This does not change anything
for "postsubmit" tests as they are run independently of changes. It only
causes FrameworksNetIntegrationTests to run in presubmit on any change
in modules/Connectivity/ instead of only on modules/Connectivity/tests/
changes, which is how it should be.

Bug: 218611855
Test: TH needs to test TEST_MAPPING
Change-Id: I26629a35d8c2df3db33180ecc22d49d538ad3b8b

Remi NGUYEN VAN   commited 2022-02-16 15:22:30 +09:00
3b81323e4a
Fix NetworkStatsServiceTest after adding deleteKernelTagData
Test: atest NetworkStatsServiceTest
Change-Id: I667a5d86e0df8505fef549e598f3b4141637fb90

Patrick Rohr   authored and   markchien   commited 2022-02-16 14:01:29 +08:00
7c52b69b3e
DscpPolicyTest Check Kernel Version
Check kernel version to ensure current kernel supports
BPF logic for testcase.

Bug: 217209172
Test: atest DscpPolicyTest
Change-Id: I9e0df7d2e4eb320bd5324e2d13410bd960b75174

Tyler Wear   commited 2022-02-16 04:53:19 +00:00
c2926f45f2
Add ThrowableBiConsumer to BpfCoordinatorShim
Change-Id: Iecf001ac6d9f53a64f903f5b8ab069d6be93f50a

Tyler Wear   commited 2022-02-15 16:59:07 -08:00
6d80f10bb3
BpfBitmap Test
Privileged test case for BpfBitmap.

Test: atest BpfBitmapTest
Bug: 179733303
Change-Id: I9c32d8843176815a725eccfd1f0400ec129cd94d

Tyler Wear   commited 2022-02-15 22:19:58 +00:00
c23ffbdf7e
Merge "Add KeepalivePacketData toString()"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-02-15 10:54:37 +00:00
c05d86b850
Merge "Address comment from aosp/1948169"
Wayne Ma   authored and   Gerrit Code Review   commited 2022-02-15 10:33:23 +00:00
622c72ea49
Fix HostsideVpnTest#testExcludedRoutes
One of VpnTest#startVpn overloads didn't propagate "excludedRoutes"
param, due to mistake during conflict resolution in aosp/1941233.

Bug: 214398350
Test: atest HostsideVpnTests --iterations
Change-Id: Icbbe7394f1ff1f676cc671a1fa1c4449f4d585e3

Taras Antoshchuk   commited 2022-02-15 09:14:03 +00:00
0817bb2906