Have TestableNetworkCallback adopt it, as a first client. It's also by
far the most complex.
Test: TH
Flag: EXEMPT test-only
Change-Id: Ie58d051b4478c901b7f0f54e89a67d22f1ee2ce2
This class doesn't actually serve a purpose, it only makes
TestableNetworkCallbck more complex.
Test: CtsNetTestCases ConnectivityCoverageTests
Flag: EXEMPT test-only
Change-Id: I39a598b82a3215384bdfe04980f4b280ab2c2716
Fix forward for b/405308292
Background: new / existing runtime permission is now used to guard
access to local networks. apps / tests now need to hold this permission
to do traffic with local devices.
Test: CtsHostsideNetworkTests, TH
Bug: 405308292
Change-Id: Ib4892cc817946c74094bfc5d9c54a95bb17ad30b
HostsideTetheringTest#testSoftApConfigurationRedactedForOtherApps is
only applicable in B+, so skip it if not.
Bug: 403129363
Test: atest HostsideTetheringTests
Change-Id: I6b4be858befcabb1892ee4113ac2cf17b5d49ca5
Quang Anh Luongcommited 2025-03-19 19:26:24 +09:00
The test expects validated VPN network callbacks. However, an
unexpected Wi-Fi link bandwidth change during the test introduces
flakiness. To enhance test stability, specify the expected
callbacks to reduce flakiness.
Bug: 401489016
Test: atest CtsHostsideNetworkTests --iteration
Change-Id: I152ba5a4ff6c4a124db820f0eb58bb057e4dee5b
Unreleased SDK version is 10000, not 100000.
The code is already correct, only the comment is wrong.
Test: comment-only change
Change-Id: Ib006e98cbaf10b7da0f7a80df8d6a99527923743
Lorenzo Colitticommited 2025-03-03 20:30:24 -08:00
testBlockIncomingPacketsis flaky since ParcelFileDescriptor's
finalizer closes fd and makes fd invalid.
This CL fixes this issue by keeping the reference to
ParcelFileDescriptor.
Bug: 394503660
Test: testBlockIncomingPackets
Change-Id: I1c1645d95b9d9ae1bd5af4ada500f50f350b6b0b
When an adb command starts with "shell", executeAdbCommand has special
logic to treat failures of the command as communication failures, and
try to recover the device. This causes instrumentation failures. See
NativeDevice.AdbShellAction#run.
Replace executeAdbCommand with executeShellCommand to avoid
instrumentation failures when the command does not succeed.
Test: atest ProcNetTest
Fixes: 385404810
Change-Id: I693f422f63cf592202ab3e49a9958c61f779b4d5
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 Luongcommited 2024-11-19 19:32:19 +09:00
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 Groovercommited 2024-11-18 23:28:24 -06:00
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
* 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 Colittiauthored and Gerrit Code Reviewcommited 2024-09-23 23:53:02 +00:00
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 Colitticommited 2024-09-20 15:04:11 +09:00
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 Colitticommited 2024-09-20 14:48:51 +09:00
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 Colitticommited 2024-09-20 14:48:19 +09:00
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 Colitticommited 2024-09-20 14:48:12 +09:00
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 Colitticommited 2024-09-20 14:48:08 +09:00
modules should specify the submodule of java_sdk_library that the module
actually depends on
Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a
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 Colitticommited 2024-09-09 19:47:44 +09:00
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 Huangauthored and Lorenzo Colitticommited 2024-09-09 19:47:44 +09:00
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 Colitticommited 2024-09-09 18:43:15 +09:00
Missing min_sdk_version will make the helper apps failed to install on
older Android releases.
Bug: 364110022
Test: TH
Change-Id: I2b53d3547d175786574064f9b8b24ea5d302a3ff
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
Some tests were disabled by aosp/2676836 since these tests were flaky
(b/291701394).
b/291701394 was fixed. So, this CL re-enables them on presubmit.
Bug: 291701394
Bug: 342557183
Test: VpnTest --iterations 10
Change-Id: I299dd0dfd7d6cbdea2ad97477b5613c78af421e1
This change specifies the sdk_version property to the cts test modules
so that the test modules do not depend on the framework, and utilize the
test api instead.
Test: TH
Bug: 345499522
Change-Id: I876fb8681dadad9d123bedb38d67c1a31b0f3a54
On V+, ConnectivityService generates blockedReasons based on bpf map
contents even if the uid does not exist on device.
So if allowlist chain (e.g. background chain) is enabled, network access
from non existing uid is considered blocked.
Test: VpnTest#testDefault
Bug: 342557183
Change-Id: I7776c1ea0d546e53a3495d4db6d42c573b6d1f7f
testDropPacketToVpnAddress is flaky since ParcelFileDescriptor's
finalizer closes fd and makes fd invalid.
This CL fixes this issue by keeping the reference to
ParcelFileDescriptor.
Bug: 334644322
Test: VpnTest
Change-Id: Ib8f094725b39ac5824cd9a62918efe51f86e5cb1
Tests for the connectivity module and network policy are both currently
residing in the same cts module leading to significant problems while
maintaining the tests. Breaking them up into two separate modules so
making changes and maintaining error free tests is easier.
Development of network policy changes occurs in non-updatable system
code so relevant tests should be moved outside of the apex module
respository. This will be possible after this change.
Network policy related tests are moved to the new module
CtsHostsideNetworkPolicyTests, with classes renamed accordingly.
Since some code was shared between tests, that code is now duplicated in
the new module.
No functional change to tests is intended. Further refactorings to
better suit the new structure should be pursued independently via
follow-up changes in respective modules from now on.
Test: atest CtsHostsideNetworkTests
Test: atest CtsHostsideNetworkPolicyTests
Bug: 322115994
Change-Id: I2c6ad2281ede6bad099c971b1f212244881a262d
tearDown expect setUp is executed.
So move VPN hardware assumption check after all the setUps
Test: atest HostsideVpnTests
Bug: 330070197
Change-Id: I671897764908dc0188bcb2aef7177f1e4d573a8f
The testChangeUnderlyingNetworks test enables the Wi-Fi network
and ensures it's connected. However, the CS can switch the
default network to Wi-Fi at any time when it becomes validated,
and if this happens after the test obtains the active network,
it leads to a mismatch on underlying networks and causes the test
to fail. Therefore, ensure the Wi-Fi network is validated before
obtaining the active network.
Fix: 332967125
Test: atest CtsHostsideNetworkTests:com.android.cts.net.\
HostsideVpnTests#testChangeUnderlyingNetworks --iteration
Change-Id: If71c2ea6608f26b1dbc9802ef49e1f14b202c156
Checking that the network was successfully restricted before starting
the activities in ConnOnActivityStartTest. This avoids races between uid
state changes and device state changes in NPMS code that lead to
unpredictable UnknownHostException flakes in the first iteration.
Moving the java cache clearing to happen immediately before the check,
so no side effect from different code can impact the DNS query.
Increasing the socket-timeout to mitigate socket timeout failures.
Changing the default test URL to generate a 204 to avoid any extraneous
errors that may arise in doing other I/O, and switching to the canonical
connectivity check URL on the android.com domain.
Enabling support for passing down a custom url to use for testing
network connectivity using the runner options. This will enable easily
switching between different URLs for debugging when required.
Using a dedicated data class to encapsulate information to be returned
from test app to the instrumentation app.
This makes the logic more resilient, readable and maintainable.
Test: atest CtsHostsideNetworkTests:HostsideConnOnActivityStartTest --\
--test-arg com.android.compatibility.common.tradefed.testtype.JarHostTest:\
set-option:com.android.cts.net.HostsideConnOnActivityStartTest:\
custom-url:"https\://www.example.com"
Bug: 330406935
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:04c638ee3a5bab7895817ebfc0d3f6a69b1ee26d)
Merged-In: I139408fc0a9ffa21d7bd2f3f249d45a7b25243b4
Change-Id: I139408fc0a9ffa21d7bd2f3f249d45a7b25243b4
Suprabh Shuklaauthored and Android Build Cherrypicker Workercommited 2024-04-02 05:51:41 +00:00
Developers often forget to unregister requests in tests, and cleanup
code also makes tests more verbose.
Add a rule that unregisters callbacks automatically when after each test
method.
Replace current usage of connectToCell with this rule, as well as
network callback usage in CaptivePortalTest (which is one example that
did not unregister its callback).
Test: atest
Change-Id: Ie3b9c5cf529004b7b3af04bc13a7e69acfbbaa18