Commit graph

107,424 commits

Message SHA1
Add expect_throws() to assert_utils.py to check expected exception
Test: atest NetworkStaticLibHostPythonTests
Change-Id: I2e181f5b6f41e6de228d516dff970d47cfa3eaf6

Jimi Chen   commited 2024-10-22 03:06:47 +00:00
a0c0168ae6
Merge changes Ie2834546,I3a1570dc into main
* changes:
  [demoapp] make the Thread Network Settings page scrollable
  [demoapp] Add ephemeral key buttons and texts

Yang Sun   authored and   Gerrit Code Review   commited 2024-10-14 05:27:02 +00:00
3f5e199898
Merge "[Thread] add unit test cases for Configuration API at ThreadNetworkController" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-14 03:29:27 +00:00
2a72726a36
[demoapp] make the Thread Network Settings page scrollable
The page is made scrollable, and moved epskc related text/buttons to the
bottom of the page.

A screenshot of the screen scrolled down:
https://screenshot.googleplex.com/Bx2dFHu3SqpbEri

Bug: 372820898
Change-Id: Ie28345463275a177a3fbf272339912b9ea56e38f

Yang Sun   commited 2024-10-14 02:41:43 +00:00
85f93ed38c
[Thread] add unit test cases for Configuration API at
ThreadNetworkController

Bug: 368456504
Change-Id: I67b57f658c35b2b6e2045903d035d0f925b9b333

Handa Wang   commited 2024-10-14 02:34:49 +00:00
9a302c1e7a
[demoapp] Add ephemeral key buttons and texts
A screenshot of ephemeral key enabled: https://screenshot.googleplex.com/BpUcYFkbuRvzirF

Bug: 372820898
Change-Id: I3a1570dc546a90a997d15428a3936967c1df3041

Yang Sun   commited 2024-10-14 02:11:26 +00:00
f1930fdb4f
Merge "Ensure the dump service is completed" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-10-14 01:46:21 +00:00
ef1b2ea92e
Merge "Change OtDaemonState ephemeralKeyExpiryMillis to ephemeralKeyLifetimeMillis" into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-10-11 01:19:01 +00:00
adee3295ff
Merge "[Thread] fix the issue that border routing is not available after ot-daemon restarts" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-10 15:33:01 +00:00
3e4eaf8c80
[Thread] fix the issue that border routing is not available after
ot-daemon restarts

This CL tries to fix issue by removing error-prone shortcircuit checks.
The checks skip configuring the ot-daemon if they think the new state
is equal to the old state. However, the old state mainainted in
ThreadNetworkControllerService may be stale which causes issues.

Bug: 372592886
Test: atest ThreadNetworkIntegrationTests

Change-Id: Icab25cf094f8bf33832b4097ab8ee77b54badc6b

Handa Wang   commited 2024-10-10 14:21:58 +00:00
485a7f1849
Merge "Move public key to a DeviceConfig flag" into main
Sandro Montanari   authored and   Gerrit Code Review   commited 2024-10-10 14:01:47 +00:00
e7633383ad
Move public key to a DeviceConfig flag
Instead of hard-coding the public key value in code.

Flag: com.android.net.ct.flags.certificate_transparency_service
Bug: 319829948
Test: atest NetworkSecurityUnitTests
Change-Id: Ided9a9402241d91cae3cee25f5511c3a881e087d

Sandro Montanari   commited 2024-10-10 12:46:44 +00:00
802c8f1a4d
Merge changes from topic "thread-set-configuration" into main
* changes:
  [Thread] make ThreadNetworkController#setConfiguration a system API
  [Thread] implement the ThreadNetworkController#setConfiguration at service

Handa Wang   authored and   Gerrit Code Review   commited 2024-10-10 10:37:47 +00:00
fd2a145513
Change OtDaemonState ephemeralKeyExpiryMillis to ephemeralKeyLifetimeMillis
Bug: 372598146
Test: atest CtsThreadNetworkTestCases

Change-Id: I634ca0c22b5d80411df2b53493659c27ea07d2f2

