Commit graph

52,071 commits

Message SHA1
Merge "Bump Mainline Module Version Codes in AOSP to 339990000"
Alexei Nicoara   authored and   Gerrit Code Review   commited 2022-05-31 14:17:23 +00:00
7884a2f2b8
Merge "Remove unused variable"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-05-31 01:30:56 +00:00
913b20ba5f
Run libclat_test in presubmit
This has been green for a while.

On postsubmit:
https://android-build.googleplex.com/builds/tests/view?testResultId=TR59428013832586062&invocationId=I95700010046253101

Test: treehugger
Change-Id: I343fa24603df493c785e462a6449eb1129f08c11

Hungming Chen   commited 2022-05-30 16:21:49 +08:00
2e6d107ecc
Merge "Test testTetherUdpV4AfterR only verify bpf in precise kernel range"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-27 19:03:58 +00:00
875daa69eb
Merge "Add traffic_controller, networkstats, netd_updatable tests to MTS."
Ken Chen   authored and   Gerrit Code Review   commited 2022-05-27 17:46:54 +00:00
93ea4c3f5c
Add traffic_controller, networkstats, netd_updatable tests to MTS.
In order to get counted by mts code coverage, these native tests need to
be run as part of mts.

Bug: 233904825
Test: m mts && mts-tradefed run mts-tethering-coverage
Change-Id: I79313197b146c7043ffb5e164faa46c2e16dd1d2

Ken Chen   commited 2022-05-27 15:00:18 +00:00
b9266bf507
Test testTetherUdpV4AfterR only verify bpf in precise kernel range
Use three-part kernel version numbers to check which device
needs to verify BPF offload. Only check major and minor number
is not enough. Ex: mixed build T + R may have an unsupported kernel
version 4.19.160 (require 4.19.176+). Now check the subminor
number as well.

For UDPv4 support, kernel require 4.14.222+ 4.19.176+ 5.4.98+, 5.8.0+

Test: atest EthernetTetheringTest (raven @ internal master build)
Test: cts test (bramble @ T + R mixed build)
> run cts-on-gsi -m CtsTetheringTest -t android.net.EthernetTetheringTest#testTetherUdpV4AfterR

Bug: 232332847
Change-Id: I466df73b0fa35b086a2c5e11f8624c84eb79c8fd

Hungming Chen   commited 2022-05-27 22:15:24 +08:00
d7e713283d
Merge "Fix crash when decrementing data usage request"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-27 10:02:33 +00:00
019e6eb2d7
Fix crash when decrementing data usage request
When unregistering, if the caller process is dead. The system
can unregsiter for the caller. But the request decrement should
be counted onto the caller uid instead of system uid.

Test: NetworkStatsObserversTest#testUnregister_knownRequest_invalidUid_doesNotUnregister
Bug: 233580307
Change-Id: I85aee8f395739929bc7086883ace81ac1ecd0730
Merged-In: I85aee8f395739929bc7086883ace81ac1ecd0730
  (pure cherry-picked from ag/18579047)

Junyu Lai   commited 2022-05-27 09:50:52 +00:00
a1970dafa1
Remove unused variable
Clean up to remove unused variable.

Change-Id: Iad05d6db2fccdaff7419de02b29d74a18b00c3b4
Test: TH

Chiachang Wang   commited 2022-05-27 08:24:19 +00:00
589bfc1c04
Add some non-connectivity-module-test back to ConnectivityCoverageTests
In S, the tests are listed in the non-connectivity-module-test
where their testing files are not in the connectivity module.
But some files move into the connectivity module in T. So some
tests can be removed from non-connectivity-module-test and will
be running on ConnectivityCoverageTests to count their code
coverage.

Also update some tests to make them compatible with
mockito-extended and ignore some tests which need to test with
T apis.

Bug: 234000451
Test: atest FrameworksNetTests ConnectivityCoverageTests
Change-Id: I47fb59334d00ae7fee91c5694548b3cf89b09b2d

Paul Hu   commited 2022-05-27 07:16:46 +00:00
516d5dc0ea
Merge "CTS test for EthernetNetworkUpdateRequest"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-27 00:46:06 +00:00
30809dc4a1
Merge "Remove duplicate postsubmit."
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-27 00:35:15 +00:00
81b2bd2d7c
Merge "Changing target_sdk for CtsNetTestCasesLatestSdk"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-26 10:47:01 +00:00
44ad28052c
Changing target_sdk for CtsNetTestCasesLatestSdk
Bug: 233553525
Test: Presubmit

Changing target_sdk of or CtsNetTestCasesLatestSdk to 33 to match with apps target_sdk

