Commit graph

103,667 commits

Message SHA1
Merge "Add a local dynamic config for ConnectivityManagerTest to decouple the test config from test logic." into main
Zhi Zhou   authored and   Gerrit Code Review   commited 2024-06-13 10:02:54 +00:00
66de80d723
Merge "Do not display "null" in sign-in note details" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-13 09:50:15 +00:00
488d40d122
Add a local dynamic config for ConnectivityManagerTest to decouple the test config from test logic.
Test: local runs, abtd
Bug: 317166695
Change-Id: I105650c4c9cb93e7da8cbe9aa68baa04d750a691

zhi   commited 2024-06-13 16:43:47 +08:00
f4c16355dc
Merge "Increase testReadWriteProgram() timeout to 15 minutes" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-06-13 08:29:13 +00:00
b26b437dea
Do not display "null" in sign-in note details
For non-telephony, non-wifi networks, both extraInfo and SSID are likely
to be null, in which case
getString(network_available_sign_in_detailed, null) would be used for
the notification contents, which would just print "null" (by default the
string template is just "%1$s").

Use an empty string instead, as there is no string identifier for the
network. This should still be better than having text that says "null".

Test: atest
Bug: 334926818
Change-Id: I19bdba186d2402b40549b1ad5f97864b7c38ca10

Remi NGUYEN VAN   commited 2024-06-13 17:10:36 +09:00
05aa33ccec
Merge "Add individual try/catch blocks for ParcelFileDescriptor closure" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-13 01:54:03 +00:00
b62d79c423
Merge "Adjust background restriction transition delays in tests" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-12 21:08:34 +00:00
99f1201b0f
Merge "[Thread] add the "vgh" TXT entry" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-12 18:07:55 +00:00
7ff092e3d1
Adjust background restriction transition delays in tests
Background chain transition delays are changing in the framework to be
longer for LAST_ACTIVITY and higher-priority and shorter for
lower-priority process-states. Updating tests to use the shorter timeout
wherever possible and using the longer timeout wherever the test
specifically tests for process-state LAST_ACTIVITY.

Flag: com.android.server.net.use_different_delays_for_background_chain

Test: atest CtsHostsideNetworkPolicyTests

Bug: 323963467
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:adf00ec210dc72b0075755065f5dfafa7971e70f)
Merged-In: I4ab0cef2e81c465753a8aa2228d2e0ddf1abf1ea
Change-Id: I4ab0cef2e81c465753a8aa2228d2e0ddf1abf1ea

Suprabh Shukla   authored and   Android Build Cherrypicker Worker   commited 2024-06-12 17:35:14 +00:00
e2ef4547e1
[Thread] add the "vgh" TXT entry
Allows vendors to specify whether the Thread network is managed by
Google or not.

Bug: 343671003

Change-Id: Ie4d4050add0485643ea3eff0c576868b086f848c

Kangping Dong   commited 2024-06-12 23:19:34 +08:00
151275359f
Increase testReadWriteProgram() timeout to 15 minutes
Extended the timeout of ApfIntegrationTest#testReadWriteProgram() to 15
minutes to accommodate devices with larger APF memory (e.g., 4K RAM).

Example run on a device with 4K APF RAM:
[1/1] android.net.cts.ApfIntegrationTest#testReadWriteProgram: PASSED (09m47.451s)

Bug: 346707554
Test: TH
Change-Id: I063abe285e061edf3a0d338ba7233a08be03c9b4

Yuyang Huang   commited 2024-06-12 19:13:22 +09:00
7627f7e9c1
Merge "Fix test_hotspot_upstream_cellular failure" into main
Junyu Lai   authored and   Gerrit Code Review   commited 2024-06-12 08:30:44 +00:00
0781c74af4
Merge "Do not crash test on invalid pending intent" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-12 07:00:45 +00:00
f1a7b4122a
Do not crash test on invalid pending intent
Instead of having an assert in the BroadcastReceiver, which runs in a
separate thread which crashes the test process on assertion failure,
move it to the test thread.

Bug: 345804242
Test: atest
Change-Id: Ib10cb1464918bcb978bdd9fae378427cb393f2f3

