Commit graph android_packages_modules_Co.../staticlibs/testutils/host
Message SHA1
Add assert_utils for multidevice test
Test: atest NetworkStaticLibHostPythonTests
Bug: 335368434
Change-Id: I2a9ee97b84cb16791c0c5e3cb03120e67ffeb0af

Junyu Lai   commited 2024-07-01 12:23:59 +08:00
850e6fae54
Move utils to staticlib
This is a no-op refactoring.

Test: m connectivity_multi_devices_snippet && \
      atest CtsConnectivityMultiDevicesTestCases
Bug: 335368434
Change-Id: I415cc22f49c437be6fe8e8ae8822af22ebefe8d1

Junyu Lai   commited 2024-06-28 11:19:54 +08:00
79b771f9bb
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
Refresh time before connectivity tests
After checking that networking is available, force a time sync.

This should avoid flakes where time changes during tests, for example
for tests using test settings like test_url_expiration_time in
NetworkMonitor.

Fixes: 342489019
Test: atest
Change-Id: I0c07440679bc14dcf5cddf55fb1391d3ed76feba

Remi NGUYEN VAN   commited 2024-06-04 16:06:19 +09:00
4ae1387146
Fix arg order to set-package-network-enabled in the CTS preparer
Test: manual
Change-Id: Ife55ed9dc152cd2c21e56b84201b9c34dbb04d46

Chalard Jean   commited 2023-10-23 17:26:53 +09:00
a27dca2fdc
Block the package updater while CTS are running
Test: manual
Bug: 284534251
Change-Id: I8843ce7c9e14cfe3f6f3439405d519587f2656ef

Chalard Jean   commited 2023-09-21 12:57:10 +09:00
3a6544fb1f
Disable Play auto-update during tests
For devices using Play services, disable auto-update during tests, as it
may interfere with them. For example, Webview may be killed if it is
opened while the update is applied.

Bug: 263665773
Test: atest
Change-Id: I9613d739ad0763c882a1971879aa743f4541a75c

Remi NGUYEN VAN   commited 2023-05-16 15:14:53 +09:00
90edff826a
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
Use TargetSetupError for ConnectivityCheck
If the preparer throws AssertionError, tests will still
be retried without re-running the preparer. It needs
to throw TargetSetupError to indicate that setup failed.

Change-Id: Id01845536a216e1a3ca1c671c97f7bcd992c354e
Fixes: 254542801
Test: atest

Remi NGUYEN VAN   commited 2022-12-13 14:58:40 +09:00
449c01f6f6
Add DisableConfigSyncTargetPreparer
The TargetPreparer disables DeviceConfig sync before a test module, and
attempts to reset it to its original state afterwards.

It only supports S+ as the associated commands are not available on R-.
The format of commands has also changed in some T branches , so support
legacy format if the newer format is not supported by the device.

Bug: 210377950
Test: atest CtsNetTestCases using the preparer, verify setting set
      during the test.
Change-Id: Iaabaa1050b024e1378ab1cf87a394cc8ebab227b

Remi NGUYEN VAN   commited 2022-03-09 12:23:49 +09:00
d12797dba4
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