Commit graph

105,232 commits

Message SHA1
Add assert_utils for multidevice test
Test: atest NetworkStaticLibHostPythonTests
Bug: 335368434
Change-Id: I2a9ee97b84cb16791c0c5e3cb03120e67ffeb0af

Junyu Lai   commited 2024-07-01 12:23:59 +08:00
850e6fae54
Move utils to staticlib
This is a no-op refactoring.

Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases
Bug: 335368434
Change-Id: I415cc22f49c437be6fe8e8ae8822af22ebefe8d1

Junyu Lai   commited 2024-06-28 11:19:54 +08:00
79b771f9bb
Merge "Add mulit devices mdns tests" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-06-24 15:19:27 +00:00
2d68bc2135
Merge changes from topic "thread-configuration-api" into main
* changes:
  [Thread] support ThreadConfiguration API at ThreadNetworkControllerService
  [Thread] add support for configuration at ThreadNetworkController

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-24 10:03:18 +00:00
bc9c0e2b03
[Thread] support ThreadConfiguration API at ThreadNetworkControllerService
Bug: 342519412
Test: atest CtsThreadNetworkTestCases

Change-Id: I7b84a64d24e513bd6ba07bb26e3801b72c250810

Handa Wang   commited 2024-06-24 07:50:37 +00:00
4688910810
[Thread] add support for configuration at ThreadNetworkController
This CL adds methods for setting the ThreadConfiguration and
subscribing/unsubscribing to Configuration changes. The ThreadConfiguration
is used for controlling Thread features for the device.

Bug: 342519412
Change-Id: I9e20391eb3b2f20312a2cb0b587cc5bdf200d24d

Handa Wang   commited 2024-06-24 07:50:34 +00:00
7520abf333
Add mulit devices mdns tests
Add tests to verify mdns advertising, discovery, and resolution
over a hotspot connection using multiple devices.

Bug: 343311941
Test: atest CtsConnectivityMultiDevicesTestCases
Change-Id: I9f52a271385cddc12c8f57b188e080ad69651f9f

Paul Hu   commited 2024-06-24 06:47:24 +00:00
7d42feb303
[mdns] Update doc for NsdServiceInfo
This CL updates the javadoc for NsdServiceInfo to make it clearer that a client must contain all the desired address records for the hostname, and all the other registrations must not have any address records for the same hostname.

Bug: 344799768
Test: None

Change-Id: I8eea39adf870a75de23bcafaf8e13d78ee330da4

Handa Wang   commited 2024-06-24 06:27:21 +00:00
0f5ae1fd08
Merge "[Thread] post broacast receivers on the handler thread" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-06-24 05:38:50 +00:00
6d59b2f7aa
[Thread] post broacast receivers on the handler thread
It turns out context.registerReceiver(receiver, intentFilter,
permission, flags, handler) is not posting the receiver on the handler
and will result in ANR in activity manager if the receiver is blocked

This commit makes it safer by posting the receiver body to mHandler
explicitly.

Bug: 340368050
Change-Id: Ib6b8c0a8952ce43c935f39b0978f47268b108a79

Kangping Dong   commited 2024-06-24 11:52:14 +08:00
f8aaac0dd0
Merge "Move MdnsTestUtils to the net-tests-utils library" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-06-24 03:32:07 +00:00
ac6131b5f1
Merge changes I47606693,Ia51bc3ab,Idef1a6d1,Ie6fbc3ee,I55064ee7 into main
* changes:
  Clean up BpfCoordinatorTest after refactors
  Move upstream interface BPF support check to BpfCoordinator
  Refactor BPF map update logic of upstream interface change
  Centralize IP neighbor monitoring in BpfCoordinator
  Get rid of BpfCoordinator#mPollingStarted

