Commit graph

103,295 commits

Message SHA1
Use helper function getIndexForValue in MulticastRoutingCoordinator.
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

Yang Sun   commited 2024-04-23 17:22:15 +08:00
4e7baadc71
Merge "[Thread] ignore the flaky test case meshcopService_joinedNetwork_discoveredHasNetwork" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-04-10 10:17:31 +00:00
9671e9a6d8
Merge "dataset selects a channel from channel 11 to 24" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-04-10 08:27:58 +00:00
e435650d41
Merge "[Thread] loose the restriction on the setEnabled API behavior" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-04-10 08:20:09 +00:00
df357e3612
dataset selects a channel from channel 11 to 24
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

Zhanglong Xia   commited 2024-04-10 14:43:17 +08:00
dac352d489
[Thread] ignore the flaky test case meshcopService_joinedNetwork_discoveredHasNetwork
Bug: 333649897
Bug: 332782903

Test: CI

Change-Id: I74e8e00f709c5820c58b85dbf90f2ab8019eb65a

Handa Wang   commited 2024-04-10 06:31:11 +00:00
81804470f9
[Thread] loose the restriction on the setEnabled API behavior
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

Kangping Dong   commited 2024-04-10 13:06:43 +08:00
504fe7d510
Merge "Dynamically set mesh-local addresses preferred lifetime." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-04-10 02:13:12 +00:00
7e68d550f7
Merge "Revert^2 "Revert "Revert "Revert "[Cronet] Disable one of setURLSt..."" into main
Chidera Olibie   authored and   Gerrit Code Review   commited 2024-04-09 18:24:33 +00:00
6a9eacca94
Merge "Revert^2 "Revert "Revert "Revert "cronet 121_0_6167_71: remove htt..."" into main
Chidera Olibie   authored and   Gerrit Code Review   commited 2024-04-09 18:24:33 +00:00
a7c3b506d7
Revert^2 "Revert "Revert "Revert "[Cronet] Disable one of setURLSt..."
This reverts commit 67df9f0870.

Reason for revert: broke native coverage b/333108088

Change-Id: Ice6cedcdeb35644eb0ee9edbac659feed21496ad

Chidera Olibie   authored and   Gerrit Code Review   commited 2024-04-09 15:00:27 +00:00
9957a8bb71
Revert^2 "Revert "Revert "Revert "cronet 121_0_6167_71: remove htt..."
This reverts commit 1ba19c9c67.

Reason for revert: broke native coverage b/333108088

Change-Id: I6a6a9ca3a82ceb8109beea66fcc95c8d8e4a0620

Chidera Olibie   authored and   Gerrit Code Review   commited 2024-04-09 14:53:21 +00:00
2a85b5e7da
Merge "Add DevSdkIgnoreRule to ApfIntegrationTest" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-04-09 10:45:59 +00:00
6e634b3440
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
Merge "Move setupOnce from EthernetTetheringTestBase to EthernetTetheringTest" into main
Mark Chien   authored and   Gerrit Code Review   commited 2024-04-09 07:42:11 +00:00
01e091b1fb
Add DevSdkIgnoreRule to ApfIntegrationTest
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

