Commit graph android_packages_modules_Co.../thread/tests/integration
Message SHA1
[Thread] create standalone border router test module
This is for reduce the overall time of the ThreadNetworkIntegrationTests
which now runs twice for both BR and non-BR cases

Bug: 403360961
Bug: 402480982

Change-Id: Ifa80b8e8885ed980064f92100ef817f9f62b4dc2

Kangping Dong   commited 2025-03-17 10:50:38 +08:00
f96d06db57
[Thread] prefer only ML-EID in case OMR is missing
This is to avoid applications uses Aloc address for source address which
would cause issues when there are multiple devices sharing the same
Aloc.

Bug: 396019291

Change-Id: I287007ddecd9d0fa2ac8da92f4de691e7844b259

Kangping Dong   commited 2025-03-13 15:27:37 +08:00
74a6ca6478
Fix flaky test for trel service discovery
When checking for trel services published by a BR, we need to filter the
services by their service name, since there might be other devices
publishing trel service at the same time.

Bug: 399518677
Change-Id: I56518dbe6c79b48aa048073d8556a53e1261e8bd

Yang Sun   commited 2025-03-12 07:18:16 +00:00
ffd3986c99
Merge changes from topic "thread-router" into main
* changes:
  [thread] refactor the settings module
  [thread] Support non-BR mode

Kangping Dong   authored and   Gerrit Code Review   commited 2025-03-11 03:37:36 -07:00
7cb5078ba1
Merge "Fix flaky tests of route propagation from netdata to tun interface in ThreadIntegrationTest" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-11 02:18:20 -07:00
c2eba15017
[thread] Support non-BR mode
This commit adds a resource overlay config for OEMs to disable the
Border Router feature by default. Also updates the tests to cover both
BR and non-BR use cases

Bug: 401654864
Change-Id: I7dd4363836269a08853b58304f62fe52f9021a9e

Kangping Dong   commited 2025-03-11 17:09:29 +08:00
82988c3d98
Fix flaky tests of route propagation from netdata to tun interface in ThreadIntegrationTest
Wait for route to be added/removed from link properties in the tests
instead of checking immediately, as it takes time for the change to
propagate from ot.

Bug: 401815392
Change-Id: Ie95f4beaa370514d31875b9f2e926762a38bc99e

Yang Sun   commited 2025-03-11 07:40:38 +00:00
82cdf67a19
Merge "skip the country code test when the country code is not support" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2025-03-09 21:49:10 -07:00
749898bb1e
skip the country code test when the country code is not support
Setting country code is not a must support feature on all platforms.
This commit skips the country code related tests when the platform
doesn't support setting the country code.

Bug: b/401793629
Test: atest ThreadNetworkIntegrationTests

Change-Id: I6bb8444f70afb2635d7791af2128741bc02e8ff3

Zhanglong Xia   commited 2025-03-10 02:22:21 +00:00
38aa51aaf2
[Thread] Replace the "ot-ctl factoryreset" with the java leave() API
The leave() API can now correctly clear the in-memory state for the
Thread stack, it's better to use the leaveAndWait() API in the tests to
ensure timing sequences

Bug: 338061061
Change-Id: Ic91f8043cd5a35f19b9161c5778f83b83a713946

Kangping Dong   commited 2025-03-04 15:14:48 +08:00
cbfe8c938e
[Thread] In Integration test, let the DNS client wait for DNS server to show up in Network Data
The bring up delay of SRP server is higher than before. In the integration test case we need to explicitly wait for the SRP server to show up in Network Data. Otherwise the test may be flaky.

Bug: 399263029
Change-Id: Id6346bcbfd55a34103ba8de0dcee75d3cacde446

Handa Wang   commited 2025-02-26 01:16:41 -08:00
b68f4ace76
[Thread] fix the failure in ThreadIntegrationTest
This test had an assumption that Thread is enabled which is not true. This CL enables Thread in the setUp().

Bug: 397583601
Change-Id: I9c4d5028a663c6fe1c581267ff7d172d0cba577c

Handa Wang   commited 2025-02-19 01:20:23 -08:00
424aec63e2
Add logs in IntegrationTestUtils.kt for service discovery
Bug: 338061061
Change-Id: I17f52e7272c42c3a347e32b89d9d0a64edabcd4e

Yang Sun   commited 2025-01-02 16:53:35 +08:00
be81b8415c
Merge "Handle non IPv6 packet in getRaPios" into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-12-06 05:35:26 +00:00
5123022755
Handle non IPv6 packet in getRaPios
Bug: 338061061

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

Change-Id: Ia637dc8ec4cca919bd1957148ec2c104ab1895ac

Yang Sun   commited 2024-12-06 02:18:22 +00:00
5b018cfd06
[Thread] refactor OtDaemonServer::Initialize argument order
see aosp/3391987 for background

Change-Id: I798bfc172e3207c97d520785d62f5381c9d050ad

