Commit graph android_packages_modules_Co.../thread
Message SHA1
[Thread] unify synchronous controller API for testing
This commit creates the new `ThreadNetworkControllerWrapper` class to
unify the asynchronous version of the ThreadNetworkController API to
simplify Thread tests.

Test: atest ThreadNetworkIntegrationTests
Change-Id: Ibc6e6e2dad5041b092315aa0278915c137867488

Kangping Dong   commited 2024-03-18 19:17:02 +08:00
62eac0132d
Merge "Use a short timeout for FullThreadDevice.ping" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-03-18 11:13:11 +00:00
c1df0d07dd
Use a short timeout for FullThreadDevice.ping
In the tests there may not be a reponse to ftd ping command, and the
function does not check for ping success. So using a short timeout of
0.1s to let the function finish faster.

This change also removed the additional start BR step in
unicastRouting_borderRouterSendsUdpToThreadDevice_datagramReceived as
this is already done in setUp().

Bug: 328144082

Test: atest ThreadNetworkIntegrationTests:android.net.thread.BorderRoutingTest
Change-Id: I18202c74596d4a08bc8238723049e05994cca659

Yang Sun   commited 2024-03-18 17:32:40 +08:00
4bf1dcd7f4
Merge "Log as warning when persistent setting file doesn't exist" into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-03-18 02:11:47 +00:00
3b6db502f1
Merge "[Thread] use TestRule to filter Thread tests" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-03-17 14:17:32 +00:00
f8ffba4c04
Log as warning when persistent setting file doesn't exist
The Thread persistent setting file may be missing if a new device is
started or the file is deleted on the device. Updated the logging from
error to warning as the file will be created.

Test: presubmit
Change-Id: I107712fc6fef61f26bc9be49fd703e61beae32a6

Yang Sun   commited 2024-03-17 13:33:01 +08:00
72ea70ed1d
[Thread] use TestRule to filter Thread tests
It's error-prone to check dependent feature in both setUp() and
tearDown() to filter specific Thread tests. This commit adds
`ThreadFeatureCheckRule` and refactor the Thread tests to use the new
test rule to filter test cases.

Test: manually verified the annonated tests are skipped with
ASSUMPTION_FAILED when the dependency feature is not supported

Change-Id: I7a5efe6bda53fc1a6e204f6f40dd3ab2c3940988

Kangping Dong   commited 2024-03-16 20:00:40 +08:00
f1182f1057
Merge "Add reset API for NsdPublisher" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-03-15 15:00:01 +00:00
88dd959eef
Merge "[Thread] add CtsThreadNetworkTestCases to CTS" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-03-15 13:31:05 +00:00
b2f8b5f87a
[Thread] add CtsThreadNetworkTestCases to CTS
Bug: 329561498
Merged-In: I07d78c0d375370aa83024e3e154b7841a5018e64
Change-Id: I5157ae990046efcba411d2b5498c0d16f0c5efcd

Kangping Dong   commited 2024-03-15 15:57:42 +08:00
60e06c4ac9
Add reset API for NsdPublisher
This is needed by `ot-daemon` to clear all registrations when
re-initializing the `ot-daemon`'s `Application` class.

Bug: 323301831

Change-Id: I5ed3d2d29b08f4187ac1f406052d362cf2249c19

Handa Wang   commited 2024-03-14 14:37:38 +00:00
da90deda1b
reduce the timeout for discovering the lost of MeshCoP service in CTS
This is to avoid exceeding the time limit of 60 seconds per test case.

Bug: 323301831

Change-Id: I4921740b2561d75d78084436b53c7bac8c01023c

Handa Wang   commited 2024-03-14 07:51:51 +00:00
e1545c3bca
explicitly request NET_CAPABILITY_LOCAL_NETWORK capability when requesting Thread network
Due to aosp/2936050, NET_CAPABILITY_LOCAL_NETWORK is mandatory in the NetworkRequest before Android V to request a Thread network. Without this ThreadNetworkControllerService cannot get the Thread network so that it cannot bring up border routing.

Bug: 329464390
Bug: 329403058

Change-Id: Ic033288789d338c2fe6d0abde474acd24657ad5f

Handa Wang   commited 2024-03-14 01:56:51 +00:00
281c7d2a9b
Fix the issue that border routing is unavailable when ot-daemon restarts
Bug: 325771342
Test: atest ThreadNetworkIntegrationTests:android.net.thread.BorderRoutingTest

Change-Id: I60f41ef079167955d29d5e6f809ad2dd343c188b

Handa Wang   commited 2024-03-13 00:33:53 +00:00
aac3ef4da9
Check kernel version for multicast routing support.
Multicast routing is only supported on 14_5.15.0 and onwards. When sdk
version is 34+, thread is supported, if kernel version is e.g.
5.15.144-android13 then multicast routing is not supported so we need to
skip multicast routing tests.