KH Shi   authored and   Gerrit Code Review   commited 2024-06-22 12:34:34 +00:00
4c701fbfa0
Merge changes I76b0a7ba,If7308f1a,Ica8faced,Ia8f42ed0,I975afb45, ... into main
* changes:
  Add some documentation to EthernetInterfaceStateMachine
  Add support for link state tracking
  Add unit test class for EthernetInterfaceStateMachine
  Add missing call to add states to state machine
  Make class testable
  Log.wtf if block times out
  Wait on IpClient#onQuit in StartedState#exit
  Use TAG instead
  Introduce CMD_ON_NETWORK_NEEDED and CMD_ON_NETWORK_UNNEEDED messages
  Clean up and document state lifecycle
  Add convenience method for processMessage with no arguments
  Implement NetworkOffer in EthernetInterfaceStateMachine
  Add boilerplate to represent interface states in state machine
  Fix typo in SyncStateMachineTest
  Move SyncStateMachine to staticlibs

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-21 19:01:38 +00:00
58526e4d96
Revert "NetBpfLoad: disable mainline on < U QPR3"
This reverts commit 4b28336a7a.

Fixed trivial comment conflicts in netd/BpfHandler.cpp

This is targetting mainline release M-2024-09.

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

Maciej Żenczykowski   commited 2024-06-21 15:47:00 +00:00
4e4f8720f2
Revert "NetBpfLoad: gently enable mainline"
This reverts commit 231598bc92.

This is targetting mainline release M-2024-09.

Note: left the failure message in netbpfload/netbpfload.33rc
to mention 'netbpfload-failed' and not 'bpfloader-failed'.

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

Maciej Żenczykowski   commited 2024-06-21 15:46:42 +00:00
2afffc2d6a
Add some documentation to EthernetInterfaceStateMachine
Test: documentation only
Change-Id: I76b0a7ba8633fa9328e1d42de7f7208c84871ca8

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
d4c6516b2c
Add support for link state tracking
Currently, TetheringState just ignores these callbacks (though it must
return HANDLED, otherwise a wtf is logged). This is in line with what
EthernetTracker currently does.

Test: EthernetInterfaceStateMachineTest
Change-Id: If7308f1aa4b333552a79dfe05864c5cef1621582

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
0129a7a11e
Add unit test class for EthernetInterfaceStateMachine
This currently just invokes the constructor and does nothing else.
EthernetInterfaceStateMachine does not currently provide a way to
transition out of LinkDownState.

Test: run test
Change-Id: Ica8faced0abe33bb70ec5e3f950bc0af75f78f16

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
7bd5e6dca6
Add missing call to add states to state machine
Test: EthernetInterfaceStateMachineTest
Change-Id: Ia8f42ed03a8d20bd02be2c587976db48e6b8cccd

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
990ea86b46
Make class testable
Reuses EthernetNetworkFactory.Dependencies.

Test: mm
Change-Id: I975afb45a84b12e8660ac6b94d97410abb3c7aaa

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
e3e9d4bbdc
Log.wtf if block times out
Test: mm
Change-Id: I28e5bd8d208fa77ad04c67e3f66ea36c20ff8917

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
903f230825
Wait on IpClient#onQuit in StartedState#exit
This does make the entire operation synchronous, but also temporarily
blocks the handler thread (it is however what EthernetNetworkFactory
currently does). If that becomes an issue, we can consider adding a
StoppingState.

Test: mm
Change-Id: I799fb027d6eda4106633a047bf13674190ad0e68

Patrick Rohr   commited 2024-06-21 08:25:26 -07:00
49cea0f80d
Use TAG instead
Test: mm
Change-Id: Ic0fa5d6c99e804b32f4b47fc2142b6f51c460953

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
2bdae824c5
Introduce CMD_ON_NETWORK_NEEDED and CMD_ON_NETWORK_UNNEEDED messages
While the parent state (NetworkOfferExtendedState) registers (and
unregisters) the offer, its child states handle the resulting needed /
unneeded messages. Since SyncStateMachine logs WTF if a message is
processed that is not handled by the current state (or any of its
parents), this provides some protection against receiving unexpectected
needed / unneeded messages.

