Commit graph

107,676 commits

Message SHA1
Add CtsNetTestCasesUpdateStatsPermission to automotive-mumd-presubmit
Bug: 364634490
Bug: 374372313
Flag: EXEMPT TEST_MAPPING update
Test: m
Change-Id: Ie50ab9d9581a923612fcabfce4cd396265fb9188

Xiang Wang   commited 2024-11-26 23:29:10 +00:00
aa2c8b022e
Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I647fddd00b1ee970859291468d481dd5bbfea0e6

Bill Yi   commited 2024-11-26 06:00:10 -08:00
2c15bee348
Merge "Create the timerfd helper class" into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-11-26 08:23:21 +00:00
38bbfa8c82
Merge "Fix TetheringManagerTest using setWifiSsid before T" into main
Quang Luong   authored and   Gerrit Code Review   commited 2024-11-26 07:28:36 +00:00
bb4d3a1b6d
Merge "Add WRITE_ALLOWLISTED_DEVICE_CONFIG perm when modifying DeviceConfig" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-26 07:18:26 +00:00
7f18aa1121
Add WRITE_ALLOWLISTED_DEVICE_CONFIG perm when modifying DeviceConfig
Android 16 introduces restrictions on the DeviceConfig flags that
can be modified by the shell user by removing the WRITE_DEVICE_CONFIG
permission from this user and replacing it with the
WRITE_ALLOWLISTED_DEVICE_CONFIG permission; with this permission,
only those flags that have been allowlisted can be modified. This
commit adds the ALLOWLISTED permission to any test that explicitly
adopts the shell permission identity with the WRITE_DEVICE_CONFIG
permission; the WRITE_DEVICE_CONFIG permission is not removed to
ensure tests do not break when run on previous platform releases
without the ALLOWLISTED permission.

Bug: 364083026
Flag: TEST_ONLY
Test: Manually ran all modified tests
Change-Id: I01124581b122b34d45b22a8bd5cb89867ad086a6

Michael Groover   commited 2024-11-25 15:44:42 -06:00
b8eca6d9e0
[automerger skipped] Fix CtsNetTestCases for secondary_user_on_secondary_display am: 92071eea46 -s ours
am skip reason: Merged-In I02ae287a926e0bce69ed11fa7e0ef78b288b6b76 with SHA-1 c91d1654f1 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3374763

Change-Id: Ic874d5833d968c37d1f361e16fcdc4662f0fc6ca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Xiang Wang   authored and   Automerger Merge Worker   commited 2024-11-25 17:56:54 +00:00
1100aed98b
Fix CtsNetTestCases for secondary_user_on_secondary_display
secondary_user_on_secondary_display is for background users that have
access to UI on assigned displays (a.k.a. visible background users) on devices that have config_multiuserVisibleBackgroundUsers enabled. The main use case is Automotive's multi-display configuration where passengers (modeled as visible background users) can interact with the display in front of them concurrently with the driver (modeled as the the current user) interacting with the driver's display.

The fix is to pass in the user id to appops commands so that appops permissions can be properly granted or denied to a visible background user (non current user).

