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
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
Make the default Thread and Border Router enabled state customizable for
vendor via resource overlay.
Bug: 322734489
Change-Id: I278d6afa82aac8d1bb06ee79f22bae6fb0199386
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
Existing ThreadNetworkControllerService tests are using RunAsShell to
grant the permissions for indivitual APIs. Given the permission checks
are tested in the CTS tests, this is not very useful with the overhead
of complicating the testing code. Instead, this CL grants all the
permissions in setUp() with spy-ed Context.
This commit also fixes the issue in b/326793058 that the tests doesn't
run on a U device where the THREAD_NETWORK_PRIVILEGED permission doesn't
exist.
Bug: 326793058
Test: m ThreadNetworkUnitTests
Change-Id: I477cf30d737969ccf12180eae48d3b8fd6ed4a51
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
The API `createRandomizedDataset()` randomly selects a channel
between channel 11 and 26. But not all countries support channels
between 11 and 26.
This CL selects random channel from the preferred channel mask if
the preferred channel mask is not 0, otherwise choose one from the
supported channel mask.
Bug:b/308310823
Test: atest ThreadNetworkUnitTests && atest CtsThreadNetworkTestCases
Change-Id: I6add3edc7e4fa888c46b57c4463ab18e0aa84e80
This commit follows the guideline in go/ae-v-thread-admin-control that
Thread radio should be disabled when the user restriction is set and
nobody can enable Thread again (it fails with
ERROR_FAILED_PRECONDIFITION).
This commit adds only unit tests, E2E CTS tests are tracked in b/319079428
Bug: 319077876
Change-Id: I8981aa9e71948c64ee79701427ac794880826327
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
Per CTS review comment in aosp/2949385:
```
You might want to make this a bit larger, otherwise if some new error codes are added in the future in a mainline update, already released CTS test packages will start to fail.
That should be fixed by mCTS, but since mCTS is not in place yet, it's best to be safe
```
This commit moves the too-large error code check into unit test to avoid
potential CTS compatibility issues.
Bug: 323791003
Change-Id: If99191630e1044cb8f5ed189bf79567cd51c3905
For ot-daemon to perform mDNS operations, we need to implement an AIDL
service NsdPublisher. MdnsPublisher forwards the calls to NsdManager.
For now, only register & unregster a service without a custom host is supported.
Bug: 320211657
Bug: 318323473
Test: atest CtsThreadNetworkTestCases
Change-Id: Ia392a0f57046f53973ac6bd6043dec915d170666
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