Kangping Dong   commited 2024-12-05 15:54:55 +08:00
7ce2471354
Merge "Add test for TREL service not unpublish when feature disabled" into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-11-21 07:10:55 +00:00
5c66824a44
Add test for TREL service not unpublish when feature disabled
Bug: 379804913

Change-Id: I8dd98a0605dd7e9c53b144f6227791a2080e8263

Yang Sun   commited 2024-11-21 10:22:32 +08:00
51d7725e08
Merge "Configure TREL feature from feature flag." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-11-19 06:08:23 +00:00
41fa2d75a1
Configure TREL feature from feature flag.
Bug: 354868035
Bug: 359089751

Test: atest ThreadNetworkIntegrationTests:ServiceDiscoveryTest#trel_servicePublished

Change-Id: Ib545df6bf5ce20f35914b4695dbd2e3c1e1232e4

Yang Sun   commited 2024-11-18 20:13:00 +08:00
bb7efba754
[Thread] Add a NAT64 test case after switching to another infra network
Bug: 377618622
Change-Id: I699a218a3bb18582406654381cd31c26675f3c77

Handa Wang   commited 2024-11-13 05:20:03 +00:00
26a68af724
[Thread] introduce TestTunNetworkUtils and use it in existing test cases
TestTunNetworkUtils is a centralized place to control the test TUN networks used by integration test. With this we can safely tear down all test networks in `teardown()` instead of tearing down the newly created network in `finally` clause.

Bug: 377640059
Change-Id: I57b34bb2644bd6a5bb73ed1573932f35de657c8f

Handa Wang   commited 2024-11-13 04:29:10 +00:00
ebd31b8a6a
[Thread] add integration tests for aosp/3334156
Bug: 374037595
Change-Id: I1a380067681297c6047d9b0b772c873ecd110754

Kangping Dong   commited 2024-11-06 16:35:28 +08:00
3b6bb1ba4a
[Thread] save time in InternetAccessTest by only joining the network once
Similar to aosp/3325897

Change-Id: Ifba212b22f86a9131c718b5c2ab544a6bbbbf1b4

Handa Wang   commited 2024-11-06 03:05:28 +00:00
e9e00def4d
[Thread] add a NAT64 test case for UDP echo server
This CL adds a test case for UDP traffic in InternetAccessTest. The test case verifies that a Thread device can send a UDP message to a UDP echo server and receive a reply.

Bug: 374232259
Change-Id: Id138248f1ed26c1cc5728cc06b42e3223c449125

Handa Wang   commited 2024-11-05 09:00:50 +00:00
18e8b27832
[Thread] create a base class TestUdpServer
This class is useful for creating a class that responds to specific type of UDP messages. E.g. DNS server and UDP echo server.

Bug: 356770473
Test: atest ThreadNetworkIntegrationTests:android.net.thread.InternetAccessTest

Change-Id: I6880bb825ac5077d4a73f9d986116c571863e1d8

Handa Wang   commited 2024-11-05 09:00:46 +00:00
23ee433f03
[Thread] join/leave the network only once to save time in BorderRoutingTest
This can save around 10 seconds per test case.

Bug: 376423433
Change-Id: I7c61d03a57c06ff391b6486ac4e9b201adf67483

Handa Wang   commited 2024-11-01 09:03:40 +00:00
e61c10a2e7
Merge "[Thread] Disable flaky test nat64_withAilNat64Prefix_threadDevicePingIpv4InfraDevice_outboundPacketIsForwarded" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 15:41:14 +00:00
0f0885aa40
Merge "[Thread] add private API for disabling border router" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 15:30:43 +00:00
a2f666e08a
[Thread] add private API for disabling border router
Bug: 374036806
Change-Id: Ib8ca8bbd2b3018c39c9250e1b3ce70b193273c1b

Kangping Dong   commited 2024-10-31 14:30:25 +08:00
56449db1be
[Thread] Disable flaky test nat64_withAilNat64Prefix_threadDevicePingIpv4InfraDevice_outboundPacketIsForwarded
Bug: 376573921
Change-Id: I017a7c3bfbb46a367a32156159495930120adb35

Handa Wang   commited 2024-10-31 05:09:38 +00:00
833b22da87
[Thread] add an integration test case for resolving a host via DNS recursive resolver
This CL adds new test cases for verifying the Thread Border Router's
DNS Recursive Resolver feature: The DNS clients resolves google.com
successfully when the feature is enabled.

Bug: 354868095
Test: atest ThreadNetworkIntegrationTests:android.net.thread.InternetAccessTest

Change-Id: I1b021151c6843b30c3f47559ab20dec405af5dea

Handa Wang   commited 2024-10-30 06:42:17 +00:00
5e8a1fdfda
Merge "[Thread] request/release the NAT64 CIDR" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-10-23 07:11:52 +00:00
ec5bc1fc13
[Thread] request/release the NAT64 CIDR
This CL implements the logic to maintain the NAT64 CIDR at ThreadNetworkControllerService. When NAT64 is enabled, the service needs to request a CIDR via RoutingCoordinatorManager#requestDownstreamAddress(). When NAT64 is disabled, the service needs to release the CIDR via RoutingCoordinatorManager#releaseDownstreamAddress().