Remi NGUYEN VAN   commited 2024-06-12 12:58:11 +09:00
24b3462d24
Fix test_hotspot_upstream_cellular failure
This change:
  1. Move precondition checks prior to setup hotspot.
     This removes the need of redundant clean-up if
     the device doesn't meet preconditions.
  2. Use unregisterAll instead of unregisterCell to
     clean-up registered connections to prevent from
     complex error handling in clean-up stage.

Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest
Fix: 345110845
Change-Id: I4de0e7401d52f891948eb7b5a8c112a837cb0c3e

Junyu Lai   commited 2024-06-12 11:49:54 +08:00
26c81bd9a3
Merge "Remove unused function" into main
Patrick Rohr   authored and   Gerrit Code Review   commited 2024-06-11 15:10:26 +00:00
922194de62
Add individual try/catch blocks for ParcelFileDescriptor closure
Enclosed each ParcelFileDescriptor.close() call in its own try/catch
block to ensure that if one closure throws an exception, the others will
still be attempted.

Bug: 346469095
Test: TH
Change-Id: Ib59fffaa39488acb73bbdbe8ebc795043f2b301f

Yuyang Huang   commited 2024-06-11 15:09:41 +09:00
b41e4f6326
Merge "Build CtsNativeNetDnsTestCases with static libc++ and version script" into main
Maciej Ĺ»enczykowski   authored and   Gerrit Code Review   commited 2024-06-10 16:40:32 +00:00
ea8177b349
Build CtsNativeNetDnsTestCases with static libc++ and version script
Bug: http://b/344654921
Test: m CtsNativeNetDnsTestCases
Change-Id: I3d5d25d1f51ab45a5d96639a1b70f5d6e58f6239

Stephen Hines   commited 2024-06-07 14:38:14 -07:00
82bf7bbe8b
Merge "NearbyManagerTest: Put static classRule as public" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-07 21:09:31 +00:00
a0f17c45a3
Merge changes I299dd0df,If4a256df into main
* changes:
  Re-enable HostsideVpnTests on presubmit
  Update VpnTest#testDefault to use otherUid that has internet permission

Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-06-07 11:39:27 +00:00
568034b1c6
Merge changes I62c990d0,I413bdb76,I020ba48e into main
* changes:
  Update NetworkRequestTest#testDefaultCapabilities
  Allow default messaging app to use constrained satellite network
  Introduce NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED

Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-06-07 09:29:06 +00:00
3e07102814
Re-enable HostsideVpnTests on presubmit
Some tests were disabled by aosp/2676836 since these tests were flaky
(b/291701394).
b/291701394 was fixed. So, this CL re-enables them on presubmit.

Bug: 291701394
Bug: 342557183
Test: VpnTest --iterations 10
Change-Id: I299dd0dfd7d6cbdea2ad97477b5613c78af421e1

Motomu Utsumi   commited 2024-06-07 17:59:23 +09:00
660584a69f
Update VpnTest#testDefault to use otherUid that has internet permission
Bug: 342557183
Test: VpnTest
Change-Id: If4a256df9ef96285c65dd285c7d37696dbd82298

Motomu Utsumi   commited 2024-06-07 17:59:20 +09:00
dda2d35b0c
Merge "Add sdk_version property to cts tests" into main
Jihoon Kang   authored and   Gerrit Code Review   commited 2024-06-07 05:32:16 +00:00
d6f447215f
Merge "waitForIdle to avoid stubbing mocked bpfNetMaps while CS is accessing" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-07 03:51:14 +00:00
65bb6527cd
Merge "[Thread] add public newbie guide" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-07 02:39:52 +00:00
53f4a29816
[Thread] add public newbie guide
Change-Id: I03975d832c2ae1223a472f01541d4d488e2f6950

Kangping Dong   commited 2024-06-07 02:38:58 +00:00
3b47411d25
Update NetworkRequestTest#testDefaultCapabilities
testDefaultCapabilitieswas was added when aosp/2539630 introduced
DEFAULT_FORBIDDEN_CAPABILITIES to avoid existing users getting callbacks
from local networks.
But aosp/2539630 was reverted and aosp/2936050 fixed this issue by
introducing compat flag.
testDefaultCapabilities was missed to be cleaned up due to the
annotation.
This CL updates testDefaultCapabilities to verify the default
capabilities and default forbidden capabilities are not changed on U-.