Bug: 328133320

Test: atest ThreadNetworkIntegrationTests:android.net.thread.BorderRoutingTest
Change-Id: I5d67f4558b40ee3ec0569298c7c02726d5d19e98

Yang Sun   commited 2024-03-07 20:44:05 +08:00
734c626fea
Merge "Merge Android 14 QPR2 to AOSP main" into main
Xin Li   authored and   Gerrit Code Review   commited 2024-03-07 06:41:03 +00:00
612de50da2
Merge "Use factoryreset as a workaround to reduce the delay of reforming a network" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-03-07 06:23:21 +00:00
2aa81a6edc
Use factoryreset as a workaround to reduce the delay of reforming a
network

There's a defect in ot-daemon that re-forming a network after erasing
the persistent data will take longer delay. We can use the
`factoryreset` command to work this around so that the test cases take
less time.

Bug: 323301831
Bug: 328235705

Change-Id: I36e67fe0f7f1165a03e71397065a6166117acadb

Handa Wang   commited 2024-03-07 03:11:23 +00:00
b929c98c3c
[mdns] support regsitering hosts in NsdPublisher
This CL also adds an integration test case for the Advertising Proxy feature.
Currently the test case is disabled because it's unstable on some branches.
Will re-enable the test case when it's stable enough.

Bug: 318323473
Test: atest ThreadNetworkIntegrationTests:android.net.thread.ServiceDiscoveryTest
Change-Id: Ic88efb3b80640f95b53e4ec2428369e87be71649

Handa Wang   commited 2024-03-07 02:59:14 +00:00
c6037af2bf
Merge "Revert "[mdns] support regsitering hosts in NsdPublisher"" into main
Vaibhav Devmurari   authored and   Gerrit Code Review   commited 2024-03-06 14:48:13 +00:00
18b2cb9670
Revert "[mdns] support regsitering hosts in NsdPublisher"
Revert submission 2943805-nsdpublisher-publish-host

Reason for revert: Test failures: b/328384504

Reverted changes: /q/submissionid:2943805-nsdpublisher-publish-host

Change-Id: I5919fea68cae0d3817319994f43eb47e912f9157

Vaibhav Devmurari   authored and   Gerrit Code Review   commited 2024-03-06 12:15:11 +00:00
ba1cc3886e
Merge "Reduce time needed to run test." into main am: da42fec566
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2988131

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

Yang Sun   authored and   Automerger Merge Worker   commited 2024-03-06 02:31:26 +00:00
ab41a0442c
Merge "Reduce time needed to run test." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-03-06 02:18:46 +00:00
da42fec566
Merge "[mdns] support regsitering hosts in NsdPublisher" into main am: b7347bd441
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2943805

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

Handa Wang   authored and   Automerger Merge Worker   commited 2024-03-05 12:47:44 +00:00
abdaaebf47
Merge "[mdns] support regsitering hosts in NsdPublisher" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-03-05 12:15:17 +00:00
b7347bd441
Merge "[Thread] limit ot-daemon socket ACL to thread_network" into main am: 110b0edacf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2984275

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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2024-03-05 11:21:39 +00:00
c9a4664672
[Thread] limit ot-daemon socket ACL to thread_network
Change ot-daemon socket ACL from 0666 to 0660

Bug: 323502847
Change-Id: I58f9fea07b08459330986924fa3272dbc823477f

Kangping Dong   commited 2024-03-05 09:17:33 +00:00
838b6b508c
Reduce time needed to run test.
The multicastRouting_infraNetworkSwitch_outboundPacketIsForwarded test
has been flaky due to it sometimes taking more than 66000ms. Make the test
execution time shorter by pinging one multicast address instead of two
from the ftd.

Bug: 328144082

Test: atest ThreadNetworkIntegrationTests:android.net.thread.BorderRoutingTest
Change-Id: I1a1b3526f49befa7c367a8e6c5eb86463f97e986

Yang Sun   commited 2024-03-05 16:05:09 +08:00
5104619c3f
[mdns] support regsitering hosts in NsdPublisher
This CL also adds an integration test case for the Advertising Proxy feature.

Bug: 318323473
Test: atest ThreadNetworkIntegrationTests:android.net.thread.ServiceDiscoveryTest

Change-Id: I626aa6250bc2cb94aee09067b4f8e6b14bd90fcf

Handa Wang   commited 2024-03-05 06:56:52 +00:00
87c688df4b
Merge "Update the imports to androidx.test.filters.*" into main am: 64a8fa9d13
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2983295

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

Ram Peri   authored and   Automerger Merge Worker   commited 2024-03-01 17:22:19 +00:00
7e6d34064a
Merge "Update the imports to androidx.test.filters.*" into main
Ram Peri   authored and   Gerrit Code Review   commited 2024-03-01 16:38:04 +00:00
64a8fa9d13
Update the imports to androidx.test.filters.*
Bug: 316941721
Test: mmma .
Change-Id: I113714afaeb99bf76ff4dc19304371ad0ec097e0