Change-Id: Id786f64956d52307e15b3cd3feaa02d585e7623e

preranap   commited 2022-05-26 03:00:02 +00:00
7a1639ff5f
Merge "Adding missing dependency for api23Test"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-25 23:06:58 +00:00
433f594bb6
Merge "bpf programs: switch from integers to #define'd bpfloader versions"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-25 18:38:27 +00:00
fb2dd8d15c
Adding missing dependency for api23Test
Bug: 226950040
Test: Presubmit
Change-Id: I194d31e7b11b1a5efb652e2cecd3624a79d307a9

jahinimtiaz   commited 2022-05-25 17:02:46 +00:00
43d6a01d3b
Merge "Revert "NetworkRequest.Builder should create a defensive copy of capabilities""
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-05-25 02:36:45 +00:00
ec966d6528
Merge "Remove automotive restriction from enable/disableInterface"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-05-25 02:00:51 +00:00
345655f7bc
Merge "Skip VPN filtering tests on unsupported versions"
Motomu Utsumi   authored and   Gerrit Code Review   commited 2022-05-25 01:22:16 +00:00
badf2ebed7
bpf programs: switch from integers to #define'd bpfloader versions
(per request from Lorenzo)

We do bump block/clatd/dscp_policy requirements from 0.12 to 0.13,
but this effectively doesn't matter:

- Beta2 is too old either way (pre-0.12)
- Beta3 is new enough (0.13)
- versions in between are simply obsolete / unused / not important
- bpfloader 0.12 won't boot right anyway due to lack of netd maps/programs
  (which cause a netd startup failure)

This allows us to have one less #define in the header files,
with a hard to write explanation about what exactly v0.12 is (or was).

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1ecf15f9d7abbb82ec6bd49848255fab6a41aed4

Maciej Żenczykowski   commited 2022-05-24 16:11:09 -07:00
f769952212
BpfNetMaps - minor jni code fixups
(a) jni static methods take 'jclass clazz' as 2nd argument,
while non-static methods take 'jobject this/thiz/self'

(b) use a macro for error handling to remove duplicate code

(c) also fix some whitespace

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2773617dc7129efb87e28266f97ec3e01a35efc3

Maciej Żenczykowski   commited 2022-05-24 16:01:12 +00:00
932ef5b220
Skip VPN filtering tests on unsupported versions
Lockdown filtering rule and interface filtering rule with null interface
were introduced to T+ devices.
So, skip related tests in pre-T devices.

Bug: 232902954
Test: atest ConnectivityServiceTest
Change-Id: I9ee76096c1bd04c9333bc561ffc8064a14780ce5

Motomu Utsumi   commited 2022-05-24 13:41:36 +00:00
ca314e7f77
Revert "NetworkRequest.Builder should create a defensive copy of capabilities"
This reverts commit f1ab80ea62.

Reason for revert: DroidMonitor: Potential culprit for Bug 233698500 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.

Change-Id: I7de63e0a3656194b94b29e28862c62fc300dfdfa

Iván Budnik   commited 2022-05-24 09:24:16 +00:00
6373153fcd
Fix incorrect sdk version check in SCV2 device test
Test: atest ConnectivityCoverageTests:com.android.networkstack.tethering.OffloadControllerTest
Bug: 229190480
Change-Id: I4e37a9d6634daac14ef41ab30ab986b2e96dacd4

Frank   commited 2022-05-24 13:55:03 +08:00
a632356e05
Remove automotive restriction from enable/disableInterface
Allow calling enable/disableInterface on non-automotive devices. Also,
fixing the naming of these functions to be consistent with the API.

Test: atest EthernetManagerTest
Bug: 171872016
Bug: 225317990
Change-Id: Ic20185a855d0e639582132bf1103e0183f6f78c3

Patrick Rohr   commited 2022-05-24 03:54:38 +00:00
fd829a5cb2
Merge changes I8e806b3b,I5e8e4673,Id2a078da
* changes:
  Add CTS tests for EthernetNetworkProvider changes
  Move EthernetNetworkFactory to using the NetworkProvider API
  Improve waiting for interface added or removed

Patrick Rohr   authored and   Gerrit Code Review   commited 2022-05-24 03:34:25 +00:00
826bdb3ec4
Merge "remove spurious newlines on ALOG lines"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-05-24 00:09:43 +00:00
7ded34d8fc
Add CTS tests for EthernetNetworkProvider changes
Adds CTS test to validate behavior of EthernetNetworkProvider API.
These tests are currently still pretty slow due to the fact that newly
registered tracked interfaces are brought up, back down, and back up
before they are available (this is a bug and will hopefully get fixed in
the near future).