Bug: 350699020

Change-Id: I16397fd48c2925efd9d4833a335cf73832b4f4d6

Handa Wang   commited 2024-10-23 01:31:43 +00:00
a7318da774
[Thread] fix the test util of setNat64EnabledAndWait to apply old config
Bug: 356770473
Change-Id: I6d1e3d6acc9a101b3e783ab4493ed25a3aa732a1

Yang Sun   commited 2024-10-21 08:45:59 +00:00
ee4ab96116
[Thread] use setConfiguration API in NAT64 tests
Bug: 356770473

Change-Id: I98c80de24cbaaa7206ddbd2bf62350066c998ba5

Handa Wang   commited 2024-10-21 06:04:09 +00:00
52c72a11bf
[Thread] add CLI commands for getting/setting config
Bug: 364237115

Change-Id: Ice42d7d02cfefd733042282939635502c259d9d5

Handa Wang   commited 2024-10-17 07:40:42 +00:00
7eb1bbd369
Merge "[Thread] add configuration methods in ThreadNetworkControllerWrapper" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-10-17 05:37:33 +00:00
fe6dedde08
[Thread] add configuration methods in ThreadNetworkControllerWrapper
Change-Id: I56b4ca76e7f62d924f99527b36eac24ed151c53b

Handa Wang   commited 2024-10-16 14:55:19 +00:00
1c7d51a743
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
[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 "[Thread] support discovering NAT64 prefix from AIL" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-09-23 03:58:57 +00:00
5f9a3d042e
[Thread] support discovering NAT64 prefix from AIL
Bug: 357479886

Change-Id: I8dfd96a0ba3e927ed4cbc8ceecb18652adf98964

Handa Wang   commited 2024-09-23 02:35:07 +00:00
b47c325907
Allow ot-ctl command under ADB Thread Network Service : support of non-interactive mode
Bug: 351721329

Test: atest ThreadNetworkUnitTests

Change-Id: Id7443c24ea380d200e73cca4ead2284249f2052f

Yang Song   commited 2024-09-20 03:58:14 +00:00
ffceaae1b8
Make java_sdk_library dependencies explicit
modules should specify the submodule of java_sdk_library that the module
actually depends on

Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a

Jihoon Kang   commited 2024-09-10 00:01:31 +00:00
8401b6a9f0
[Thread] move infra network utilities to IntegrationTestUtils.kt
This CL moves setUpInfraNetwork(), tearDownInfraNetwork() and
startInfraDeviceAndWaitForOnLinkAddr() into IntegrationTestUtils.kt
because they'll also be used by Internet Access test cases which will be
in a new file.

The methods are refactored in Kotlin to be easier used in new test
cases. The new test cases will also be written in Kotlin.

Bug: 356770473

Change-Id: I2e5788ba87f9f86dd14d382db0b0de791bcbce6a

Handa Wang   commited 2024-09-05 05:59:51 +00:00
d92b389c63
[Thread] refactor IntegrationTestUtils to use Kotlin
This CL refactors IntegrationTestUtils class to Kotlin. As more test
cases are introduced, it's likely we'll add more code into this class.
It's worth a refactor of the code so that we can write the new code in
Kotlin which is more concise and safer.

Change-Id: I8b71c5183cad9224ee49e2192aa5aab62aae9ddb

Handa Wang   commited 2024-09-05 05:59:46 +00:00
26b68536bf
changes the API setChannelMaxPowers from hide API to system API
This CL changes the hiden API `setChannelMaxPowers` to system API
to allow the privilege app to set the max power of each Thread channel.

Bug: b/346686506
Test: atest CtsThreadNetworkTestCases
Change-Id: I1089a4a315971c3bca8ec688a02143ddec93d039

Zhanglong Xia   commited 2024-08-26 10:07:36 +08:00
5bbfd91b04
[Thread] add an integration test case for NAT64
This CL adds an integration test case for NAT64. Because the feature is
not fully ready, we need some extra setup steps to make the feature
work. That is, specifying a CIDR for NAT64. Also, this test case is
based on `ot-ctl` but eventually the test should be based on API.

This CL requires https://github.com/openthread/openthread/pull/10566.

Bug: 356770473
Test: atest ThreadNetworkIntegrationTests

Change-Id: Idfb5ad848f7b2369591e47558ea67017c0b31e19

Handa Wang   commited 2024-08-07 01:12:50 +00:00
d38b7cb30f
[Thread] support polling IPv4 packets in integration test
This CL also refactors the IntegratoinTestUtils a bit to make it more
reusable.

Bug: 356770473
Test: CI

Change-Id: Ief94e312e06e4b62c71284c8ff0ef710f0b632fb

Handa Wang   commited 2024-08-07 01:12:46 +00:00
09e71714fb