Bug: 374210153
Flag: EXEMPT test fix
Test: Tested on Automotive reference hardware with Multi Display
Test: atest android.net.cts.IpSecManagerTunnelTest
Test: atest --user-type secondary_user_on_secondary_display android.net.cts.IpSecManagerTunnelTest
Test: atest android.net.cts.Ikev2VpnTest
Test: atest --user-type secondary_user_on_secondary_display android.net.cts.Ikev2VpnTest
Test: atest android.net.cts.NetworkStatsManagerTest
Test: atest --user-type secondary_user_on_secondary_display android.net.cts.NetworkStatsManagerTest
(cherry picked from https://android-review.googlesource.com/q/commit:116a3a7bd0d1e80adf3258850180f60dc90a3a94)
Merged-In: I02ae287a926e0bce69ed11fa7e0ef78b288b6b76
Change-Id: I02ae287a926e0bce69ed11fa7e0ef78b288b6b76

Xiang Wang   commited 2024-11-25 07:37:29 +00:00
92071eea46
Merge "Fix CtsNetTestCases for secondary_user_on_secondary_display" into main
Xiang Wang   authored and   Gerrit Code Review   commited 2024-11-25 07:36:52 +00:00
df55e35227
Fix CtsNetTestCases for secondary_user_on_secondary_display
secondary_user_on_secondary_display is for background users that have
access to UI on assigned displays (a.k.a. visible background users) on devices that have config_multiuserVisibleBackgroundUsers enabled. The main use case is Automotive's multi-display configuration where passengers (modeled as visible background users) can interact with the display in front of them concurrently with the driver (modeled as the the current user) interacting with the driver's display.

The fix is to pass in the user id to appops commands so that appops permissions can be properly granted or denied to a visible background user (non current user).

Bug: 374210153
Flag: EXEMPT test fix
Test: Tested on Automotive reference hardware with Multi Display
Test: atest android.net.cts.IpSecManagerTunnelTest
Test: atest --user-type secondary_user_on_secondary_display android.net.cts.IpSecManagerTunnelTest
Test: atest android.net.cts.Ikev2VpnTest
Test: atest --user-type secondary_user_on_secondary_display android.net.cts.Ikev2VpnTest
Test: atest android.net.cts.NetworkStatsManagerTest
Test: atest --user-type secondary_user_on_secondary_display android.net.cts.NetworkStatsManagerTest
Change-Id: I02ae287a926e0bce69ed11fa7e0ef78b288b6b76

Xiang Wang   commited 2024-11-25 06:32:37 +00:00
c91d1654f1
Merge "Improve testOpenConnection() reliability with fallback IPv6 check" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-11-25 05:59:12 +00:00
742a8120ff
Merge "Fix setup on devices without printflags" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-11-25 05:55:53 +00:00
b028a6f264
Merge "Sort framework-connectivity-defaults libs alphabetically" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-11-25 05:47:48 +00:00
4510fa5611
Merge "Add WRITE_ALLOWLISTED_DEVICE_CONFIG when modifying DeviceConfig" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-25 05:40:31 +00:00
9a07a34c64
Fix TetheringManagerTest using setWifiSsid before T
SoftApConfiguration.Builder.setWifiSsid(WifiSsid) is only available in
T. Make sure to add an SDK level check to use setSsid if the SDK is
pre-T.

Bug: 380352930
Test: atest TetheringManagerTest
Change-Id: I07a6d9d89ff8c26b2fcd6589b88d8385b223e9bf

Quang Anh Luong   commited 2024-11-25 14:38:13 +09:00
5c4b965f15
Merge "Add diagnostics to testNativeDatagramTransmission" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-25 05:09:15 +00:00
f54c8f1550
Fix setup on devices without printflags
Instead of running printflags directly, which on devices that do not
have the binary hangs indefinitely, run "sh -c printflags".

printflags is in the default base_system.mk but some OEMs may strip it
out. sh is much less likely to be removed.

Bug: 379183423
Test: atest
Change-Id: I66af42b2cfbf5cb427c740ef710d8eb3d1d7f1ef

Remi NGUYEN VAN   commited 2024-11-25 13:19:25 +09:00
282b7be3c6
Sort framework-connectivity-defaults libs alphabetically
Test: TH
Change-Id: I1ed2c8a023b79d044c82e5a0b52a96d0a535b996

Yuyang Huang   commited 2024-11-25 12:31:48 +09:00
ee0a07cfd9
Improve testOpenConnection() reliability with fallback IPv6 check
Enhanced testOpenConnection() to include a fallback mechanism that
verifies the current IPv6 address via a DNS query if the initial HTTP
query check fails. This improves test reliability, particularly in
userdebug environments.

Bug: 325894686
Test: TH
Change-Id: I21a496eefd2b2c3d581755c363fedb6c5f9ca4a6

Yuyang Huang   commited 2024-11-25 11:59:54 +09:00
819b77addb
Add WRITE_ALLOWLISTED_DEVICE_CONFIG when modifying DeviceConfig
Bug: 380648508
Test: atest ThreadNetworkControllerServiceTest
Change-Id: I36908316f5eef6a3712c98f5901a5c162db3471c

Yang Sun   commited 2024-11-25 10:00:32 +08:00
4b43c079ff
Add diagnostics to testNativeDatagramTransmission
When the test fails, retry it 10 times, and an extra time on the
original source port. Report results in the connectivity diagnostics
file header so they can be parsed across tests.

This should help investigate issues possibly linked to UDP packets not
being routed properly depending on the port.

Test: atest
Bug: 375477810
Bug: 253698734
Bug: 324389407
Bug: 338090529
Change-Id: I8400b40257aa25a373c5a3ec96868d6877e0afb1

Remi NGUYEN VAN   commited 2024-11-25 09:21:36 +09:00
956b8621da
Merge "Use unique_fd for usableProgram" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-22 20:28:36 +00:00
908ca9e9d8
Merge "Get rid of BPF_FD_JUST_USE_INT" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-22 20:09:18 +00:00
cc7a5a3674
Use unique_fd for usableProgram
Makes 2 lines out of 4.

Test: TH
Change-Id: I5e2d047105065a189e6393a8f5fcb75ff42922ec

Patrick Rohr   commited 2024-11-22 11:01:58 -08:00
c8a9dc2f6e
Get rid of BPF_FD_JUST_USE_INT
borrowed_fd defines implicit conversion constructors for both int and
unique_fd.

Test: TH
Change-Id: Ie41c747f4afea050b18d721956bcbbca0446bdc7

Patrick Rohr   commited 2024-11-22 10:36:27 -08:00
99ace23829
Merge "Fix setEthernetEnabled API to properly affect administrative state" into main
Chuwei He   authored and   Gerrit Code Review   commited 2024-11-22 07:41:33 +00:00
3e8bfe912e
Create the timerfd helper class
Create a helper class in Java to provide easy access to timerfd
JNI methods.

Bug: 366373064
Test: atest NetworkStaticLibTests
Change-Id: Iea09cd29e2a6ed837ece30c512393be2e27e8c2e

Paul Hu   commited 2024-11-22 07:12:55 +00:00
8c8d2b1bd8
Merge changes I83ea92e3,I478d957b into main
* changes:
  NetworkAgent: Log a metric if a message is queued before registration
  Add FrameworkConnectivityStatsLog for logging metrics

Yuyang Huang   authored and   Gerrit Code Review   commited 2024-11-22 06:33:56 +00:00
11284d73a0
Merge "Remove the useless networking tag." into main
Tongbo Liu   authored and   Gerrit Code Review   commited 2024-11-22 05:56:38 +00:00
97a07126c6
Add daily CertificateTransparencyJob
Following a conversation with the Experiments team (b/374692404), it
appears we will not be able to use device config flags to trigger the
download of CT log lists.

This CL is the first of a series that will allow us to move away from
flags and instead rely on a daily job execution. For scheduling we rely
on the Android AlarmManager.

I previously attempted to schedule the daily job using the Android
JobScheduler. However, those attempts were unsuccessful beacause the
Tethering apex is not on the system_server classpath, so the system
would crash when attempting to load the class to execute the job.

Flag: com.android.net.ct.flags.certificate_transparency_job
Bug: 374692404
Test: NetworkSecurityUnitTests
Change-Id: I6ce44dcea464cab20d2df73b065e35c0f76dcbab

Sandro Montanari   commited 2024-11-21 14:54:50 +00:00
70c4de8edc
NetworkAgent: Log a metric if a message is queued before registration
It should not be valid to queue messages before
registering a NetworkAgent, but the current design
makes it possible in practice. Log a metric so
that we have a handle on whether or not anybody
is doing this in the field.

Bug: 296355968
Test: manual
Change-Id: I83ea92e39a860cebe58d1d82cb024313e244b9aa

Arjun Dhaliwal   commited 2024-11-21 05:41:16 -08:00
0b1a7b8c98
Add FrameworkConnectivityStatsLog for logging metrics
Introduced FrameworkConnectivityStatsLog within the
framework-connectivity module. This enables logging of metrics, such as
terrible error events, from components residing in the bootclasspath.

Test: manual
Change-Id: I478d957b06721b35135a45dbbcda72a2c3e9f9ce

Yuyang Huang   commited 2024-11-21 11:51:58 +00:00
1cc7769bbe
Merge "Add test for TREL service not unpublish when feature disabled" into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-11-21 07:10:55 +00:00
5c66824a44
Add test for TREL service not unpublish when feature disabled
Bug: 379804913

Change-Id: I8dd98a0605dd7e9c53b144f6227791a2080e8263

Yang Sun   commited 2024-11-21 10:22:32 +08:00
51d7725e08
Remove BpfBaseTest processgroup test.
In practice this has to pass already due to netd_updatable
init attaching BPF_CGROUP_INET_{E,IN}GRESS programs.

This allows removing the processgroup shared lib dependency,
which should allow switching it from C to C++ mangling.

Thus we might be able to revert the revert (ie. reapply):
  https://android-review.googlesource.com/c/platform/system/core/+/3366140
in
  https://android-review.googlesource.com/c/platform/system/core/+/3369297

Test: TreeHugger
Bug: 379796721
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I865d6705e4a6477d428261ef182173df1f5b4672

Maciej Żenczykowski   commited 2024-11-20 19:38:11 +00:00
eb85ea5f2a
Remove the useless networking tag.
Since CtsNativeNetDnsTestCases only contain in mts-dnsresolver-tests-list-user.xml

Bug: 379792488

Change-Id: I750f0d9b360501554dfc7c693f5f4f3560c74930

Tongbo Liu   commited 2024-11-20 03:46:35 +00:00
50607e6814
Add BPF_LOAD_SKB_PKTTYPE macro to BpfClassic.h
Useful for something like:
  BPF_LOAD_SKB_PKTTYPE
  BPF2_REJECT_IF_NOT_EQUAL(PACKET_OUTGOING)

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7d3851830a3a764452a448a8663b8a140f69c9ff

Maciej Żenczykowski   commited 2024-11-19 20:17:24 +00:00
c58cfb7c7d
Merge "Add WRITE_ALLOWLISTED_DEVICE_CONFIG perm when modifying DeviceConfig" into main
Michael Groover   authored and   Gerrit Code Review   commited 2024-11-19 17:13:23 +00:00
5380288dd7
Merge changes Ie2c35190,I6bd9ceeb,I823c8e94,I1b4868ba into main
* changes:
  Clean up TetheringRequest#toString()
  Send TetheringRequest to restart Tethering from IpServer
  Add hostside CTS tests for SoftApConfig redaction
  Include SoftAP config in TetheringEventCallback

Quang Luong   authored and   Gerrit Code Review   commited 2024-11-19 12:26:34 +00:00
d9a752d866
Clean up TetheringRequest#toString()
Clean up TetheringRequest#toString() by printing the TetheringType and
ConnectivityScope in a human-readable form and only printing the values
of fields that have been set.

Bug: 216524590
Test: atest TetheringManagerTest
Change-Id: Ie2c35190a09605e3018b9d2d1f1d00cdc7bbb977

Quang Anh Luong   commited 2024-11-19 21:24:47 +09:00
676ad858e2
Send TetheringRequest to restart Tethering from IpServer
IpServer currently starts/stops tethering by specifying the tethering
type, but this will be a problem when we start to allow multiple
requests per type. To fix this, specify the TetheringRequest instead.

Note this CL has no functional changes.

Bug: 216524590
Test: atest TetheringTest TetheringManagerTest
Change-Id: I6bd9ceebcaa637a540435d5e91a35382f167a809

Quang Anh Luong   commited 2024-11-19 19:32:22 +09:00
685b8aa508
Add hostside CTS tests for SoftApConfig redaction
Add hostside CTS tests to test for SoftApConfiguration being redacted
from TetheringInterface for apps that don't own that config.

Bug: 216524590
Test: atest CtsHostsideNetworkTests
Change-Id: I823c8e94cc6fe10c6118e7a694da368e585bbd69

Quang Anh Luong   commited 2024-11-19 19:32:19 +09:00
b5b82cc424
Remove the useless mts tag since the tests only contain in one MTS module test plan. am: 95fb0801bf
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3363287

Change-Id: I58c5c8da3fef2290383c4dc93e4f08b1d2c76947
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Tongbo Liu   authored and   Automerger Merge Worker   commited 2024-11-19 10:25:12 +00:00
ea0c411d29
Remove the useless mts tag since the tests only contain in one MTS module test plan.
Bug: 379792488
Change-Id: I11b542a1649c057d963e0c6df8fb5c548dd373f6

Tongbo Liu   commited 2024-11-19 06:23:55 +00:00
95fb0801bf
Merge "Configure TREL feature from feature flag." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-11-19 06:08:23 +00:00
41fa2d75a1
Add WRITE_ALLOWLISTED_DEVICE_CONFIG perm when modifying DeviceConfig
Android 16 introduces restrictions on the DeviceConfig flags that
can be modified by the shell user by removing the WRITE_DEVICE_CONFIG
permission from this user and replacing it with the
WRITE_ALLOWLISTED_DEVICE_CONFIG permission; with this permission,
only those flags that have been allowlisted can be modified. This
commit adds the ALLOWLISTED permission to any test that explicitly
adopts the shell permission identity with the WRITE_DEVICE_CONFIG
permission; the WRITE_DEVICE_CONFIG permission is not removed to
ensure tests do not break when run on previous platform releases
without the ALLOWLISTED permission.

Bug: 364083026
Flag: TEST_ONLY
Test: Manually ran all modified tests
Change-Id: Iad68063550f99f3dc78ac2f0483dad98a8a93f2e

Michael Groover   commited 2024-11-18 23:28:24 -06:00
a3882a238b
Fix setEthernetEnabled API to properly affect administrative state
Previously, setEthernetEnabled(false) untracks all interfaces and
ignores future RTM_NEWLINK callbacks, which means that the ethernet
module loses all knowledge of existing interfaces.

This change now properly toggles IFF_UP on all interfaces including
those in server mode when setEthernetEnabled API is called, and returns
on error on callback when trying to enable an interface when ethernet is
disabled.

Test: atest EthernetManagerTest
Bug: 316268558
Bug: 225315248
Change-Id: Ic7785e7e0c87c1437627661401e66201dd60802a

Chuwei He   commited 2024-11-19 13:40:09 +09:00
694aa02036
Merge "Add IGMP network stack constants" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-11-18 23:32:00 +00:00
b69182f217
Merge "Set llndk.moved_to_apex explicitly" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-11-18 20:12:33 +00:00
6c4d64a513
Merge "Add IGMP type offset definition" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-11-18 20:10:50 +00:00
34e969b5c9