Commit graph

107,440 commits

Message SHA1
Delete a surprising amount of dead code
Test: TH
Change-Id: I901409eca3d1549035825183031756647b35cbd3

Patrick Rohr   commited 2024-10-16 18:50:21 +00:00
8589c09369
Merge "Refactor shouldTestThisNetworkType" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-16 11:02:48 +00:00
507922a1e3
Merge "Do not run diagnostics on assumption failures" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-16 07:16:44 +00:00
8eff4fd04b
Do not run diagnostics on assumption failures
Assumption failures are not actual failures, do not run connectivity
diagnostics for these.

Test: atest
Change-Id: I1d78eb6f12412e13cf4c29718ff8869ed089f491

Remi NGUYEN VAN   commited 2024-10-16 15:26:47 +09:00
3feb788aa5
Merge "Add options to disable diagnostics collector" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-16 06:02:22 +00:00
5024551d11
Add options to disable diagnostics collector
Disable by default on local builds (which generally have "eng.username"
as their INCREMENTAL version), and add an option to allow disabling
manually on other builds as well.

Test: atest

Change-Id: I2d406a55ba0e3d57ed30e740b6c011124905b8d7

Remi NGUYEN VAN   commited 2024-10-16 13:27:14 +09:00
2665f0a4d5
Merge "Add connectivity diagnostics on test failure" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-10-16 04:11:58 +00:00
c0ebf16036
Merge "Remove module tests from FrameworksNetTests" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-16 02:42:36 +00:00
679edb482f
Merge "Remove the check for epskc flag value at runtime." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-10-16 01:49:52 +00:00
f329d7ed2d
Add connectivity diagnostics on test failure
When CtsNetTestCases tests fail, or when a tryTest statement fails,
collect connectivity diagnostics and output them as a test artifact.

tryTest must be followed by cleanup blocks, which often change the
configuration, so having diagnostics when the tryTest fails in addition
to after the test failure is useful.

The collected diagnostics will be available as individual test
artifacts. They should make it easier to investigate test failures, and
could be collected across test runs in an automated way.

Output files are currently limited at 20 per run, to avoid collecting
too much data in case everything is failing in the run.

Test: atest
Change-Id: Iaa48e519028dc61c03d387beeade7d41fca2ef48

Remi NGUYEN VAN   commited 2024-10-16 10:05:35 +09:00
43730b3f0f
Remove module tests from FrameworksNetTests
Connectivity module tests are currently included in both
FrameworksNetTests and ConnectivityCoverageTests. This causes confusion,
may cause tests to fail in one configuration but not the other, is
inefficient in terms of build time and infrastructure usage, and forces
developers to keep tests passing in two different configurations that
may use different libraries.

Only include non-connectivity-module-test in FrameworksNetTests, and
keep them excluded from ConnectivityUnitTestsLib (renamed from
FrameworksNetTestsLib).

Test: atest
Change-Id: I1c557c1b4c643b3eba3bffffd89634e1141d5c0e

Remi NGUYEN VAN   commited 2024-10-16 09:56:17 +09:00
96267ec798
Merge "Rename TapPacketReader to PollPacketReader for broader applicability" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-10-15 08:52:44 +00:00
9e13b32ede
Remove the check for epskc flag value at runtime.
This blocks local testing as the flag is read-only.

Change-Id: I891ef2d61dbb1ecccde7b89081899afb7155dd2f

Yang Sun   commited 2024-10-15 07:08:11 +00:00
eab97a0552
Merge "Move buildMdnsServiceInfoFromResponse to MdnsUtils." into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-10-15 05:08:14 +00:00
49bf74e8a3
Rename TapPacketReader to PollPacketReader for broader applicability
* Renamed TapPacketReader to PollPacketReader to better reflect its
  functionality beyond TAP interface interaction.
* The class includes general logic for polling and sending packets to
  file descriptors, making it suitable for wider use cases.

Test: TH
Change-Id: Icdf9a9d7ef6f49b589ed9cdbd05159ab95e7e5d9

Yuyang Huang   commited 2024-10-15 13:42:05 +09:00
eb3c631b89
Move buildMdnsServiceInfoFromResponse to MdnsUtils.
Move this utility method buildMdnsServiceInfoFromResponse from
MdnsServiceTypeClient to MdnsUtils so it can be used by other
classes.

Bug: 355421878
Test: atest FrameworksNetTests NsdManagerTest
Change-Id: I8ce1028de325da46f112a5ec58516453727151fe

Paul Hu   commited 2024-10-15 03:00:58 +00:00
f311b43bef
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