Test: NetworkRequestTest
Bug: 332466530
Change-Id: I62c990d0f2c73d159e7c93827bbec14d4d0c0f45

Motomu Utsumi   commited 2024-06-07 09:26:25 +09:00
1cf04c96da
Allow default messaging app to use constrained satellite network
On V+, there could be satellite network which is not restricted but
bandwidth constrained.
These satellite network has NET_CAPABILITY_NOT_RESTRICTED but does not
have NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED.
Since NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED is set by default, this
CL remove this capability from per-app default network request for the
default messaging app.

Test: CSSatelliteNetworkTest
Bug: 343823469
Change-Id: I413bdb764ead42d67ce1315c365500dbb8508eb3

Motomu Utsumi   commited 2024-06-07 09:26:19 +09:00
ab750abf29
NearbyManagerTest: Put static classRule as public
Bug: 345117020
Fix: 345117020
Flag: TEST_ONLY
Test: atest NearbyManagerTest
Change-Id: I37bf29c1c025b361eec2a4e397a3004767920c7f

William Escande   commited 2024-06-06 17:02:53 -07:00
d44bd8bc80
Add sdk_version property to cts tests
This change specifies the sdk_version property to the cts test modules
so that the test modules do not depend on the framework, and utilize the
test api instead.

Test: TH
Bug: 345499522
Change-Id: I876fb8681dadad9d123bedb38d67c1a31b0f3a54

Jihoon Kang   commited 2024-06-06 21:35:00 +00:00
5848825c42
Merge "Add @VsrTest annotations to ApfIntegrationTest" into main
Maciej Ĺ»enczykowski   authored and   Gerrit Code Review   commited 2024-06-06 12:57:14 +00:00
eb6c2885a3
waitForIdle to avoid stubbing mocked bpfNetMaps while CS is accessing
Bug: 343302460
Test: TH
Change-Id: I74683b20ce581206c47a153b0e2f348295363ecb

Motomu Utsumi   commited 2024-06-06 18:04:08 +09:00
986dd36e65
Merge changes I181a490b,Ie2619949,I4bd5fbdf,Ifc0c5baa,I437e6607 into main
* changes:
  Use /proc/self instead of calling Os.getPid().
  Use SingleWriterBpfMap in BpfNetMaps.
  Add a microbenchmark test for BpfMap.
  Add a SingleWriterBpfMap class that caches reads.
  Deflake BpfMapTest#testNoFdLeaks.

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-06-06 08:30:20 +00:00
4518e09375
Introduce NET_CAPABILITY_NOT_BANDWIDTH_CONSTRAINED
On V+, this capability is set by default.
Constrained satellite networks never become the system default network.

Test: CSSatelliteNetworkTest
Bug: 343823469
Change-Id: I020ba48e74f1f180e1807cbe1c066209bedb0454

Motomu Utsumi   commited 2024-06-06 15:49:21 +09:00
154ce6381a
Use /proc/self instead of calling Os.getPid().
Change-Id: I181a490bea05bf62d1a854a4882a0969de280439
Test: test-only change

Lorenzo Colitti   commited 2024-06-06 05:52:55 +00:00
5e005cf421
Merge "Use DeviceFeatureModuleController to run tests only if the device has the required feature." into main
Kangping Dong   authored and   Gerrit Code Review   commited 2024-06-06 05:44:45 +00:00
4dd381a966
Add @VsrTest annotations to ApfIntegrationTest
Bug: 303356901
Test: TH
Change-Id: Ie1c1157df8aaf31123501eb3df32b4b2416001d3

Yuyang Huang   commited 2024-06-06 13:23:36 +09:00
943139f5d7
Merge "Add config flag for useDeclaredMethodsForCallbacks" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-06-06 02:42:54 +00:00
9d88333273
Use DeviceFeatureModuleController to run tests only if the device has the required feature.
This is to avoid running tests on devices that do not support Thread. Otherwise, the tests will fail with ClassNotFoundException when the test classes are loaded

Change-Id: I286394ae925ad7258aa82cd308ac963ee334992c

