Commit graph android_packages_modules_Co.../thread/tests/integration
Message SHA1
Merge "Add OT multicast addresses to tun interface." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-04-12 06:39:26 +00:00
aa72ee2dd5
Add OT multicast addresses to tun interface.
Bug: 333668308

Test: atest ThreadNetworkIntegrationTests:android.net.thread.ThreadIntegrationTest#joinNetwork_tunInterfaceJoinsAllRouterMulticastGroup
Change-Id: I0bb91259ae5cbe0eb9c5d71b7aa4e5b2a95f8c6b

Yang Sun   commited 2024-04-11 00:54:25 -07:00
244dce3722
Merge "[Thread] ignore the flaky test case advertisingProxy_srpClientUnregistersService_serviceIsNotDiscoverableByMdns" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-04-11 03:12:30 +00:00
e67e1a7166
[Thread] ignore the flaky test case advertisingProxy_srpClientUnregistersService_serviceIsNotDiscoverableByMdns
The flakiness of this test case is 1%. Disable the test case to prevent
the whole test module from being demotioned.

Bug: 333078476
Bug: 333806992
Change-Id: I820f7a567a7827eee280d0f545c9f654efe5eeaa

Handa Wang   commited 2024-04-11 01:51:06 +00:00
7ade29d142
Dynamically set mesh-local addresses preferred lifetime.
When there is an active OMR address(not deprecated), set the mesh-local
addresses as non-preferred. When there is no active OMR address, set
the mesh-local addresses as preferred.

Bug: 323624146

Test: atest ThreadNetworkIntegrationTests

Change-Id: I969c20ddadfd2d0bd97499da48efc9b32cfa7e0b

Yang Sun   commited 2024-04-09 02:26:00 -07:00
79b202ac9f
[Thread] wait for Thread address updates on thread-wpan
There are timing issues in the current
tunInterface_joinedNetwork_otAddressesAddedToTunInterface test that the
OT addresses (e.g. Leader ALOC) may be updated after the device
attaches while the test doesn't wait for the addresses being propagated
to the system_server.

This commit fixes this issue by waiting for the addresses check for 1
seconds before timing out.

Bug: 333078476
Change-Id: If672aab7535f200bd38b50f1ce691b7c32e4cc75

Kangping Dong   commited 2024-04-07 15:04:53 +08:00
8f105009af
[Thread] add E2E UDP test for app usage
Bug: 323300829
Bug: 325983649
Change-Id: I0e6b9029cb58a2b985e80003d6339e536d706ed3

Kangping Dong   commited 2024-04-04 18:52:53 +08:00
e9daad6264
[Thread] enable Service Discovery integration tests
Bug: 328527773
Bug: 332452386

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

Change-Id: Ib1bc690c4f5bfcc30d4fb11b472fb4095505f1ef

Handa Wang   commited 2024-04-02 05:38:02 +00:00
b40140dcd0
Merge "set the country code when initializing the ot-daemon" into main
Zhanglong Xia   authored and   Gerrit Code Review   commited 2024-03-28 10:48:51 +00:00
1038c141fe
Merge "Separate Struct.java into its own lib." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-03-28 06:23:57 +00:00
68d68d82ed
[Thread] add a unicast routing case when infra link switches
Bug: 331567763
Test: atest ThreadNetworkIntegrationTests:android.net.thread.BorderRoutingTest#unicastRouting_afterInfraNetworkSwitchInfraDevicePingThreadDeviceOmr_replyReceived

Change-Id: I3bb0d4c8b1ab8d5e68c2fdcb854175d04dbe5336

Handa Wang   commited 2024-03-28 03:56:32 +00:00
d9e4ba6d26
set the country code when initializing the ot-daemon
The country code is lost after the ot-daemon is restarted. This
CL stores the country code to persistent settings and reads
out the previously stored country code to set the country code
when the ot-daemon is initialized.

Bug: b/326021472
Test: atest ThreadNetworkUnitTests

Change-Id: I6982a57ba4845f5a45f3366400c531398e82339e

Zhanglong Xia   commited 2024-03-28 10:36:24 +08:00
4eab54b40e
Separate Struct.java into its own lib.
* Struct.java is removed from net-utils-device-common-bpf and
  net-utils-device-common-struct's source list
