Commit graph android_packages_modules_Co.../tests
Message SHA1
Remove module tests from FrameworksNetTests
Connectivity module tests are currently included in both
FrameworksNetTests and ConnectivityCoverageTests. This causes confusion,
may cause tests to fail in one configuration but not the other, is
inefficient in terms of build time and infrastructure usage, and forces
developers to keep tests passing in two different configurations that
may use different libraries.

Only include non-connectivity-module-test in FrameworksNetTests, and
keep them excluded from ConnectivityUnitTestsLib (renamed from
FrameworksNetTestsLib).

Test: atest
Change-Id: I1c557c1b4c643b3eba3bffffd89634e1141d5c0e

Remi NGUYEN VAN   commited 2024-10-16 09:56:17 +09:00
96267ec798
Merge "Fix the test flake in testRemoveServicesAfterSocketDestroyed" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-27 06:31:38 +00:00
8a0613cc9e
Merge "Revert "Use unicast instead of broadcast as ethernet destination in test_apf_drop_ethercat"" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-09-26 18:12:15 +00:00
b437e753f7
Revert "Use unicast instead of broadcast as ethernet destination in test_apf_drop_ethercat"
This reverts commit 46102348e0.

Reason for revert: mistakenly submitted.

Change-Id: I6072a9828a8cc0633ca35ea2ecf7707f2b3573a1

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-09-26 18:11:41 +00:00
c3eccf9ef4
Fix the test flake in testRemoveServicesAfterSocketDestroyed
The removeServices() is running on a different handler, which
might take some time to complete. Therefore, the verification
should include a timeout to wait longer and prevent test flake.

Bug: 367429622
Test: atest MdnsDiscoveryManagerTests#testRemoveServicesAfter\
      SocketDestroyed --iteration
Change-Id: I79626bad680a62993c3e7d6b356acc10755257e3

Paul Hu   commited 2024-09-26 05:56:28 +00:00
78bd66003a
Merge "Use unicast instead of broadcast as ethernet destination in test_apf_drop_ethercat" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-09-25 21:02:35 +00:00
aabad69006
Use unicast instead of broadcast as ethernet destination in test_apf_drop_ethercat
To prevent packet dropped earlier by multicast filtering,
use unicast ethernet destination instead

Bug: 360730207
Test: m connectivity_multi_devices_snippet && atest CtsConnectivityMultiDevicesTestCases:ApfV4Test
Change-Id: I4816b71f68f349abf1423c7013bb058ccc233d61

Jimi Chen   authored and   Maciej Żenczykowski   commited 2024-09-25 19:42:01 +00:00
46102348e0
Merge changes I2368f118,I57eb7c6d,I66e4e537,If510519b,Ia441170c into main
* changes:
  Skip testRouterSolicitations on T- devices.
  Remove CtsHostsideNetworkTestAppNext.
  Set all hostside network tests apps' target SDK to 10000.
  Consolidate defaults for hostside network tests apps.
  Stop depending on shims in CtsHostsideNetworkTests.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2024-09-23 23:53:02 +00:00
daab4db187
Merge "Fix NullPointerException in Ikev2VpnTest for watches" into android15-tests-dev am: de32aa8b11
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/3272967

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

Yeabkal Wubshit   authored and   Automerger Merge Worker   commited 2024-09-20 21:49:50 +00:00
6566f7c57d
Merge "Fix NullPointerException in Ikev2VpnTest for watches" into android15-tests-dev
Yeabkal Wubshit   authored and   Gerrit Code Review   commited 2024-09-20 21:40:34 +00:00
de32aa8b11
Fix NullPointerException in Ikev2VpnTest for watches
Watches do not have a VpnManager instance anymore, so the tests crashes
at the teardown step when trying to interact with a null VpnManager.

Bug: 368624224
Bug: 340928692
Test: Ikev2VpnTest
Change-Id: Iedf784625933e73bcb5fed9bfa36fbae1e11d398

Yeabkal Wubshit   commited 2024-09-20 19:51:41 +00:00
13c6573270
Skip testRouterSolicitations on T- devices.
This does not lways pass on some devices before U. Now that the
test is being added to MCTS, and needs to be backwards
compatible, skip this test on T- devices.

Test: atest CtsHostsideNetworkTests
Change-Id: I2368f118d2539d70a97c937485f5179c47ba28d7

Lorenzo Colitti   commited 2024-09-20 15:04:11 +09:00
eca630007a
Remove CtsHostsideNetworkTestAppNext.
This is now identical to CtsHostsideNetworkTestsApp, and we're
getting rid of -Next targets anyway, so there's no point in
keeping it.

Bug: 365191921
Test: atest CtsHostsideNetworkTests
Change-Id: I57eb7c6d9bc37d222a9449bbc85265e7c6ec9ffc