Kangping Dong   commited 2024-06-05 19:32:59 -07:00
67586d188e
Merge "Stop throwing when the invalid capability is passed" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-06-06 01:49:31 +00:00
b1d3a85f19
Remove unused function
I believe this did not work in the first place. CompletableFuture#get()
might throw a timeout exception if TIMEOUT_MS is reached which fails the
assertion (but it should not!).

Anyway, it is unused, so just delete this method.

Test: TH
Change-Id: I43a747179eeaded320df32f40f1237be11de7867

Patrick Rohr   commited 2024-06-05 12:01:08 -07:00
e4cbb9c7f6
Merge "[Thread] support resolving a host for NsdPublisher" into main
Handa Wang   authored and   Gerrit Code Review   commited 2024-06-05 10:23:26 +00:00
a22aa7777d
Add config flag for useDeclaredMethodsForCallbacks
Add a DeviceConfig flag that will be used to control whether callbacks
should be sent selectively based on whether the receiving method has
been overridden (will be implemented in a future change).

This adds utilities to allow ConnectivityManager to check whether a
ConnectivityService flag is enabled, as that feature will work across
ConnectivityManager and ConnectivityService. ConnectivityManager runs in
app process and does not necessarily have permissions to use
DeviceConfig. Also if it checked DeviceConfig separately from
ConnectivityService, values may be out-of-sync.

Test: atest, and see change using this
Change-Id: I204fa719cc627e84edc5c1e043d947f5ef3f8dee

Remi NGUYEN VAN   commited 2024-06-05 15:54:49 +09:00
aa355ac875
Use SingleWriterBpfMap in BpfNetMaps.
Most of the maps used by BpfNetMaps are configuration maps that
in production code are only written to by BpfNetMaps. Move these
maps to SingleWriterBpfMap to take advantage of caching.

Specifically, the following are only written by BpfNetMaps in
production code:

- sConfigurationMap
- sUidOwnerMap
- sUidPermissionMap
- sDataSaverEnabledMap
- sIngressDiscardMap

Additionally:
- firewall.cpp writes to sConfigurationMap, sUidOwnerMap, and
  sDataSaverEnabledMap, but that code only runs in tests because
  it requires root privileges.
- NetworkStackBpfNetMaps also uses sConfigurationMap,
  sUidOwnerMap and sDataSaverEnabledMap, but it opens all of them
  with BPF_F_RDONLY so cannot write to them.

sCookieTagMap is left uncached because it's also written to by
netd (as part of socket tagging) and ClatCoordinator.

Fix: 343166906
Test: no-op replacement, covered by existing tests
Change-Id: Ie2619949477323d557b8906cf082e86a78512847

Lorenzo Colitti   commited 2024-06-05 06:48:50 +00:00
8fd925a9b3
Add a microbenchmark test for BpfMap.
Bug: 343166906
Test: Test-only change
Change-Id: I4bd5fbdfd4736885f0533b892b089a1c5c1a4b49

Lorenzo Colitti   commited 2024-06-05 06:48:38 +00:00
f5ebe1aafa
Add a SingleWriterBpfMap class that caches reads.
This should speed up BPF map reads by returning the cached value
without needing a system call.

Bug: 343166906
Test: added parameterization to BpfMapTest
Change-Id: Ifc0c5baa80f6d46356434c249749e87fe2f9ec6c

Lorenzo Colitti   commited 2024-06-05 06:48:27 +00:00
05be2f52fd
Deflake BpfMapTest#testNoFdLeaks.
When running locally, this occasionally fails due to unrelated fds
being opened or closed while the test is running.

Bug: 343166906
Test: test-only change
Change-Id: I437e66077f0471572ec2b215db63a000a4622af5

Lorenzo Colitti   commited 2024-06-05 06:48:15 +00:00
05a3e88e62
Stop throwing when the invalid capability is passed
When new capability is introduced and added to capaility or
forbiddenCapability by default, module rollback could cause system
server crash since JobScheduler persists network request that contains
new capability that is invalid for old code.
This CL updates capability validation not to throw exception to avoid
system crash in this case.

Bug: 343823469
Bug: 313030307
Test: NetworkCapabilitiesTest
Change-Id: I5708c475f3b4974284531212b77f9788ca9f497e

Motomu Utsumi   commited 2024-06-05 11:57:18 +09:00
ab1a0671c7