Test: mm
Change-Id: I5d322c9d3b9cea911e1435ef118a3fb03f7d537a

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
a403056f70
Clean up and document state lifecycle
This renames existing states and makes RunningState a child of
StartedState. StartedState's purpose is managing the IpClient lifecycle,
so when the state machine transitions to RunningState, there is
guaranteed to be an IpClient instance. RunningState will then
startProvisioning and register a NetworkAgent on provisioning success.

Test: builds
Change-Id: I7fa41a9be06feaa9cbe78e344242bcedbe91e7ed

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
9cc02c2e01
Add convenience method for processMessage with no arguments
Similar to StateMachine, this CL adds a convenience method for
processMessage that sets arg1 and arg2 to 0, and obj to null.

Test: SyncStateMachineTest
Change-Id: I7f5b9c0403c1abf02d03fd26bb2a16c53712c3bb

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
38c6f7d5ce
Implement NetworkOffer in EthernetInterfaceStateMachine
This approximately does the equivalent of
NetworkInterfaceState#registerNetworkOffer,
NetworkInterfaceState#unregisterNetworkOfferAndStop, and
NetworkInterfaceState#EthernetNetworkOfferCallback.

Test: TH
Change-Id: I9963e4bd08ab00910fafb258e7213ab01894926a

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
3900b0606c
Add boilerplate to represent interface states in state machine
Adds empty boilerplate states to represent ethernet interface states
(currently tracked in NetworkInterfaceState) in a StateMachine.

Test: TH
Change-Id: I1041dc577a9c41b44272dfd534abe705220ff3e0

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
4e6679153a
Fix typo in SyncStateMachineTest
Test: TH
Change-Id: Ibeea98446135e16b8ce9f63e0651075b3c109669

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
6e7c49de1e
Move SyncStateMachine to staticlibs
Test: mm
Change-Id: I51685a454a3d0fab578fef1eeb42d600adef06e6

Patrick Rohr   commited 2024-06-21 08:25:25 -07:00
aa06b2bf8e
Revert "bpf_progs: introduce mainline loaded non-critical gentle.o"
This reverts commit 083cce9bf9.

This is targetting mainline release M-2024-09.

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

Maciej Żenczykowski   commited 2024-06-21 15:14:43 +00:00
4d6d7aafe8
Revert "Add a temporary hack to CS to report netbpfload result"
This reverts commit fe956d9189.

This is targetting mainline release M-2024-09.

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

Maciej Żenczykowski   commited 2024-06-21 15:14:33 +00:00
8e7276b482
Revert "Add a Log.wtf() on user builds to test Pitot reporting pipeline"
This reverts commit 9161b153b4.

This is targetting mainline release M-2024-09.

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

Maciej Żenczykowski   commited 2024-06-21 15:14:20 +00:00
2a911d6c18
Merge "Update ApfIntegrationTest to use new ApfV4Generator constructor" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-21 13:29:23 +00:00
81837d0766
Clean up BpfCoordinatorTest after refactors
Removed the use of a real IpServer instance in BpfCoordinatorTest,
as it is no longer needed after the refactors in aosp/2716773 and
aosp/3113123.

Test: atest TetheringTests
Bug: 294025403
Change-Id: I4760669372275a0165f4980705e328c80e0649a5

KH Shi   commited 2024-06-21 11:35:39 +00:00
572b784fdc
Move upstream interface BPF support check to BpfCoordinator
Removed upstream interface BPF support check from IpServer and moved
it to BpfCoordinator. The support check can be performed directly in
BpfCoordinator using the interface name.

Test: atest TetheringTests
Bug: 294025403
Change-Id: Ia51bc3ab18dd21afdca9db9199fa060aab68f768