Fangqiu Su   commited 2024-02-29 17:56:14 +00:00
61a14ca475
Merge "Use a TAP test network for MeshCoP service test cases" into main am: 2b071e919b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2983811

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

Handa Wang   authored and   Automerger Merge Worker   commited 2024-02-29 08:38:38 +00:00
733dbc54da
Merge "Use a TAP test network for MeshCoP service test cases" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-02-29 07:56:37 +00:00
2b071e919b
Merge "Fix flaky multicast tests in Thread E2E test." into main am: f141b6ec7c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2983812

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

Yang Sun   authored and   Automerger Merge Worker   commited 2024-02-29 06:25:25 +00:00
d2610c4ee8
Use a TAP test network for MeshCoP service test cases
Previously we were using TUN test network which is not eligible for mDNS
operations. The tests are flaky because we need to depend on other test
cases to connect to WiFi, which is not guaranteed. We'll use the TAP
test network to fix it.

Bug: 327306555
Bug: 327306158
Bug: 327306608
Test: https://android-build.corp.google.com/builds/abtd/run/L70000030002206431

Change-Id: Ie8ed0ee8b8208150efcd4424ed26e9ca7d85fd82

Handa Wang   commited 2024-02-29 04:49:56 +00:00
9f417260cf
Fix flaky multicast tests in Thread E2E test.
Bug: 327526332

Test: atest
ThreadNetworkIntegrationTests:android.net.thread.BorderRoutingTest
--iterations 10

Change-Id: I70f968e737e8540a27b8ce7c03dc0e3e1bf26b56

Yang Sun   commited 2024-02-29 11:24:09 +08:00
e23bb41c73
Merge "Revert "Use a TAP test network for MeshCoP service test cases"" into main am: e816bb776a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2983551

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

Handa Wang   authored and   Automerger Merge Worker   commited 2024-02-29 02:28:48 +00:00
cc08f925d6
Merge "Revert "Use a TAP test network for MeshCoP service test cases"" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-02-29 01:44:18 +00:00
e816bb776a
Revert "Use a TAP test network for MeshCoP service test cases"
This reverts commit 55648268de.

Reason for revert: DroidMonitor revert

Change-Id: Idd86b0ceb18fc425c39fe3c75603a472568eabe1

Joseph Murphy   authored and   Gerrit Code Review   commited 2024-02-28 21:56:27 +00:00
8f0e34be48
Merge "Use a TAP test network for MeshCoP service test cases" into main am: 5b3bf1adef
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2981594

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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2024-02-28 18:31:12 +00:00
43f0af3f97
Merge "Use a TAP test network for MeshCoP service test cases" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-02-28 17:23:16 +00:00
5b3bf1adef
Merge "[Thread] make Thread state customisable via resource overlay" into main am: 5ce2519a3e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2916726

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

Kangping Dong   authored and   Automerger Merge Worker   commited 2024-02-28 16:40:29 +00:00
19a5a97420
Merge "[Thread] make Thread state customisable via resource overlay" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-02-28 16:28:55 +00:00
5ce2519a3e
Merge "[BBR] Apply downstream multicast config sent from ot-daemon" into main am: aa26b685f7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2920825

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

Yang Sun   authored and   Automerger Merge Worker   commited 2024-02-28 15:11:42 +00:00
820ab56ee5
Use a TAP test network for MeshCoP service test cases
Previously we were using TUN test network which is not eligible for mDNS
operations. The tests are flaky because we need to depend on other test
cases to connect to WiFi, which is not guaranteed. We'll use the TAP
test network to fix it.

Bug: 327306555
Bug: 327306158
Bug: 327306608

Change-Id: Ia6de8a507578dbdeea4a7ceaf52f417acf35baa2

Handa Wang   commited 2024-02-28 14:30:22 +00:00
55648268de
Merge "[BBR] Apply downstream multicast config sent from ot-daemon" into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-02-28 14:15:46 +00:00
aa26b685f7
Merge "[Thread] add CtsThreadNetworkTestCases to mcts-tethering" into main am: 62046e57fe
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2979032

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

Kangping Dong   authored and   Automerger Merge Worker   commited 2024-02-28 09:39:20 +00:00
eeef0c15fe
Merge "[Thread] add CtsThreadNetworkTestCases to mcts-tethering" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-02-28 09:10:55 +00:00
62046e57fe
[Thread] make Thread state customisable via resource overlay
Make the default Thread and Border Router enabled state customizable for
vendor via resource overlay.

Bug: 322734489
Change-Id: I278d6afa82aac8d1bb06ee79f22bae6fb0199386

Kangping Dong   commited 2024-02-28 16:54:02 +08:00
c8359f4eb1