* Created a lib net-utils-device-common-struct-base for Struct.java
* Updated libs that require Struct.java to include
  net-utils-device-common-struct-base.
* Replaced net-utils-multicast-forwarding-structs with
  net-utils-device-common-struct in service-connectivity

Bug: 323503345

Test: build tethering module.
Change-Id: I3f60715c3d8043b7569db7612dee9d4fa1ccba59

Yang Sun   commited 2024-03-27 20:15:17 +08:00
3aa62e6773
check the Thread required features before running ThreadNetworkControllerTest
This CL checks if the device supports Thread specific features before
running the test case ThreadNetworkControllerTest. If the device
doesn't support specific features, just skip the test case.

Bug: b/330879812
Test: atest ThreadNetworkIntegrationTests
Change-Id: I1452ab02cc62228102d4a140f39abf13b79542c7

Zhanglong Xia   commited 2024-03-26 13:20:24 +08:00
c1d4e1eea1
[mdns] support discovering and resolving services
Bug: 305866779
Test: atest ThreadNetworkIntegrationTests:android.net.thread.ServiceDiscoveryTest

Change-Id: I96ee5b835c90fa55136dbbde68d36bbf2044b420

Handa Wang   commited 2024-03-22 06:32:23 +00:00
abefbf0b9f
Merge "[Thread] fix ot-daemon state consistency issues" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-03-22 06:31:18 +00:00
3a9d363bdf
[Thread] fix ot-daemon state consistency issues
1. the OtDaemonState in OtDaemonCallbackProxy class is not cleared when
   ot-daemon dies
2. register ot-daemon state callback within the IOtDaemon#initialize API
   to avoid missing state changes between initialize() and
registerStateCallback()

Bug: 330441708
Change-Id: Ice58566582b40a6d25627cf01dec93da61ad3596

Kangping Dong   commited 2024-03-22 10:58:24 +08:00
0d22aded3d
[Thread] add system API setChannelMaxPowers
The `setChannelMaxPowers` allows privilege app to set the max
power of each channel. It is going to be used for controlling the
output power of the Thread radio chip.

Bug: b/320594263
Test: atest ThreadNetworkUnitTests && atest CtsThreadNetworkTestCases

Change-Id: Ic47eccd6de2da0e6cdb8f21d5b4df156b1f11747

Zhanglong Xia   commited 2024-03-22 10:49:09 +08:00
62abecc9b5
[Thread] add command to force stop ot-daemon
The Thread HAL supports only one client for a single Thread chip, so
ot-daemon needs to be force stopped in VTS tests because the testapp
needs to connect to the HAL service to perform tests.

Bug: 328538612
Change-Id: I5288e5747ab3957050d0e85c1ea684c6ead6c87d

Kangping Dong   commited 2024-03-21 19:02:39 +08:00
82599d3e21
[Thread] do not restart ot-daemon when Thread is disabled
Current implementation will auto-restart ot-daemon even when Thread
has been disabled by ThreadNetworkController#setEnabled(false). This
commit fixes this issue and also adds the "enable" / "disable" shell
command to ease testing.

Bug: 328538612
Change-Id: Icc9360ccf5d7daa6345def75d1860f046600b85b

Kangping Dong   commited 2024-03-20 23:49:53 +08:00
adb3c1ac62
Merge changes from topic "overlay-vendor-model-name" into main
* changes:
  [Thread] support customize meshcop txt via resourceoverlay
  [Thread] add resourceoverlay config for vendor and model name

Kangping Dong   authored and   Gerrit Code Review   commited 2024-03-19 12:21:23 +00:00
ab1945c790
[Thread] support customize meshcop txt via resourceoverlay
Currently support customizing the vendor name, vendor oui and model
name.

Bug: 311324956
Test: atest ThreadNetworkIntegrationTests:android.net.thread.ServiceDiscoveryTest#meshcopOverlay_vendorAndModelNameAreSetToOverlayValue
Change-Id: I3ad916112c73c3f8a7eef4e3fa8d421ab9bf8276

