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
Test: verified that when the config is set to `false`, thread won't start up after reboots:
```
➜ main-aosp-2 adb shell ot-ctl state
leader
Done
➜ main-aosp-2 adb reboot
➜ main-aosp-2 adb shell ot-ctl state
/system/bin/sh: ot-ctl: inaccessible or not found
➜ main-aosp-2 adb root
➜ main-aosp-2 adb shell ot-ctl state
disabled
Done
```
Bug: 378587036
Change-Id: I4d1c90ab3121f39219cbaf795879a7ba91db02a3
It's default enabled that it waits for border routing establishment
before starting the SRP server. But there are also use cases where
the user may want to know what are the devices in the Thread network
before actually reach to the devices, or it doesn't depend on border
routing to reach to a Thread device.
Given that, this commit adds the support of starting SRP server
without waiting for border routing by adding a new
Runtime Resource Overlay configuration parameter:
config_thread_srp_server_wait_for_border_routing_enabled
Test: it's difficult to assert on the SRP server starts up timing. But manually verified that the SRP server starts without waiting for the routing manager when the RRO config is flipped:
```
01-09 20:18:35.835 7555 7555 I ot-daemon: [I] RoutingManager: RsSender: Sent RS 1/3
01-09 20:18:35.835 7555 7555 I ot-daemon: [I] RoutingManager: Received RS from fe80:0:0:0:98af:44ff:fe2e:fa80 on infra netif 17
01-09 20:18:35.835 7555 7555 I ot-daemon: [I] RoutingManager: Will evaluate routing policy in 00:00.150 (150 msec)
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] NetDataPublshr: DNS/SRP service - State: Adding -> Added
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] SrpServer-----: Start listening on port 53536
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] NetworkData---: Sent ServerData
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] NetworkData---: Received ServerData
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] NetworkData---: Allocated Service ID = 1
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] NetworkData---: Sent ServerData ack
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] Notifier------: StateChanged (0x00000200) [NetData]
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] Mle-----------: Send Data Response (ff02:0:0:0:0:0:0:1)
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] BbrLeader-----: PBBR state: Unchanged
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] BbrLeader-----: Rloc16:0x8800, seqno:69, delay:5, timeout:3600
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] RoutingManager: Will evaluate routing policy in 00:03.558 (3558 msec)
01-09 20:18:35.926 7555 7555 I ot-daemon: [I] NetDataPublshr: DNS/SRP service (state:Added) in netdata - total:1, preferred:0, desired:2
```
Bug: 378587036
Change-Id: Ib768014f3c44dca89390cec823a1c2acac38ab0d
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
In the situation where infra state changes very frequently, it may cause the border routing to frequently restart.
Bug: 377821980
Test: atest ThreadNetworkIntegrationTests
Change-Id: Id2862b0db7e01f89da20c56c4ad2f0086d4b6a98
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
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
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
This CL passes the DNS servers' information to ot-daemon which was
fetched from LinkProperties of the infra link. This can enable the DNS
recursive resolver feature of the Thread Border Router.
The integration test case will be covered when aosp/3259932 is merged. Currently the test case CL cannot be merged because the there's a dependency PR in GitHub hasn't been merged: https://github.com/openthread/openthread/pull/10864.
Bug: 365892457
Bug: 354868095
Test: atest ThreadNetworkIntegrationTests:android.net.thread.InternetAccessTest
Change-Id: I66e54715ecaf8e0a43324d4afd4398e8884d8738
This CL adds a switch to the Thread demo app that allows the user to enable or disable NAT64.
See screenshot https://screenshot.googleplex.com/3UDJ6wXqRf6WKRy.
Bug: 375559106
Change-Id: I2a5c9f08ef664e62a5c34987eedb321e2b01fd85
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
This CL marks ThreadConfiguration#isDhcpv6PdEnabled() as @hide because
there's no way yet to set it as enabled. When PD is implemented, we'll
expose this API as System API.
Bug: 342519412
Change-Id: I6b8f7b83bd01c0ba045c777e6f613bc4a74d9dfb
The size of the lambda in ThreadNetworkControllerService#initialize() is getting larger so we introduce #initializeInternal() for better readability.
Change-Id: Idd7cb57e5ed03d27210c1199e03bfab51dbd1215