Remi NGUYEN VAN   commited 2024-04-09 15:26:19 +09:00
7780b674b6
Merge "Drop circular dependency" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-04-08 12:51:28 +00:00
588a9d5b26
Merge "[Thread] wait for Thread address updates on thread-wpan" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-04-08 08:48:48 +00:00
312c70c459
Merge "Improve the nduser option log readability." into main
Xiao Ma   authored and   Gerrit Code Review   commited 2024-04-08 01:25:21 +00:00
1cf1b5f785
[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
Merge "Deflaking network access checks in CtsHostsideNetworkTests" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-04-06 05:48:36 +00:00
1d73c6bea5
Merge changes I62fdb034,I31f04f4d,I21f95499 into main
* changes:
  Suppress ktlint:standard:comment-wrapping warning
  Toggle screen state before and after ApfIntegrationTest
  Resume before releasing network request

Patrick Rohr   authored and   Gerrit Code Review   commited 2024-04-05 20:35:28 +00:00
db5b55dda8
Suppress ktlint:standard:comment-wrapping warning
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

Patrick Rohr   commited 2024-04-05 11:57:42 -07:00
9c3cbe5dd2
Toggle screen state before and after ApfIntegrationTest
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

Patrick Rohr   commited 2024-04-05 11:57:42 -07:00
30c9382181
Improve the nduser option log readability.
Before:
Nduseroptmsg(10, 40, 48, 134, 0, fe80::2a00:79e1🔤f605%wlan0)

after:
Nduseroptmsg(family:10, opts_len:40, ifindex:48, icmp_type:134, icmp_code:0, srcaddr: fe80::2a00:79e1🔤f605%wlan1, NdOptRdnss(type: 25, length: 5, reserved: 0, lifetime: 1209600,servers:[2001:4860:4860::6464,2001:4860:4860::64]))

Bug: 315069348
Test: TH
Change-Id: I3abfbecd53a8cc00eaed9cbac1d9fe187d265847

Xiao Ma   commited 2024-04-05 18:25:54 +09:00
6fc458350a
Drop circular dependency
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

Jiyong Park   commited 2024-04-05 14:34:10 +09:00
093a4cfa95
Merge "Add current clients to servicediscovery dumpsys" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-04-05 02:25:36 +00:00
f421a45491
Merge "Add testReadWriteProgram to ApfIntegrationTest for V+" into main
Patrick Rohr   authored and   Gerrit Code Review   commited 2024-04-05 02:09:51 +00:00
02a3604464
Resume before releasing network request
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

Patrick Rohr   commited 2024-04-04 16:34:49 -07:00
39c203f431
Add testReadWriteProgram to ApfIntegrationTest for V+
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

Patrick Rohr   commited 2024-04-04 16:34:49 -07:00
4790aa9831
Merge "Store MAC address of tethering interface in EthernetTracker" into main
Chris Desir   authored and   Gerrit Code Review   commited 2024-04-04 20:53:05 +00:00
027cdcee74
Store MAC address of tethering interface in EthernetTracker
Test: atest FrameworksNetTests
Bug: 142259350
Change-Id: I6b4f6d66d65b0557ac35cae2694109c7100df6b9

Chris Desir   commited 2024-04-04 12:00:42 -07:00
027b914b1d
Align APF capabilities test closer to VSR requirements
This change cleans up the APF capabilities test and aligns it closer to
what is written in the VSR preview:
https://androidpartner.devsite.corp.google.com/gms/policies/preview/reqs#gms-vsr-apf

This includes changing VSR API level checks to compare against literal
values, as vendor API levels do not match SDK levels anymore starting
with 202404.

See docs for more information:
https://g3doc.corp.google.com/wireless/android/partner/compatibility/g3doc/dev/write-a-test/index.md?cl=head#write-a-test-depending-on-api-level

This test should also purely be based on the VSR API level, so the
DevSdkIgnoreRule and assumption check in setUp() are being removed.

Test: TH
Change-Id: I1f80ee662721557ec63694302fa0f66a666ceeb1

Patrick Rohr   commited 2024-04-04 10:57:03 -07:00
f0766dc9e1
Do not use runShellCommandOrThrow in setUp / tearDown
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

Patrick Rohr   commited 2024-04-04 10:57:03 -07:00
6a62806a52
Merge "[Thread] add E2E UDP test for app usage" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-04-04 12:17:35 +00:00
737a0be559
[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
Add current clients to servicediscovery dumpsys
In addition to logs, add the list of current clients and their requests
to the servicediscovery dumpsys.

This is useful to know what is being queried at a given time, and to
monitor listener leaks (sometimes by apps).

Sample output:
Active clients:
  mUid 1000, mResolvedService null, mIsLegacy false, mUseJavaBackend \
      true, mClientRequests:
    2: Advertiser: serviceFullName=OpenThread BorderRouter \
            #850C._meshcop._udp, net=null \
        {2, startTime 18721, foundServices 0, lostServices \
	0, fromCache false, sentQueries 0}

  mUid 10108, mResolvedService null, mIsLegacy false, mUseJavaBackend \
      true, mClientRequests:
    16: Discovery/DiscoveryListener: \
        serviceType=_nmt227941123._tcp.local, net=null \
	{17, startTime 298263, foundServices 3, lostServices \
	3, fromCache false, sentQueries 18}
    24: Advertiser: \
        serviceFullName=NsdTest223067831._nmt295637688._tcp, net=122 \
        {25, startTime 301849, foundServices 0, lostServices 0, \
	fromCache false, sentQueries 0}
    25: Discovery/DiscoveryListener: \
        serviceType=_nmt295637688._tcp.local, net=122 \
	{26, startTime 302663, foundServices 0, lostServices \
	0, fromCache false, sentQueries 1}

Test: dumpsys servicediscovery
Change-Id: I19051911a2f47582c75a564e1eeb1825796656bf

Remi NGUYEN VAN   commited 2024-04-04 17:22:16 +09:00
63abf95dcb
Merge changes from topic "revert-3005178-revert-3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA-OOMALUYYUV-HXQZEVTNSQ" into main
* changes:
  Revert "Revert "Revert "Revert "cronet 121_0_6167_71: remove htt..."
  Revert "Revert "Revert "Revert "[Cronet] Disable one of setURLSt..."

Chidera Olibie   authored and   Gerrit Code Review   commited 2024-04-03 08:53:08 +00:00
22cc321820
Merge "Use NsdServiceInfo ifIndex in MdnsDiscoveryManager" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-04-03 05:14:54 +00:00
08b316bab0
Merge "Replace connectToCell -> NetworkCallbackRule" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-04-03 04:15:41 +00:00
d5a8d41172
Use NsdServiceInfo ifIndex in MdnsDiscoveryManager
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

Remi NGUYEN VAN   commited 2024-04-03 12:58:51 +09:00
894f181c89
Call getCapabilities in setUp
Every test starts by fetching the capabilities, so it makes sense to
move it to setup.

Test: TH
Change-Id: I232355aafd91acc00079bd4efb0abd5d206d5a07

Patrick Rohr   commited 2024-04-02 14:53:30 -07:00
ad4f132c29
Use truth assumption checks
This results in more readable assumption failures.

Test: TH
Change-Id: Ie8670183ce7ebf71ba5efa015f2ff294698ed936

Patrick Rohr   commited 2024-04-02 14:53:30 -07:00
ac9b287b2c
Merge "Do faster bitmask checks on NetworkCapabilities" into main
Shai Barack   authored and   Gerrit Code Review   commited 2024-04-02 18:32:40 +00:00
0634c7c4d2
Merge "Allow HW address retrieval from EthernetNetworkFactory" into main
Chris Desir   authored and   Gerrit Code Review   commited 2024-04-02 16:27:09 +00:00
36061871d7
check lateinit property ifname isInitialized in tearDown
Bug: 332464546
Change-Id: I5085ad42c9456e89974c1fc33149e468483e340f
Test: TH

Patrick Rohr   commited 2024-04-02 14:44:08 +00:00
e380bc0000
Revert "Revert "Revert "Revert "[Cronet] Disable one of setURLSt..."
Revert submission 3005178-revert-3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA-OOMALUYYUV

Reason for revert: aosp/3022283 fixed coverage issue

Reverted changes: /q/submissionid:3005178-revert-3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA-OOMALUYYUV

Change-Id: Ifb729927f64016383f75f8f4f0f3ae06a8fc2625

Chidera Olibie   commited 2024-04-02 12:07:04 +00:00
67df9f0870
Revert "Revert "Revert "Revert "cronet 121_0_6167_71: remove htt..."
Revert submission 3005178-revert-3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA-OOMALUYYUV

Reason for revert: aosp/3022283 fixed coverage issue

Reverted changes: /q/submissionid:3005178-revert-3001326-revert-2998737-revert-2980591-cronet_121_0_6167_71-JBOUFGJXPX-ICXECJPUPA-OOMALUYYUV

Change-Id: I1fdfdec2199eaf94766b93401a8e781a8cfec571

Chidera Olibie   commited 2024-04-02 12:07:04 +00:00
1ba19c9c67
Merge "[Thread] add NetworkCapability.NOT_METERED for Thread network" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-04-02 08:49:58 +00:00
8b15cc8f8e
Merge "[mDNS] pretty print txt values in log" into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-04-02 08:15:34 +00:00
777b9ba0ca