Kangping Dong   commited 2024-03-18 20:13:37 +08:00
ea4390cc4c
[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
[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
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 "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
Yang Sun   authored and   Gerrit Code Review   commited 2024-03-06 02:18:46 +00:00
da42fec566
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
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
[BBR] Apply downstream multicast config sent from ot-daemon
The multicast listening address from ot-daemon is maintained separately
from the bbr state. When bbr changes from primary to secondary, there
can still be subscribed addresses and should not be missed when switching
back to primary mode. So instead of sending address add/remove events
from ot-daemon and maintain the list in system server, ot-daemon will
send full list of addresses together with the multicast routing
enablement state each time there is an update to the bbr state or
listening addresses.

Bug: 321624274

Test: atest ThreadNetworkIntegrationTests

Change-Id: Ic9ce77bb7fdeacf2def216cf9bcd44095083a992

Yang Sun   commited 2024-02-28 15:07:30 +08:00
053ae87688
[Test] multicast forwarding from LLA/MLA address test
Added E2E test cases to verify that packets from Thread network with
link-local/mesh-local source address to multicast group with scope
larger than realm-local are not forwarded to infra link.

Bug: 325770316

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

Yang Sun   commited 2024-02-26 13:25:28 +08:00
12074b5fad
[Test] Thread multicast routing E2E test
Added E2E test for Thread multicast routing.

Bug: 320616891

Test: atest ThreadNetworkIntegrationTests:android.net.thread.BorderRoutingTest

Change-Id: Icbaa9f6645080bd1a0a95ddc7902b9a468dd0088

Yang Sun   commited 2024-02-26 13:22:51 +08:00
e056b9a188
Add a test case that a Border Router sends a UDP message to Thread device
This test case lets the BR send a UDP message to Thread device using
socket API and verify the message is received on the Thread device via
ot-ctl udp command.

For now this only verifies the direction BR -> ED because the other
direction ED -> BR is depending on platform UDP feature which is not
enabled yet.

Bug: 321168973
Test:  atest ThreadNetworkIntegrationTests:BorderRoutingTest#unicastRouting_borderRouterSendsUdpToThreadDevice_datagramReceived

Change-Id: I590583dd818f3d72dec41184e5427a8b08f842bb

Handa Wang   commited 2024-02-19 03:24:38 +00:00
b5c6ac2fe7
Merge "[Thread] restarts when ot-daemon crashes" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-02-01 15:24:26 +00:00
fbaa7ea0bc
[Thread] restarts when ot-daemon crashes
This commit handles the ot-daemon crash by automatically restarting it
and rejoin the network if ever joined.

This also fixes the address not deleted issue in TunInterfaceContorller.

Bug: 321540728
Bug: 309792480
Change-Id: I3ed466eb70818974a1e57f01456363bdf82915d5

Kangping Dong   commited 2024-02-01 21:49:31 +08:00
3deddc7b3f
[DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 12:34:50 +00:00
01b5ede2b2
[Thread] add ThreadNetworkIntegrationTests to mts-tethering
Bug: 299853805
Change-Id: I567142a8bf8c735b65048d985e94d958a7feef03

Kangping Dong   commited 2024-01-28 13:10:52 +08:00
25bcfee4e3
Make ThreadNetworkController.setTestNetworkAsUpstream require NETWORK_SETTINGS permission
This CL contains following enhancements:

- Enforce NETWORK_SETTINGS permission for ThreadNetworkController.setTestNetworkAsUpstream.
- Move the setTestNetworkAsUpstream in
  ThreadNetworkControllerService to make the order of methods more
logical.
- Update the test case name in BorderRoutingTest.

Bug: 295843010
Bug: 320842152

Change-Id: I82edac6c819dd637f4c98f31368a1b520338ce24

Handa Wang   commited 2024-01-19 08:15:58 +00:00
253b3fb6da
Ensure the Thread integration test only run on CuttleFish devices
This is because the test case relies on **simulation** Thread radio, which is currently only available on CuttleFish.

Bug: 295843010
Test: atest android.net.thread.BorderRoutingTest

Change-Id: Icd29d91c9ec9912e27191e97fe7f58e9067c1d8c

Handa Wang   commited 2024-01-18 12:00:14 +08:00
d5e2ac94d1
implement Thread Border Router e2e integration test
This implements a basic border routing test case (ping) and demonstrates a
valid test environment for Thread Border Router test cases.

Later we can add more packet verifications and more test cases.

Bug: 295843010
Test: atest android.net.ThreadBorderRouterTest

Change-Id: Ifb9b6d45539143a227c2bc0ed69b5c3167ef9acd

Handa Wang   commited 2023-12-26 15:24:54 +08:00
806f5a1bec