Test: atest EthernetManagerTest
Bug: 197548738
Change-Id: I8e806b3b884f2e0b6c1a1d2fffdb9a99c5dd60e8

Patrick Rohr   commited 2022-05-23 16:50:26 -07:00
97bdb655d9
Move EthernetNetworkFactory to using the NetworkProvider API
This CL makes EthernetNetworkFactory inherit from NetworkProvider rather
than NetworkFactory. The name of the class is purposefully unchanged to
make the code review easier (it will be changed to
EthernetNetworkProvider in a follow up).

As part of the conversion, NetworkInterfaceState now registers a
NetworkOffer when the link comes up and unregisters it when the link
goes down. It updates the existing offer when capabilities change (by
calling registerNetworkOffer with an already registered
NetworkOfferCallback).

This change should fix existing refCount issues. When a NetworkOffer is
first registered, it receives callbacks for all existing requests. This
is the main problem with the NetworkFactory implementation where only
one NetworkOffer is registered when the factory is first created; so
when interfaces come up, they do not receive callbacks for existing
requests.

Test: atest EthernetNetworkTest
Bug: 197548738
Change-Id: I5e8e4673d2ed04bc1a0c8d232a8772edfff65b5d

Patrick Rohr   commited 2022-05-23 15:07:36 -07:00
daca9ca74f
Merge changes I28429c92,Ibb0cc4c8
* changes:
  Remove the redundant sleep after turning on the screen.
  Keep the screen on while the test activity is on top.

Sudheer Shanka   authored and   Gerrit Code Review   commited 2022-05-23 21:16:35 +00:00
c916f3dafe
remove spurious newlines on ALOG lines
(for consistency with rest of code base)

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5660615f24daf4285e2b6cbacecb7cd99061c5f5

Maciej Żenczykowski   commited 2022-05-23 20:53:12 +00:00
e0f5846897
Merge "[NetworkStats] Return error on invalid value"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-05-23 20:34:31 +00:00
1d39535bd6
Remove the redundant sleep after turning on the screen.
We are checking for network access in onResume(), which
wouldn't be called until the screen is on. So, there
shouldn't be a need for the extra sleep after turning
on the screen.

Also, remove redundant waits after the last try when
doing verifications as the test is anyway to going to
fail at this point.

Bug: 231440256
Test: atest tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java
Change-Id: I28429c929142a95c19b1f8a5b7d28b9c8c4a45b9
Merged-In: I28429c929142a95c19b1f8a5b7d28b9c8c4a45b9

Sudheer Shanka   commited 2022-05-23 20:10:06 +00:00
c2edb9cbc4
Keep the screen on while the test activity is on top.
Bug: 231440256
Test: atest com.android.cts.net.HostsideConnOnActivityStartTest
Change-Id: Ibb0cc4c8a7cc2338ca938c775706f6b779fa96d3
Merged-In: Ibb0cc4c8a7cc2338ca938c775706f6b779fa96d3

Sudheer Shanka   commited 2022-05-23 20:07:54 +00:00
d1affb65da
Merge "Throw IAE when Network's LinkProperties is null"
Yan Yan   authored and   Gerrit Code Review   commited 2022-05-23 17:24:07 +00:00
5345fa1144
[NetworkStats] Return error on invalid value
Configuration map index 1(CURRENT_STATS_MAP_CONFIGURATION_KEY) can only
have value 0(SELECT_MAP_A) or 1(SELECT_MAP_B). Return error if it is any
other values. Otherwise, read out of array boundary can cause memory
corruption or security issues.

Bug: 231420457
Test: TH
Change-Id: Ia800ad78781f72b8118469c0230cc550796d334e

Ken Chen   commited 2022-05-23 22:27:40 +08:00
322ffcb724
Merge "Fix test failure on S image + S module"
Paul Hu   authored and   Gerrit Code Review   commited 2022-05-23 13:45:58 +00:00
d6446263ce
Merge "Fix NsdManagerTest failures"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-05-23 02:19:36 +00:00
6235f6490e
Fix NsdManagerTest failures
- NsdManagerTest would fail on R device because the
  android.net.TestNetworkSpecifier is not existed when creating a
  test networks. Test networks are only used for those target T+
  tests. Thus, only create the test networks on T+ devices.
- Those target T+ NsdManagerTest would fail on S image because
  aosp/2098750 updated ConstantsShim to 33, so the
  ConstantsShim.VERSION check will be true. Then these tests
  will run on S image but fails with no api found. Thus, the
  pre-check should include platform check(T+).