Lorenzo Colitti   commited 2024-09-20 14:48:51 +09:00
0820ccb033
Set all hostside network tests apps' target SDK to 10000.
This ensures they are subject to the most restrictive target SDK
restrictions and that we never have to manually increment their
target SDK version.

Bug: 365191921
Test: atest CtsHostsideNetworkTests
Change-Id: I66e4e53720b2860094b7a4d3194a81a063b116da

Lorenzo Colitti   commited 2024-09-20 14:48:19 +09:00
6a655a02d1
Consolidate defaults for hostside network tests apps.
For now, only share a couple of statements (min_sdk_version and
platform_apis). More will be added later.

Also, remove the test_suites stanzas everywhere. These are not
relevant for test apps because the APKs will be pulled in by
the data: stanzas anyway.

Bug: 365191921
Test: atest CtsHostsideNetworkTests
Change-Id: If510519b3bdd6ab27c1923bae523cddb694e0ecc

Lorenzo Colitti   commited 2024-09-20 14:48:12 +09:00
64cd28ddd7
Stop depending on shims in CtsHostsideNetworkTests.
These are no longer necessary, and now that udc-mainline-prod is
gone, we are moving away from shims entirely.

Bug: 365191921
Test: test-only change
Change-Id: Ia441170c25a04d7b146b48e170d53e0916d49ecf

Lorenzo Colitti   commited 2024-09-20 14:48:08 +09:00
2f87cc0610
Skip TestDropPacketToVpnAddress if the feature is disabled
INGRESS_TO_VPN_ADDRESS_FILTERING is disabled due to b/352424251 and
testDropPacketToVpnAddress fails if the feature is disabled.
So skip testDropPacketToVpnAddress if the feature is disabled.

Bug: 362434644
Test: adb shell device_config put tethering
      ingress_to_vpn_address_filtering -1
Test: atest CtsHostsideNetworkTests
(cherry picked from https://android-review.googlesource.com/q/commit:9d5d7d07793549a9c8a19d6277c498683cb7da3f)
Merged-In: Ib16a7550dcf93dd9ecf29047b1c4f101ff6d610d
Change-Id: Ib16a7550dcf93dd9ecf29047b1c4f101ff6d610d

Motomu Utsumi   authored and   Android Build Cherrypicker Worker   commited 2024-09-18 11:12:45 +00:00
41ce7c550c
Enable secondary_user_on_secondary_display for CtsNetApi23TestCases
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
current user) interacting with driver's display.

Bug: 364635030

Test: atest CtsNetApi23TestCases
Test: atest --user-type secondary_user_on_secondary_display \
        CtsNetApi23TestCases