Yang Sun   commited 2024-10-10 06:54:40 +00:00
fe0fb3081e
[Thread] make ThreadNetworkController#setConfiguration a system API
This CL turns setConfiguration into a system API, including the
ThreadConfiguration#Builder
and the #setNat64Enabled method.

Bug: 368456504

Change-Id: I0ff2ed81271dcceea295d169a46a02f05aeda5d6

Handa Wang   commited 2024-10-10 05:36:11 +00:00
651bfdaaf7
[Thread] implement the ThreadNetworkController#setConfiguration at
service

This CL implements the ThreadNetworkController#setConfiguration. When
the ThreadNetworkControllerService receives this call, the configuration
is passed to ot-daemon and triggers according OT APIs. On success, the
configuration is persisted to the local storage and triggers
OutcomeReceiver#onSuccess. On failure, it triggers
OutcomeReceiver#onError.

Bug: 368456504

Change-Id: I570ec3fead204cd3b6c05629ef409967245350b8

Handa Wang   commited 2024-10-10 05:36:06 +00:00
ed15725987
Ensure the dump service is completed
If dumping MdnsDiscoveryManager is not executed on the handler
thread, it may not complete in time because the dump task is
performed on the handler thread. Therefore, use
HandlerUtils#runWithScissorsForDump to ensure the dump service
is completed.

Test: dumpsys servicediscovery
Change-Id: Ifbb972fe7a83677b7cdcc97bb6c5c099ce56bb8f

Paul Hu   commited 2024-10-09 08:52:37 +00:00
78713203b3
Merge "Validate cellular network in testSetAvoidUnvalidated() for accurate testing" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-09 08:36:26 +00:00
2f6d6421ad
Validate cellular network in testSetAvoidUnvalidated() for accurate testing
* Modified testSetAvoidUnvalidated() to ensure the cellular network is
  validated before proceeding with default network switching tests.
* This prevents inaccurate test results when the cellular network is not
  usable, as the connectivity service won't switch to it if the Wi-Fi
  network becomes invalid.

Bug: 371818866
Test: TH
Change-Id: I458903392605a44470d5f226a36cfa983ec71aea

Yuyang Huang   commited 2024-10-09 16:51:42 +09:00
99a17f99af
Merge "Retrieve IPv4 and IPv6 addresses for client and server device in test setup" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2024-10-09 03:33:42 +00:00
4d2333657f
Merge "Add send and check reply packet function for multi-devices tests" into main
Jimi Chen   authored and   Gerrit Code Review   commited 2024-10-09 03:33:33 +00:00
c0a9511330
Merge "Remove useless mts/mcts tags for CtsTetheringTest." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-09 01:50:59 +00:00
519515aa58
Merge "[javadoc] add missing space" into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-10-09 00:44:05 +00:00
d8eda25161
Merge changes I2e556cf5,I5e42005f,I7b766ef6 into main
* changes:
  Remove unused method TetheringConfiguration#isRandomPrefixBaseEnabled()
  PrivateAddressCoordinator: introduce Dependencies class
  PrivateAddressCoordinator: move the special handling of WiFi P2P dedicated IP to IpServer

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-08 17:07:29 +00:00
a757293484
Merge "Add Bessie to networksecurity OWNERS" into main
Sandro Montanari   authored and   Gerrit Code Review   commited 2024-10-08 16:35:49 +00:00
a10d886a4b
Add Bessie to networksecurity OWNERS
Bug: n/a
Test: n/a
Flag: EXEMPT only changing OWNERS
Change-Id: Icc2639c7afadbbb6fa77c9354b20e974816ff5e7

Sandro Montanari   commited 2024-10-08 15:56:23 +00:00
6f73361204
Remove useless mts/mcts tags for CtsTetheringTest.
CtsTetheringTest only appears in mts-tethering-tests-list-user.xml
and not in any other test lists. So remove the MCTS tags that refer to
other MTS suites.

Bug: 369758357
Test: test-only change
Change-Id: Ib75f9c287e011b770bddeee4fba3e6f6f699a93a

