Commit graph android_packages_modules_Co.../staticlibs/testutils/app/connectivitychecker
Message SHA1
Remove RecorderCallback.
This class doesn't actually serve a purpose, it only makes
TestableNetworkCallbck more complex.

Test: CtsNetTestCases ConnectivityCoverageTests
Flag: EXEMPT test-only
Change-Id: I39a598b82a3215384bdfe04980f4b280ab2c2716

Chalard Jean   commited 2025-05-19 16:35:53 +09:00
f2994122c1
Wait for default route for wifi check
Instead of only waiting for an IPv6 address, wait for global IPv6
addresses to be routable.

This mirrors the check used for AI_ADDRCONFIG in DnsResolver. Without
this, the later call to network.getAllByName may only return IPv4
addresses if IPv6 global addresses are not reachable.

Test: atest
Change-Id: I2cedd58431eb8abeb5ffd9fb8daedb061586373b

Remi NGUYEN VAN   commited 2025-01-15 16:12:04 +09:00
ee21b71492
Merge "Add QUIC testing to test preparer" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-11-29 01:15:18 +00:00
323c15448a
Add QUIC testing to test preparer
In addition to verifying that the wifi network is validated, also verify
that it can use QUIC on both IPv4 and IPv6.

This makes setup issues more obvious and avoids blaming individual
tests, by failing the whole module in case devices are connected to
access points that do not meet the test prerequisites.

The QUIC test (including the test packet) is mostly taken from
NativeMultinetworkJni.cpp and written in Kotlin.

Test: atest
Change-Id: I1c0381e1ad4146d4827fbc1bf095da13dfe3d124

Remi NGUYEN VAN   commited 2024-11-29 08:42:51 +09:00
cc8b8f9165
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
Disable IWLAN in tests on 24Q2
24Q2 reconnects mobile data when Wi-Fi is toggled when IWLAN is used,
which breaks multinetwork tests. Disable IWLAN as a workaround on such
builds.

Bug: 368477391
Test: atest
Change-Id: Ia5748dc2378c5fc4a43ff83e6b47e629eb8bf77a

Remi NGUYEN VAN   commited 2024-10-30 17:41:03 +09:00
1372ac2140
Add ignore-mobile-data-check option to preparer
Allow tests to use ConnectivityTestTargetPreparer with
require-mobile-data=false, if the test only requires wifi.

Bug: 340098257
Test: atest
Change-Id: I32b67932fc9973f374c975f2fd8009699f5d2725

Remi NGUYEN VAN   commited 2024-06-14 15:09:30 +09:00
070094d857
Drop circular dependency
There was a circular dependency between net-tests-utils-host-common and
ConnectivityTestPreparer. This hasn't caught because Soong didn't track
the required dependency (ConnectivityTestPreparer requires the other).
However, as Soong is fixed to track the dependency type, this is caught
as an error.

Dropping the "required" dependency because net-tests-utils-host-common
is a host test module and is the entry point.

Bug: 321626681
Test: m
Change-Id: I539bbe2689be0af52bfec35966dd8210137d6c72