(cherry picked from https://android-review.googlesource.com/q/commit:7969d8baff85ae6c2165e7ac525c913546f070f0)
Merged-In: I9315eff338e5ba232c26e27d2885ab922abddabd
Change-Id: I9315eff338e5ba232c26e27d2885ab922abddabd

bkchoi   authored and   BK Choi   commited 2024-09-17 15:27:28 +00:00
893126b82a
Merge "Enable secondary_user_on_secondary_display for CtsNetApi23TestCases" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-17 07:55:02 +00:00
124d517391
Merge "Remove cached services when the network is disconnected or unrequested" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-13 11:40:45 +00:00
6a7e703f17
Remove cached services when the network is disconnected or unrequested
The services in the cache are no longer useful after the network
is disconnected. Because either the Network object or the
interface index will change after the network is reconnected,
these cached services won't be used for any discovery/resolution/
service info callback requests. Therefore, these cached services
should be removed after the network is disconnected. Otherwise,
these useless cached services will occupy memory until the device
is rebooted.

In addition, the cached service may not be reliable after the
last listener is unregistered. Because the socket is
disconnected, the service type client won't receive any updates
for the services. Therefore, remove these cached services after
exceeding the keeping time.

Bug: 355421878
Test: atest FrameworksNetTests NsdManagerTest
Change-Id: I06ff320fec84f71dc2ed742c50fa46f25c284170

Paul Hu   commited 2024-09-13 06:13:37 +00:00
079c77c296
Merge "Remove Q support" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-09-12 16:46:12 +00:00
2842b3282d
Rename Service Side TrafficStats Cache
Rename TrafficStatsRateLimitCache related
variables to TrafficStatsServiceRateLimitCache.
This is needed since client side cache
would be added.

Test: TH
Bug: 343260158
Change-Id: I12ae977ce33cfb5815aa908d719543d5c8e46f11

Yun-Chen Cheng   commited 2024-09-12 07:06:32 +00:00
a8746d5a92
Remove Q support
Mainline only ships to R+ devices.

Change-Id: I53fbee7dd2bbd39734c3ab96fd218a40e3d44b15
Test: TH

Patrick Rohr   commited 2024-09-12 04:30:23 +00:00
959a87be8a
Merge "No-op refactoring for TrafficStats APIs" into main
Yun-Chen Cheng   authored and   Gerrit Code Review   commited 2024-09-11 01:56:42 +00:00
05fb57ea97
Merge "Make java_sdk_library dependencies explicit" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-10 19:12:45 +00:00
430a8ad33c
Merge "Check APF version, VSR API level, and Android version" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-09-10 17:30:53 +00:00
6a5165a211
Merge "Add test cases for not allowed ethertypes" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-09-10 17:30:40 +00:00
881eae079d
No-op refactoring for TrafficStats APIs
Prepare for implementation of client side
TrafficStats rate limit cache.

1. Write Typeless versions of getIfaceStats,
getUidStats, getTotalStats in INetworkStatsService.aidl
that returns NetworkStats instead of Long.
This is needed because in follow-up changes,
the NetworkStats instead of indiviual numbers will
be stored as a cache entry

2. Move some utils from NetworkStatsService
to TrafficStats. This is needed because in the follow-up
changes, these utils would be both accessed by TrafficStats
and NetworkStatsService.

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

Yun-Chen Cheng   commited 2024-09-10 14:36:25 +00:00
69b83606ca
Check APF version, VSR API level, and Android version
This commit introduces checks for APF version, VSR API level,
and Android version to decide whether an APFv4 test should be
run, skipped, or fail:
* If Android version is less than V, skip the test
* If VSR API level is greater than or equal to 14 and APF
  version is less than 4, fail the test
* Otherwise, if APF version is less than 4, skip the test

Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases:ConnectivityMultiDevicesTest
Fix: 352132428
Change-Id: I023164fb59ad40f489abea2e0c45761efc39699b

Junyu Lai   commited 2024-09-10 18:06:28 +08:00
73711f7b41
Add test cases for not allowed ethertypes
Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases:ApfV4Test
Bug: N/A
Change-Id: I4dba59c6f4f88e180dfe1742221280f6994c9113

Junyu Lai   commited 2024-09-10 18:05:34 +08:00
9418634ddf
Make java_sdk_library dependencies explicit
modules should specify the submodule of java_sdk_library that the module
actually depends on

Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a

Jihoon Kang   commited 2024-09-10 00:01:31 +00:00
8401b6a9f0
Make the CTS VPN hostside tests pass on R.
Fix: 365138990
Test: test-only change
Change-Id: I1a5729872ee3dac1380a4013c9aa2f7e32859376

Lorenzo Colitti   commited 2024-09-09 19:47:44 +09:00
51d8d9c785
Skip automatic on/off keepalives before U.
The API to start them was only added in U.

The actual failure here is not an error in calling the API, it's
the fact that the test is using CollectionUtils from the
framework jar instead of statically linked copy. This might be
a problem with jarjar rules. That said, given that these APIs
are module-lib, and were only added in U, it's probably OK to
test them only on U.

Bug: 365129333
Test: CtsHostsideNetworkTests passes on redfin running S
Change-Id: I0b6a030e9ebcab573515fb58becadee8298bd653

Lorenzo Colitti   commited 2024-09-09 19:47:44 +09:00
c2a8d8f642
Extend CtsHostsideNetworkTests support to Android R (API 30)
Updated the testing app and AIDL interface used by
CtsHostsideNetworkTests to support min_sdk_version 30, ensuring
compatibility with Android R devices.

Test: TH
Change-Id: Ib334f95cf9bd199cce46b2c98d40d8361179aac3

Yuyang Huang   authored and   Lorenzo Colitti   commited 2024-09-09 19:47:44 +09:00
cea1e6034f
Set min_sdk_version to 31 for CtsHostsideNetworkTestsAidl.
This allows CtsHostideNetworkTests to run on S. Setting minsdk
to S is required because if the minsdk is T or above, the AIDL
compiler will generate code that contains Parcel#obtain(IBinder),
which only exists on T+.

Fix: 365129333
Test: atest CtsHostsideNetworkTests passes on redfin running S
Change-Id: Icac58bcc27194129014a0d615b5ca43b8f352ebd

Lorenzo Colitti   commited 2024-09-09 18:43:15 +09:00
4071ab64a1
Merge changes Id9799762,I9d749393 into main
* changes:
  Introduce FlagOverrideProvider#getIntValueForTest
  Add DiscoveryExecutor#executeDelayed

Paul Hu   authored and   Gerrit Code Review   commited 2024-09-06 05:59:02 +00:00
70896174e2
Add DiscoveryExecutor#executeDelayed
This method can execute the task after the specified amount of
time elapses.

Bug: 355421878
Test: atest FrameworksNetTests NsdManagerTest
Change-Id: I9d749393bd5435cdba5072d48242cd0d17332b67

Paul Hu   commited 2024-09-05 15:33:58 +00:00
61a220eaf8
dscpPolicyTest: make it actually test caching
Test: TreeHugger, atest CtsNetTestCases:android.net.cts.DscpPolicyTest
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4164732ed5545c43fd02cbb9d9dae57966241ab8

Maciej Żenczykowski   commited 2024-09-04 23:19:07 +00:00
26e30d140e
Enable secondary_user_on_secondary_display for CtsNetApi23TestCases
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
current user) interacting with driver's display.