Tongbo Liu   authored and   Lorenzo Colitti   commited 2024-10-08 15:36:32 +00:00
d833d726da
Remove unused method TetheringConfiguration#isRandomPrefixBaseEnabled()
This CL removes TetheringConfiguration#isRandomPrefixBaseEnabled(). This
method was used for configuring PrivateAddressCoordinator. Now
PrivateAddressCoordinator doesn't depend on TetheringConfiguration so
we'll remove this unused method.

Bug: 369282577
Change-Id: I2e556cf5dd6c28cd6aba29ee9093a9873a4f4d3f

Handa Wang   commited 2024-10-08 14:41:28 +00:00
87d33bac74
PrivateAddressCoordinator: introduce Dependencies class
This CL introduces the Dependencies class for PrivateAddressCoordinator
to allow changing the TetheringConfiguration in tests. Although in
production code TetheringConfiguration won't change after passed to
PrivateAddressCoordinator, there are unit test cases relying on changing
the configuration at runtime.

Bug: 369282577

Change-Id: I5e42005f85e784c0ce3ac9192248c9e4ed4e6147

Handa Wang   commited 2024-10-08 14:41:24 +00:00
88312f6451
Merge "Remove unnecessary byte array allocation:" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-08 10:38:08 +00:00
df90099594
Merge "Add packet capture and match network_stack adb command to to apf_utils" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-10-08 08:22:37 +00:00
f292b94948
Merge changes Id763decf,I3896a2e9 into main
* changes:
  Rename queryCount -> queryIndex
  Rename getDelayUntilNextTaskWithoutBackoff

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-10-08 07:04:36 +00:00
941644ee1e
PrivateAddressCoordinator: move the special handling of WiFi P2P
dedicated IP to IpServer