KH Shi   commited 2024-06-21 11:35:37 +00:00
582df23c7b
Refactor BPF map update logic of upstream interface change
Move upstream interface change handling for BPF map updates from
IpServer to BpfCoordinator. BpfCoordinator now manages all BPF map
updates.

Test: atest TetheringTests
Bug: 294025403
Change-Id: Idef1a6d1a16a35603e0b476bfdbe6a234f39f4be

KH Shi   commited 2024-06-21 11:32:39 +00:00
9174207bb6
PacketBuilder: add IPv6 fragment packets support
Add IPv6 fragment packets support in PacketBuilder class, refer to
https://tools.ietf.org/html/rfc2460.

Bug: 285124667
Test: atest NetworkStaticLibTests
Change-Id: Ie898f8a4847f12677b11dfaa4db26dc4e168a68a

KH Shi   commited 2024-06-21 10:47:33 +00:00
d83596f567
Update ApfIntegrationTest to use new ApfV4Generator constructor
Test: TH
Change-Id: If33f5302398ffb93eb3a811ddf2b94282d3318fa

Yuyang Huang   commited 2024-06-21 19:22:26 +09:00
8a4f6e810c
Remove unused import from EthernetTetheringTestBase
Bug: 285124667
Test: m
Change-Id: I9d89ae70ec7d4b52431f8bc992a7cdc1df85d202

KH Shi   commited 2024-06-21 01:57:14 +00:00
f093d22fcc
Merge "Baseline Lint FlaggedApi violations" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-20 12:11:15 +00:00
7466a95f8b
Fix a comment in MdnsAdvertiser.java
As suggested in b/344799768, we should use 'UID' instead of 'user'.

Bug: 344799768
Change-Id: I1dff7f9f5a0578d2b706dd807b23b07a8103eca1
Test: None

Handa Wang   commited 2024-06-20 10:55:33 +00:00
3034cc60bd
Move MdnsTestUtils to the net-tests-utils library
This is a no-op refactoring to move MdnsTestUtils to the
net-tests-utils library.

Bug: 343311941
Test: build pass
Change-Id: I009f421da47771cf4d4d3673db1a807e555ce86f

Paul Hu   commited 2024-06-20 09:59:34 +00:00
be4e552787
Merge "Move tether_utils into utils folder" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-20 07:22:32 +00:00
fada36681a
Baseline Lint FlaggedApi violations
The Lint FlaggedApi checks are currently configured as warnings. Add
existing violations to baselines files to prepare for turning the
FlaggedApi checks into errors.

Bug: 303434307
Test: treehugger
Flag: EXEMPT not possible to flag baseline changes
Merged-In: I990ce57cd5cdac44ee8b93565b45aa15790ad697
Change-Id: I990ce57cd5cdac44ee8b93565b45aa15790ad697

Mårten Kongstad   commited 2024-06-20 09:05:51 +02:00
4ece737f4f
Add "no-op refactors" reviews for delegated reviewers
As per discussion, also expand the "NsdManager" exemption to be more generic.

Change-Id: I708f44c8546d6c68db9c8a6763bbf6ebb0340883
Test: m

Remi NGUYEN VAN   commited 2024-06-20 06:29:09 +00:00
3784fa6642
Merge "Increase timeout for waiting for physical interfaces to show up" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-06-19 10:46:28 +00:00
0ca920b40b
Merge "Introduce TETHERING_VIRTUAL type" into main
Seungjae Yoo   authored and   Gerrit Code Review   commited 2024-06-19 09:10:15 +00:00
a05cdee22f
Merge "bpf: extend cgroup hooks to older kernels" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-19 08:01:15 +00:00
c4ada1c953
Introduce TETHERING_VIRTUAL type
Bug: 340376953
Test: Presubmit
Change-Id: I0714b62ebfc63fc966d7873ebdd68ae72c015bc4

Seungjae Yoo   commited 2024-06-19 16:18:51 +09:00
07b8fe1f92