The SparseArray.indexOfValue() uses == to compare values,
MulticastRoutingCoordinator uses SparseArray with String type values,
and the indexOfValue function would sometimes return -1 when looking for
a value in the SparseArray.
Added a helper function getIndexForValue in CollectionUtils to get index
by comparing values with equals, and used this function in MulticastRoutingCoordinator.
Updated
MulticastRoutingCoordinatorServiceTest#testMulticastRouting_applyConfigNone_removesMfc
test case to use copies of interface names when updating the multicast
configs, so the test would fail without this fix.
Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.CollectionUtilsTest#testGetIndexForValue
atest android.net.connectivity.com.android.server.connectivity.MulticastRoutingCoordinatorServiceTest#testMulticastRouting_applyConfigNone_removesMfc
Change-Id: I862242d6be01b8552cdd6af6c9691948a9f0bfe0
Many Thread radio chips need to reduce their transmit power on edge
channels to pass regulatory RF certification. This CL restrcits the
dataset to select a channel from channel 11 to 24.
Bug: b/331708479
Test: atest ThreadNetworkUnitTests
Change-Id: I758c9f33629a0cafcc39bb9fde0ad45ab2699db8
It's too strict that the device must rejoin the network after being
enabled again. This probably don't work on mobile devices. remove the
CTS case for now.
Change-Id: I3a4511f4b2fddddf982206720bbb61f718bc8327
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
testReadWriteProgram is annotated with IgnoreUpTo(U), but because the
class does not use the rule, that has no effect.
Fix that by adding the rule.
Note that DevSdkIgnoreRunner only affects running the whole class
(having IgnoreUpTo at the class level), not annotated individual tests.
Test: atest
Bug: 333208995
Change-Id: I56b9c0775c3f39bb0f133705e57a41717a7d777b
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
* changes:
Suppress ktlint:standard:comment-wrapping warning
Toggle screen state before and after ApfIntegrationTest
Resume before releasing network request
Patrick Rohrauthored and Gerrit Code Reviewcommited 2024-04-05 20:35:28 +00:00
standard:comment-wrapping does not allow annotating function argument
literals inline (since block comments must not be surrounded by code).
So the following annotations are not allowed in ktlint:
foo(1 /* bar */)
Unfortunately, there are not good alternatives. Named arguments can only
be used to call Kotlin functions and are not a general solution.
Instead, disable this linter rule for the entire file.
This also adds a suppress annotation further down in the file, since
ktlint does not like the extra space required to make the comments line
up horizontally...
Test: repo upload --dry-run
Change-Id: I62fdb0347965ee3fc43783eb07af47e95af882a5
APF is supposed to run when the screen is off. This change turns the
screen off as part of setUp() and turns it back on in tearDown() (since
apparently CTS is run with the screen on as some tests rely on it).
turnScreenOn() / turnScreenOff() also acquire / release a partial
wakelock to prevent the CPU from suspending during the test.
Test: atest ApfIntegrationTest
Change-Id: I31f04f4d39284be387006fdd9d0a7c0e27feddb5
There was a circular dependency between net-tests-utils-host-common and
ConnectivityTestPreparer. This hasn't caught because Soong didn't track
the required dependency (ConnectivityTestPreparer requires the other).
However, as Soong is fixed to track the dependency type, this is caught
as an error.
Dropping the "required" dependency because net-tests-utils-host-common
is a host test module and is the entry point.
Bug: 321626681
Test: m
Change-Id: I539bbe2689be0af52bfec35966dd8210137d6c72
Technically, this does not matter. If the network goes away before
resume is called, then resume will fail. But the network is going away
anyway... In any case, tearing down the test in opposite order of setup
is good practice.
Test: TH
Change-Id: I21f95499dbddb6003ac12c51a67a7638058e20e3
Validates that reading and writing APF memory behaves as expected across
the entire range of usable memory.
Before V, APF integration is broken in many different ways, so this test
only runs on V+ for now. A separate test will be added for pre-V
devices.
Test: atest ApfIntegrationTest
Change-Id: I3002c03b51bedd23a8cfb2513f5ae01a200445a4
setUp() / tearDown() run on devices that might not support APF in which
case they should not cause a test failure.
Tests will be appropriately guarded by checking the APF capabilities.
Test: TH
Change-Id: I8689f96ecac0a21dfb4ab8786fec11c01f30d1c2
NsdServiceInfo may contain an interface index if it was obtained from a
previous discovery callback which found a service on an interface that
does not belong to any Network.
In that case, subsequent resolve or registerServiceInfoCallback queries
using that NsdServiceInfo should only be done on the matching interface.
Apps may otherwise receive replies from other networks, with different
interface addresses.
As a simple fix, still request sockets from all interfaces in that case,
but only create the MdnsServiceTypeClients on matching sockets.
The sockets are created / cleaned up based on the lifecycle of the
requests, which does not change.
Fixes: 332262554
Test: atest
Change-Id: I2bbb498d4a0d37725f019a4cf5e367fef76fa0e8