Jiyong Park   commited 2024-04-05 14:34:10 +09:00
093a4cfa95
[DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 12:34:50 +00:00
01b5ede2b2
Improve message for SIM cards not supporting data
The previous message is not clear about the fact that there is
a SIM card inserted. Clarify it.

Change-Id: I2391d9fa7762b6225438049199f9f178a8b24d41

Remi NGUYEN VAN   commited 2023-11-17 04:14:39 +00:00
1af3d90f24
bump min_sdk_version from 29 (Q) to 30 (R)
Mainline no longer supports Q.
These files were recently moved into p/m/C as part of a refactor.

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

Maciej Żenczykowski   commited 2023-09-19 23:22:58 +00:00
127a1441c3
Check that wifi, cell validates before tests
Tests are sometimes run on hardware devices with wrongly configured wifi
or cell data. Ensure that this is reported as an infra error, and not a
test error, so the root cause is easier to identify.

Bug: 264170054
Test: atest
Change-Id: I4f964fbd4ee497e8ac92f7729375b75b6c4594a3

Remi NGUYEN VAN   commited 2023-09-19 17:26:20 +09:00
f1846ac13b
Use requestNetwork for mobile data, not a callback
On devices that do not have always active mobile data, it needs
to be requested for onAvailable to be called.

Change-Id: Ic814684bcd06389c013a6e6636487d9b47627901
Test: TH

Remi NGUYEN VAN   commited 2023-08-01 08:48:32 +00:00
837837e0fe
Make ConnectivityCheckTargetPreparer more generic
Rename ConnectivityCheckTargetPreparer to
ConnectivityTestTargetPreparer, and the ConnectivityChecker app to
ConnectivityTestPreparer, and remove the assumption that the app only
does connectivity checks.

This will allow overriding the app with versions that have more specific
setup steps in downstream branches.

Bug: 263665773
Bug: 267413275
Test: tests using this preparer
Merged-In: Icb9b1eb8eb1c75f89cb751e0ca696ea96359e6d0
Change-Id: Icb9b1eb8eb1c75f89cb751e0ca696ea96359e6d0

Remi NGUYEN VAN   commited 2023-05-16 15:14:30 +09:00
e2b5213774
Remove eventuallyExpectOrNull usages from AOSP
This is not useful because it has the exact same semantics
as poll() : it returns the first event that matches the
predicate within the timeout, or null if none.

Unfortunately the method can't be removed until all
uses in internal master are removed, so the actual
removal will have to wait for the next patch.

Test: TH
Bug: 157405399
Change-Id: I471c44568e359f8686dcb21ae04c76ca8095f02f

Chalard Jean   commited 2023-03-07 21:47:11 +09:00
febf4ab6fb
Check that cell network is available before tests
Instead of only checking that a sim card that supports data connectivity
is inserted, also check that there is an available cellular network.
This helps ensure that the device is setup with a working data plan and
APN configuration.

Bug: 242628522
Test: atest CtsNetTestCases
Change-Id: Id47d49de77da5d9f7a87ff34b954c61662965c9e

Remi NGUYEN VAN   commited 2022-08-22 11:15:49 +09:00
da0e172551
Enable strict_updatability_linting in frameworks/libs/net
Enable the strict_updatability_linting here first as a prior
commit to enable strict_updatability_linting in connectivity
modules.

Bug: 188851968
Test: m lint-check ; atest NetworkStaticLibTests
Change-Id: Idac98a1c85bf5bb86269b1daad2b444cfb58db8a

Chiachang Wang   commited 2021-11-19 15:41:27 +08:00
7068c88921
[LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net
Added SPDX-license-identifier-Apache-2.0 to:
  common/testutils/app/connectivitychecker/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I9e25f435ce9835f12a167e6c57e33f6d87c159de

Bob Badour   commited 2021-11-11 10:10:56 -08:00
891a3b9fb7
Add ConnectivityCheckTargetPreparer
ConnectivityCheckTargetPreparer is a tradefed target preparer that uses
the connectivitychecker app to verify device configuration, before
running any test.

The connectivitychecker app verifies that the device has a
pre-configured wifi configuration and can connect to it (except for
virtual devices where it may create the configuration itself), and
verifies that the device has a data-enabled SIM card inserted.

Checks are skipped if the device is not wifi- or mobile data-capable,
and can be skipped for local testing by running with:

  atest X -- --test-arg \
    com.android.testutils.ConnectivityCheckTargetPreparer:disable:true

Test: atest CtsNetTestCasesLatestSdk
Change-Id: I5b6d34a6c393863af23af57ff026b15973e9e784

Remi NGUYEN VAN   commited 2021-11-04 19:57:21 +09:00
c02dcd721a