Bug: 364635030

Test: atest CtsNetApi23TestCases
Test: atest --user-type secondary_user_on_secondary_display \
        CtsNetApi23TestCases
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:ebef3cb0fe2b85fcf5828e64d437efc4eab18d30)

Change-Id: I9315eff338e5ba232c26e27d2885ab922abddabd

bkchoi   authored and   BK Choi   commited 2024-09-04 21:11:50 +00:00
7969d8baff
Add unit test to verify retrieving and storing the network events.
Bug: 329010113
Test: atest FrameworksNetTests:android.net.connectivity.android.net.IpMemoryStoreTest
Change-Id: Ie141ae4a8ac583002a0b7b89658331ca4a5a5ded

Xiao Ma   commited 2024-09-03 15:56:59 +00:00
04f4b03fc8
Give CtsHostsideNetworkTests helper apps a min_sdk_version
Missing min_sdk_version will make the helper apps failed to install on
older Android releases.

Bug: 364110022
Test: TH
Change-Id: I2b53d3547d175786574064f9b8b24ea5d302a3ff

Yuyang Huang   commited 2024-09-03 15:17:36 +09:00
4d61c23b5f
Merge "Skip TestDropPacketToVpnAddress if the feature is disabled" into main
Motomu Utsumi   authored and   Gerrit Code Review   commited 2024-09-02 07:52:02 +00:00
b8950d144a
Skip TestDropPacketToVpnAddress if the feature is disabled
INGRESS_TO_VPN_ADDRESS_FILTERING is disabled due to b/352424251 and
testDropPacketToVpnAddress fails if the feature is disabled.
So skip testDropPacketToVpnAddress if the feature is disabled.

Bug: 362434644
Test: adb shell device_config put tethering
      ingress_to_vpn_address_filtering -1
Test: atest CtsHostsideNetworkTests

Change-Id: Ib16a7550dcf93dd9ecf29047b1c4f101ff6d610d

Motomu Utsumi   commited 2024-09-02 15:21:30 +09:00
9d5d7d0779
Merge changes I471014c1,I5365c4da into main
* changes:
  Handle ICMP in testRequestIpSecTransformStateForTx
  Add awaitEspPacket that requires sequence number match

Yan Yan   authored and   Gerrit Code Review   commited 2024-08-30 21:04:43 +00:00
60cc6a145b
Add mainline module controller for tethering
Bug: 361813608
Bug: 358007993
Change-Id: I4287f0670fd7b3b1ccbeaa7056b6bbedc6768f7e

Tongbo Liu   authored and   Lorenzo Colitti   commited 2024-08-30 15:04:34 +00:00
603b8e0205
bpf: git mv tests/mts bpf/tests/mts
Another step towards moving all bpf related stuff into a common directory,
which will ease development.

I want to refactor this test so that it can also be run as a self-test
in UML (for testing bpfloading functionality across a large variety of
Linux kernel (both major and minor LTS) and Android (API/SDK level)
platform versions.

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

Maciej Żenczykowski   commited 2024-08-26 16:19:48 -07:00
548e35eb42
Merge "Inform DNS resolver whether DDR is enabled." into main
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2024-08-26 06:43:19 +00:00
ea68942848
Handle ICMP in testRequestIpSecTransformStateForTx
testRequestIpSecTransformStateForTs was flaky because sometimes
ICMPv6(Router Solicitation) might be sent and failed the validation
of packet/byte count.

This CL provides two improvements
- Change the validation to handle possible ICMP packets
- In the await method, require sequence number match to ensure
  the expected packet has been sent out. Otherwise the await method
  will still return true on an old packet with the same SPI.

Bug: 358324865
Test: atest IpSecManagerTunnelTest
Flag: Exempt test code only
Change-Id: I471014c11328bc0f32ee1f805accbaf7b29b8e7c

Yan Yan   commited 2024-08-23 15:23:59 -07:00
3479e57fd2
Add awaitEspPacket that requires sequence number match
This is a preparation patch for improving
testRequestIpSecTransformStateForTx

This patch:
- Adds another awaitEspPacket method that requires sequence number
  match
- Defines ICMP header length in the PacketUtils

Bug: 358324865
Test: atest IpSecManagerTunnelTest
Flag: Exempt test code only
Change-Id: I5365c4daf983cc98f8f869a30cee1799138fa2b3

Yan Yan   commited 2024-08-23 15:22:09 -07:00
721772d97e