Bug: 233200200
Bug: 232813132
Test: atest CtsNetTestCasesLatestSdk:android.net.NsdManagerTest\
      on R & S devices.
Change-Id: I246194e6e266a5e75d2f7053e0aa02ff06f11097

paulhu   authored and   Paul Hu   commited 2022-05-22 14:22:52 +00:00
2b89ae5fbb
Throw IAE when Network's LinkProperties is null
Improve the setUnderlyingNetwork method by throwing IAE
when Network's LinkProperties is null. Also update the
API doc to give caller more guidance in using this API

Bug: 232309601
Test: UT: IpSecServiceParameterizedTest, IpSecServiceTest,
      IpSecServiceRefcountedResourceTest, IpSecManagerTest, VpnTest
Test: CTS: IpSecManagerTest, IpSecManagerTunnelTest, Ikev2VpnTest
Test: make doc-comment-check-docs
Change-Id: Idab4706b0db42ed2222fb48b168589ed005d2f2f

Yan Yan   commited 2022-05-20 17:03:07 -07:00
be3eb3d56a
Merge "NetworkRequest.Builder should create a defensive copy of capabilities"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-05-20 22:49:32 +00:00
e19ca2ac69
Improve waiting for interface added or removed
In a previous CL, code was added to wait for interfaces being properly
registered with the EthernetTracker before continuing the test. The same
logic applies to removingInterfaces (which prevents a previous tests
Lost callbacks to show up in a subsequent test).
The createInterface listener was improved to expect the down callback
first. EthernetTracker receives down and up callbacks from netd which it
posts on its handler. While the initial up-up callbacks (KI) can be
flaky, down-up should always be the correct signal that the interface is
ready and properly registered with the ethernet code.

Test: atest EthernetManagerTest
Bug: 227008268
Change-Id: Id2a078da732009411934166df7ae08bedd17a19d

Patrick Rohr   commited 2022-05-20 12:48:08 -07:00
3c089e67f1
NetworkRequest.Builder should create a defensive copy of capabilities
This broke my tests in unexpected ways as creating a new
NetworkRequest.Builder() changed the static request object.

Test: TH && atest EthernetManagerTest
Change-Id: Ia6c39145cf92a2795f7fc2f4efbcb46d193f6b72

Patrick Rohr   commited 2022-05-20 12:00:36 -07:00
f1ab80ea62
Merge "fix BpfMapTest"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-05-20 07:44:13 +00:00
e273ba1e21
Merge "Always wait for interface to be up in EthernetManagerTest"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-05-20 05:53:00 +00:00
adf8f72856
Merge "Move ipconfig file inside apex data directory"
Xiao Ma   authored and   Gerrit Code Review   commited 2022-05-20 05:43:40 +00:00
56c6392586
Always wait for interface to be up in EthernetManagerTest
Adds a global listener that is used to wait for an interface to show up
in EthernetTracker when it is newly created. This prevents races when
the interface is used directly after creation.

This test should fix the testCallback flakes.

Test: atest EthernetManagerTest
Bug: 227008268
Change-Id: I37d2ec63aea9f4de6010e13150bc236ee07e2f85

Patrick Rohr   commited 2022-05-19 20:21:44 -07:00
5f45a3742a
Move ipconfig file inside apex data directory
In order to support rollbacks, the ethernet ipconfig file needs to be
written to the data apex's data directory. We still need to support
reading from the legacy location to be backwards compatible.

If the apex file path already exists, then read the IP configuration
from there directly, otherwise, check if the legacy file path exists,
if yes, read the legacy IP configuration and copy it to the new apex
file path.

Support for default IpConfiguration is also being removed in this CL.
The default IpConfiguration (configuration entry for interface "0")
was a way to transition from supporting a single interface to
supporting multiple interfaces and was introduced in P. Every device
that has used such a configuration and has connected to an ethernet
network since upgrading to P+ has already removed the "0" config and
has assigned it to the first interface (probably "eth0"). There has
never been an API to set this, but if someone wanted to install a
default IpConfiguration, they could just configure "eth0" instead.

Bug: 224919694
Test: atest EthernetConfigStoreTest --iterations
Test: manually test
      - adb push <fake ipconfig.txt> /data/misc/ethernet/
      - adb reboot
      - read the IP config from legacy path and the same config
        file is created in the apex file path
      - adb reboot
      - read the IP config from the apex file path directly
Change-Id: Ifb82a5d7fa13d17ea8fd3a42a19cd020cb95e26a

Patrick Rohr   authored and   Xiao Ma   commited 2022-05-20 09:20:54 +09:00
47641d75d9