Commit graph android_packages_modules_Co.../tests
Message SHA1
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
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
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
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 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 "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 "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
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
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
Include SoftAP config in TetheringEventCallback
Include SoftApConfiguration in TetheringEventCallback via
TetheringInterface, to allow apps to know which interfaces are created
with their SoftApConfigurations.

API-Coverage-Bug: 371133403

Bug: 216524590
Test: atest TetheringTest CtsTetheringTest
Change-Id: I1b4868ba8327bee3b03c0f21e5b4f0845f2f24a8

Quang Anh Luong   commited 2024-11-18 13:37:39 +09:00
a66b78ab87
Merge "Revert "Set diagnostics log-data-type to CONNDIAG"" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-18 03:16:23 +00:00
0006d2ee51
Revert "Set diagnostics log-data-type to CONNDIAG"
This reverts commit 5714031dcc.

Reason for revert: breaks MCTS as tests are run with older tradefed that does not have the option: b/378710131

This can be rolled forward after cherry-picking the tradefed change to older branches.

Change-Id: Ib9b4fe3b1c5393cd6e802eee4899457497d79ca7

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-11-18 00:57:58 +00:00
27fb206ded
Merge changes I2388220a,I5f282160 into main
* changes:
  Add a test for delayed teardown with unregisterAfterReplacement.
  Fix system crash when netd return error

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-12 18:47:07 +00:00
f45f40717b
Add a test for delayed teardown with unregisterAfterReplacement.
Bug: 363854848
Test: test-only change
Change-Id: I2388220a97c50a8a39920c6354ec30c4936f045d

Lorenzo Colitti   commited 2024-11-12 15:34:00 +00:00
feeff37fca
Merge "Fix for CtsNetTestCasesUpdateStatsPermission" into android15-tests-dev
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-09 00:31:56 +00:00
b3d8081f76
Merge changes from topic "fixTetheringRevert" into main
* changes:
  Validate packageName with AppOpsManager#checkPackage
  Revert^2 "Add UID and package name to TetheringRequest"

Quang Luong   authored and   Gerrit Code Review   commited 2024-11-08 02:31:58 +00:00
5cd7166523
Enable secondary_user_on_secondary_display for CtsNetTestCasesMaxTargetSdk33 am: 1ebe54b8d4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3341060

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

Yabin Huang   authored and   Automerger Merge Worker   commited 2024-11-07 22:09:30 +00:00
bf3f11cf7f
Fix for CtsNetTestCasesUpdateStatsPermission
The CtsNetTestCasesUpdateStatsPermission apk was missing ConnectivityTestPreparer apk.

Flag: EXEMPT test only

Bug: 364634490
Test: atest CtsNetTestCasesUpdateStatsPermission
Test: atest --user-type secondary_user_on_Secondary_display CtsNetTestCasesUpdateStatsPermission
Change-Id: I00111bf5bd2ea99bfff17177813d2814ea24894c
Merged-In: I00111bf5bd2ea99bfff17177813d2814ea24894c
(cherry picked from commit e7bbdcba2e)

Mayank Garg   commited 2024-11-07 18:51:10 +00:00
26fc9a31e3
Enable secondary_user_on_secondary_display for CtsNetTestCasesMaxTargetSdk33
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 Whole Cabin experience
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 driver's display.

The AndroidTest.xml  file is shared by several modules, including
CtsNetTestCasesMaxTargetSdk33. Now all modules can pass now.

Fixes: 365184699
Test: atest CtsNetTestCasesMaxTargetSdk33
Test: atest --user-type secondary_user CtsNetTestCasesMaxTargetSdk33
Test: atest --user-type secondary_user_on_secondary_display CtsNetTestCasesMaxTargetSdk33
Flag: TEST_ONLY

Change-Id: I905646aca1a3d3ed2a80bbe3a8c67ec0139e7562

Yabin Huang   commited 2024-11-07 01:36:08 +00:00
1ebe54b8d4
Fix for CtsNetTestCasesUpdateStatsPermission
The CtsNetTestCasesUpdateStatsPermission apk was missing ConnectivityTestPreparer apk.

Flag: EXEMPT test only

Bug: 364634490
Test: atest CtsNetTestCasesUpdateStatsPermission
Test: atest --user-type secondary_user_on_Secondary_display CtsNetTestCasesUpdateStatsPermission
Change-Id: I00111bf5bd2ea99bfff17177813d2814ea24894c

Mayank Garg   commited 2024-11-06 16:50:54 +00:00
e7bbdcba2e
Merge "Drop the redundant type and caller uid checks for TrafficStats" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-06 08:58:27 +00:00
6258c4482f
Merge "Enable secondary_user_on_secondary_display for CtsNetTestCasesInternetPermission" into android15-tests-dev am: 9bf459028c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3335456

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

Treehugger Robot   authored and   Automerger Merge Worker   commited 2024-11-06 05:29:05 +00:00
abc0345426
Drop the redundant type and caller uid checks for TrafficStats
This commit removes the redundant type and caller uid
checks in TrafficStats to address the review feedback at
aosp/3313055.

Test: TH
Bug: 343260158
Change-Id: I0ed6e850835136c9a324efd7271dd80a34160aa6