The source of
TetheringConfiguration#shouldEnableWifiP2pDedicatedIp is in the
Tethering's resources. As refactoring the code, we noticed that it will
be simpler to handle this at IpServer (constructed using
TetheringConfiguration) instead of at PrivateAddressCoordinator
(will require reflection to read the Tethering's resources).

Bug: 369282577
Change-Id: I7b766ef6a769043c2a4ca11741db5c16c5c57071

Handa Wang   commited 2024-10-08 07:00:32 +00:00
731ae53d71
[javadoc] add missing space
Bug: 348323500
Test: presubmit

Change-Id: Iacad7bd2537108425cc9dedcfdd3eeef7f9765b8

Yang Sun   commited 2024-10-08 06:01:05 +00:00
34e9836b26
Rename queryCount -> queryIndex
queryCount was "the count of queries until now, excluding this one",
which isn't as clear as "queryIndex" (especially in calculations).
queryIndex is a more usual way to name something that starts at 0 and
increases by one with each instance.

Test: atest
Change-Id: Id763decf7d2db7462c296955d6123cb1b14585fe

Remi NGUYEN VAN   commited 2024-10-08 14:47:11 +09:00
f4d6946440
Rename getDelayUntilNextTaskWithoutBackoff
The method is actually used to get the delay before the given
QueryTaskConfig, not until the next task. So rename it to
getDelayBeforeTask.

Test: atest

Change-Id: I3896a2e9c2ba6d2e0f8b776817758c5941187e20

Remi NGUYEN VAN   commited 2024-10-08 14:47:06 +09:00
6288cce6f6
[automerger skipped] Merge "Revert "Skip TestDropPacketToVpnAddress if the feature is disabled"" into android15-tests-dev am: 9c6ec48545 -s ours
am skip reason: Merged-In Ib16a7550dcf93dd9ecf29047b1c4f101ff6d610d with SHA-1 9d5d7d0779 is already in history. Merged-In was found from reverted change.

Reverted change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3271851

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3289781

Change-Id: Ibdbf3a6c8c3f41faf8ed563b78d99c0eb8e7ac27
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2024-10-07 17:40:27 +00:00
00deaf76ae
[automerger skipped] Revert "Skip TestDropPacketToVpnAddress if the feature is disabled" am: 504e3da375 -s ours
am skip reason: Merged-In Ib16a7550dcf93dd9ecf29047b1c4f101ff6d610d with SHA-1 9d5d7d0779 is already in history. Merged-In was found from reverted change.

Reverted change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3271851

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3289781

Change-Id: If652bdb7ac4a9eaddca18d488b2f66a4bd4b67af
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2024-10-07 17:40:23 +00:00
60d8d39fcf
Merge "Revert "Skip TestDropPacketToVpnAddress if the feature is disabled"" into android15-tests-dev
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-07 17:25:11 +00:00
9c6ec48545
Retrieve IPv4 and IPv6 addresses for client and server device in test setup
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Change-Id: Icba82832fa1840ea1a3299f61027666d4dd90d46

Jimi Chen   commited 2024-10-07 13:34:02 +00:00
4c3a13c048
Add send and check reply packet function for multi-devices tests
The `send_packet_and_expect_reply_received` start capurting packets,
and then send out request packets, then get expected packets counts to validate.
In the end, stop capturing for the specified interface.

Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases
Change-Id: I275534a45ce0ed363fa8ab9d12272d25845aa598

Jimi Chen   commited 2024-10-07 13:34:01 +00:00
d07d47b1d3
Add packet capture and match network_stack adb command to to apf_utils
It wraps the following 3 commands for multi-devices tests
- cmd network_stack capture start <interface>
- cmd network_stack capture stop <interface>
- cmd network_stack capture matched-packet-counts <interface> <pkt-in-hex>

Add a helper function `is_packet_capture_supported` as APFv6 precondition check.
Test: atest NetworkStaticLibHostPythonTests

Change-Id: I526c678c6e753cee3969b04a56ab33e5e3d1600d

Jimi Chen   commited 2024-10-07 13:33:57 +00:00
1644f95852
Merge "Move CtsHostsideNetworkTests to presubmit." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-07 02:37:19 +00:00
5776449480
Merge "Handle CMD_IPV6_TETHER_UPDATE in UnavailableState" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-05 01:43:58 +00:00
cc53e7feee
Merge "Change TetheringManager#RequestDispatcher as static" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-04 23:13:14 +00:00
edddb5b6f7
Handle CMD_IPV6_TETHER_UPDATE in UnavailableState
Technically, UnavailableState should not handle any messages at all (and
shouldn't exist). As the IpServer has already been removed from
mTetherStates. However, sendInterfaceState() cleans up IPv6 tethering
which eventually triggers a CMD_IPV6_TETHER_UPDATE. Instead of
preventing the CMD_IPV6_TETHER_UPDATE, ignore it for now and remove this
state entirely once we have rolled out SyncStateMachine.

Bug: 368713124
Test: TH
Change-Id: I32ae9583aa01411fa1fc299a0fc91138557b7ae2

Patrick Rohr   commited 2024-10-04 15:38:27 -07:00
ba7d9dddc7
offload.c: do_forward6() pull less
This is to avoid kernel fault due to UDPv6 GRO FRAGLIST collapse
(by virtue of pulling more than udp packet's payload).

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

Maciej Żenczykowski   commited 2024-10-04 19:06:15 +00:00
487f21e9be
Remove unnecessary byte array allocation:
The `upstreamEvents` byte array may not be used if debugging is
disabled.  Remove the array allocation and retrieve the array
directly when required.

Test: atest TetheringTests
Change-Id: I7e1ddd3ce2e3079f07deebe3dd49aef832b24558

Paul Hu   commited 2024-10-04 07:49:21 +00:00
4110b7dc70
BpfHandler: fix comment whitespace/quoting
Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I8823af530e3dad6d3646826a8d4537a8989c2efd

Maciej Żenczykowski   commited 2024-10-03 18:42:45 +00:00
e611324c50
Merge "Mark packages/modules/Connectivity apps in updatable apexes with updatable: true" into main
Colin Cross   authored and   Gerrit Code Review   commited 2024-10-03 18:02:04 +00:00
7f16a49fa5