Commit graph android_packages_modules_Co.../tests
Message SHA1
Remove dependencies on the 1-variant fallback
When adding a dependencies, if the variants don't match, but the
dependency only has 1 variant anyways, soong will always use that
variant. This makes it hard to add new variants to soong, because the
1-variant fallback stops being used and you start getting missing
variant errors. Make changes to bp files such that all dependencies
correctly specify the variant to use.

Bug: 372091092
Flag: EXEMPT refactor
Test: m nothing
Change-Id: I8d4f59044f268088b44357d27322abbdcdc3001c

Cole Faust   commited 2024-10-22 16:31:00 -07:00
9ff8f4c81b
Merge "Refactor shouldTestThisNetworkType" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-16 11:02:48 +00:00
507922a1e3
Merge "Add connectivity diagnostics on test failure" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-10-16 04:11:58 +00:00
c0ebf16036
Merge "Remove module tests from FrameworksNetTests" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-16 02:42:36 +00:00
679edb482f
Add connectivity diagnostics on test failure
When CtsNetTestCases tests fail, or when a tryTest statement fails,
collect connectivity diagnostics and output them as a test artifact.

tryTest must be followed by cleanup blocks, which often change the
configuration, so having diagnostics when the tryTest fails in addition
to after the test failure is useful.

The collected diagnostics will be available as individual test
artifacts. They should make it easier to investigate test failures, and
could be collected across test runs in an automated way.

Output files are currently limited at 20 per run, to avoid collecting
too much data in case everything is failing in the run.

Test: atest
Change-Id: Iaa48e519028dc61c03d387beeade7d41fca2ef48

Remi NGUYEN VAN   commited 2024-10-16 10:05:35 +09:00
43730b3f0f
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 "Rename TapPacketReader to PollPacketReader for broader applicability" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-10-15 08:52:44 +00:00
9e13b32ede
Merge "Move buildMdnsServiceInfoFromResponse to MdnsUtils." into main
Paul Hu   authored and   Gerrit Code Review   commited 2024-10-15 05:08:14 +00:00
49bf74e8a3
Rename TapPacketReader to PollPacketReader for broader applicability
* Renamed TapPacketReader to PollPacketReader to better reflect its
  functionality beyond TAP interface interaction.
* The class includes general logic for polling and sending packets to
  file descriptors, making it suitable for wider use cases.

Test: TH
Change-Id: Icdf9a9d7ef6f49b589ed9cdbd05159ab95e7e5d9

Yuyang Huang   commited 2024-10-15 13:42:05 +09:00
eb3c631b89
Move buildMdnsServiceInfoFromResponse to MdnsUtils.
Move this utility method buildMdnsServiceInfoFromResponse from
MdnsServiceTypeClient to MdnsUtils so it can be used by other
classes.

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

Paul Hu   commited 2024-10-15 03:00:58 +00:00
f311b43bef
Merge "Validate cellular network in testSetAvoidUnvalidated() for accurate testing" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-10-09 08:36:26 +00:00
2f6d6421ad
Validate cellular network in testSetAvoidUnvalidated() for accurate testing
* Modified testSetAvoidUnvalidated() to ensure the cellular network is
  validated before proceeding with default network switching tests.
* This prevents inaccurate test results when the cellular network is not
  usable, as the connectivity service won't switch to it if the Wi-Fi
  network becomes invalid.

Bug: 371818866
Test: TH
Change-Id: I458903392605a44470d5f226a36cfa983ec71aea

Yuyang Huang   commited 2024-10-09 16:51:42 +09:00
99a17f99af
Remove useless mts/mcts tags for CtsTetheringTest.
CtsTetheringTest only appears in mts-tethering-tests-list-user.xml
and not in any other test lists. So remove the MCTS tags that refer to
other MTS suites.

Bug: 369758357
Test: test-only change
Change-Id: Ib75f9c287e011b770bddeee4fba3e6f6f699a93a

Tongbo Liu   authored and   Lorenzo Colitti   commited 2024-10-08 15:36:32 +00:00
d833d726da
Refactor shouldTestThisNetworkType
This is a no-op refactoring for test.

Currently, shouldTestThisNetworkType method check test
preconditions and generating network traffic for testing.
Decouple these two functionalities to allow follow-up
changes to capture data usage baseline prior to
generating network traffic.

Test: atest CtsNetTestCases:android.net.cts.NetworkStatsManagerTest \
      --rerun-until-failure 30
Bug: 368624224
Change-Id: I5510184ec0cf8afa05b46f78ebaf80e500abaeeb

Junyu Lai   commited 2024-10-02 23:07:01 +08:00
359d23059c
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