Junyu Lai   commited 2024-11-06 13:17:23 +08:00
739d200d35
Merge "Enable secondary_user_on_secondary_display for CtsNetTestCasesInternetPermission" into android15-tests-dev
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-06 05:11:44 +00:00
9bf459028c
Fix failed CtsNetTestCasesInternetPermission am: b3951a23b9
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3336033

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

Yabin Huang   authored and   Automerger Merge Worker   commited 2024-11-06 00:49:40 +00:00
cad9c2c8a7
Revert^2 "Add UID and package name to TetheringRequest"
This reverts commit c8df03ffd7.

Reason for revert: Will fix issue with CL aosp/3326396

Change-Id: I220025f7c8f8145a232ac2ae7f44e16088c122d7

Oscar Shu   commited 2024-11-05 22:52:36 +00:00
46722ad4c4
Enable secondary_user_on_secondary_display for CtsNetTestCasesInternetPermission
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 Whole Cabin experience
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 driver's display.

Fixes: 364636108
Test: atest CtsNetTestCasesInternetPermission
Test: atest --user-type secondary_user CtsNetTestCasesInternetPermission
Test: atest --user-type secondary_user_on_secondary_display CtsNetTestCasesInternetPermission
Flag: TEST_ONLY

Change-Id: Ib559c8465846f687a725b85c330f398e81cbe567

Yabin Huang   commited 2024-11-05 20:55:30 +00:00
59c654d252
Fix failed CtsNetTestCasesInternetPermission
Similar to ag/19534833, this CL ensured that CtsNetTestCasesInternetPermission builds its helper apks.

Bug: 364636108
Test: atest CtsNetTestCasesInternetPermission
Flag: TEST_ONLY
Change-Id: I989126cc027e317e228fad197b6e9f752e8e4acb

Yabin Huang   commited 2024-11-05 19:48:37 +00:00
b3951a23b9
Enable error-prone checking for CtsNetTestCasesDefaults
Enable error-prone checking for CtsNetTestCasesDefaults to
catch NullablePrimitive errors during build time. This is
to address review feedback at aosp/3292201

Test: m CtsNetTestCases
Bug: N/A
Change-Id: I009f0e4ede02a933570cfcc8c563808dbf436193

Junyu Lai   commited 2024-11-05 10:03:19 +00:00
6d74933962
Merge "Make the idle timer for network data tracking configurable" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 21:15:37 +00:00
cf3b26e3bf
Merge "Test races around NetworkAgent creation." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 15:41:15 +00:00
22bd86c584
Test races around NetworkAgent creation.
This adds tests for bugs that were introduced when we enabled
early native network creation. The tests pass on current builds
because the feature is disabled, but break if the feature is
re-enabled without fixing the races.

Specifically:
- Add a test that registers/unregister/registers agents in a
  loop. This checks for a race between unregister() and
  register() which exists because unlike register(),
  unregister() has to wait for the agent channel to be
  connected.
- Add a test for calling unregisterAfterReplacement multiple
  times on the same interface. This tests for the race seen
  in b/286649301#comment6 , where calling
  unregisterAfterReplacement twice and then registering a third
  agent will cause the second agent to be torn down after the
  third is registered.

Bug: 296355968
Test: test-only change
Change-Id: I3d798209740273e5ce59b278af41dd2ad9470916

Lorenzo Colitti   commited 2024-10-31 16:26:14 +09:00
fcb37cff82
Merge "Add config for client-side traffic stats rate-limit cache." into main
Junyu Lai   authored and   Gerrit Code Review   commited 2024-10-31 07:22:36 +00:00
30ff675df5
Merge changes Ia7ea051f,I38bdfe00 into main
* changes:
  Fix system caller cannot query stats for other uids
  Use device config to enable/disable the rate-limit cache feature

Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 06:23:58 +00:00
05be25b8ba
Merge "Address review comments at aosp/3249945" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-31 06:23:56 +00:00
457b54a1ae
Merge "Revert "Add UID and package name to TetheringRequest"" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-10-30 19:00:22 +00:00
1a84e82bf5
Revert "Add UID and package name to TetheringRequest"
This reverts commit 462703c850.

Reason for revert: b/375535923

Change-Id: I7f77959490e8243bb95985bd28b67efcf0f3eb00

Patrick Rohr   authored and   Gerrit Code Review   commited 2024-10-30 16:29:15 +00:00
c8df03ffd7
Add config for client-side traffic stats rate-limit cache.
This is a no-op change since the config is not used yet, and
the feature flag will be gradually rolled out instead of enabled
by default.
However, this change is necessary for follow-up changes to enable
toggling the feature and configuring its behavior through device
configuration flags.

This change includes:

 1. Disable the service-side cache flag if the client-side flag
    is enabled.
 2. Since the apps don't have enough permission to check the
    feature flag from DeviceConfig. Provides a binder interface
    for returning per-UID config,
    which only returns cache enabled if the SDK level is V+
    or the app's target SDK is V+.

Test: atest FrameworksNetTests:android.net.connectivity.android.net.TrafficStatsTest \
      FrameworksNetTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest \
      CtsNetTestCases:android.net.cts.NetworkStatsBinderTest \
      FrameworksNetIntegrationTests:com.android.server.net.integrationtests.NetworkStatsIntegrationTest
Bug: 343260158
Change-Id: Id9761e4aea65fabe6466c875b787e178317a1da2

Junyu Lai   commited 2024-10-30 23:02:59 +08:00
b9071f8512