It's possible that private DNS setting is not in the state we expected
when we tried to enable strict mode during tests. The problem here is
that there are 2 setting Uris(mode and specifier) relating to strict
mode, each of them might trigger private DNS setting changing evnet in
ConnectivityService.
Previously, we tried to enable strict mode with first set private DNS
mode and then private DNS specifier. This may result in 2 consecutive
private DNS changes events with very short intervals, which caused
conflicts between DnsResolver / NetworkMonitor and lead to flaky tests.
So
0. Use opportunistic as default mode if no default mode existed.
1. Change the order (mode and specifier) for enabling strict mode.
2. Change private DNS mode only when needed.
(If original mode is "hostname", then we only need to set
specifier)
Bug: 153624005
Bug: 151122313
Bug: 150952393
Test: atest DnsResolverTest --rerun-until-failure 100
Test: forrest (git_master, cts/networking/gce-all)
Test: forrest (git_rvc-dev, atest CtsNetTestCases)
Test: forrest (git_rvc-dev, mts/dnsresolver/device-all)
Merged-In: I224a6493c87cebaf0bf954c2644e2945ccd50db1
Change-Id: Ib61ad7bd510341366ebbbb72aa451e5809ee3e9d
(cherry picked from commit 7561b1499c1b8da0334b32c0452d49113d9e4806)
The capability did not exist on Q.
Bug: 155993662
Test: atest NetworkRequestTest
Original-Change: https://android-review.googlesource.com/1316082
Merged-In: I94e874e37cadadd90397278bf519db68db48a50f
Change-Id: I94e874e37cadadd90397278bf519db68db48a50f
on Q startCaptivePortalApp was guarded by CONNECTIVITY_INTERNAL instead
of NETWORK_SETTINGS: change the permission adopted by shell on Q to
match the platform.
Test: atest CaptivePortalTest on a Q device
Bug: 150904735
Original-Change: https://android-review.googlesource.com/1316081
Merged-In: I24b6907d164aba07df0f5a1a3715669e99cddd88
Change-Id: I24b6907d164aba07df0f5a1a3715669e99cddd88
- Migrate the test to JUnit4, as JUnit3 cannot use assumeTrue
- Skip IPv4 keepalive tests on networks that do not have native IPv4.
- Refactor usage of adoptShellPermissionIdentity to use try / finally
or runAsShellPermissionIdentity: test failures could lead to
permission failures in other tests due to mismatched adopt/drop.
- Fix ensureWifiConnected to support the "wifi enabled but not fully
connected" case.
Bug: 150949391
Test: atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest \
--rerun-until-failure 50
Original-Change: https://android-review.googlesource.com/1310419
Merged-In: I7459753b1068e1760a95337760db58d1df213fad
Change-Id: I7459753b1068e1760a95337760db58d1df213fad
Add a cts test to check whether app can have netd sytem
permission even the app didn't grant the
CONNECTIVITY_USE_RESTRICTED_NETWORKS permission.
Bug: 144679405
Test: atest android.net.cts.ConnectivityManagerTest
Change-Id: I2c717a11bda43db166a55d343eb752ab45947fe8
Merged-In: I2c717a11bda43db166a55d343eb752ab45947fe8
(cherry picked from commit 1bc6b39789, ag/10285567)
to only run them when com.google.android.tethering is
installed on device. This does not change any existing CTS run.
The logic only applies when the test triggered by mts-tradefed
to make sure it runs appropriate set of tests against the device.
For example, the test will be skipped when running MTS on Q because
tethering and wifi are not on Q devices.
Bug: 154845935
Test: m mts && mts-tradefed run mts-tethering
Change-Id: I9e6bd60982d4ef67538ad506e7008366bbf35363
The CtsNetTestCasesLatestSdk needs to build against platform (for hidden
API access), The JNI library libnativedns_jni used by
CtsNetTestCasesLatestSdk needs to build against stable SDK (for running
on Q). To fulfill the combination, property jni_uses_sdk_apis must be
set.
Bug: 151122313
Bug: 150904735
Bug: 150918852
Test: atest CtsNetTestCasesLatestSdk on R and Q platforms
Merged-In: I5db3cb28829847e74412d270db7d17b81c5e26a2
Change-Id: I8e9af302b487199b144f4fd791bc39d57f002fe2
(cherry picked from commit 452ef123caa60eeebc1744b14137197c47704d6b)
This reverts commit dd9608b7d1147a4eaf36ea634b9fc2f0feca1145.
Reason for revert: This CL made whole test failed.
Bug: 153624005
Bug: 150952393
Bug: 151122313
Merged-In: I083529616dbf80421ea6a322bb57d2bb0f2bca62
Change-Id: I002c39d6535fb31b13bc463812517fe1882f1884
(cherry picked from commit 98015badd01863fa4a79c089f371d9a50f2ae98c)
It's possible that private DNS setting is not in the state we expected
when we tried to enable strict mode during tests. The problem here is
that there are 2 setting Uris(mode and specifier) relating to strict
mode, each of them might trigger private DNS setting changing evnet in
ConnectivityService.
Previously, we tried to enable strict mode with first set private DNS
mode and then private DNS specifier. This may result in 2 consecutive
private DNS changes events with very short intervals, which caused
conflicts between DnsResolver / NetworkMonitor and lead to flaky tests.
So
1. Change the order (mode and specifier) for enabling strict mode.
2. Change private DNS mode only when needed.
(If original mode is "hostname", then we only need to set
specifier)
Bug: 153624005
Bug: 153624702
Test: atest DnsResolverTest --rerun-until-failure 100
Merged-In: Iaed6285677f74a5ee6cc6684534ddc0758b25974
Change-Id: I566bdfa98dc070247b52fe29ca1f31cbd1bb8cc2
(cherry picked from commit 877af1ee3ed2c3a9e9256e216709908d2beb3bfb)
If the device is put into airplane mode before the network tests run,
the tests fail. This ensures that airplane mode is off before the tests
run.
Bug: 150788500
Test: atest CtsHostsideNetworkTests
Change-Id: I7a84be751e5e9efb534d48c6d8ff457875ebe716
Test will be affected by logic modification from different
NetworkSpecifiers. Since this test tries to test the behavior
of NetworkRequest but not NetworkSpecifier, use local defined
NetworkSpecifier to test to prevent repeating noisy breaks.
Also update test for testing invariant.
Bug: 154451660
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkRequestTest
Merged-In: I7e357c75a68244432231d59646ddf67c8d969c6d
Change-Id: I7e357c75a68244432231d59646ddf67c8d969c6d
In R, to avoid data overages due to apps not detecting a
meteredness change, when a wifi network changes from unmetered
to metered the network will go down and will be replaced with a
new network. It will make NetworkCallbackTest fail because the
original design is getting the active network in setUp(). So once
the wifi reconnects, the network which is got in setUp() will be
meaningless and make the test fail due to network mismatches.
The new changes are:
1. Moving some initial pre-configurations into setUp().
2. Override the onCapabilitiesChanged() to check if network has
changed to metered or not.
3. Add unregisterNetworkCallback() into iMyService.aidl so that
NetworkCallbackTest can call it to unregister the network
callback.
4. Enlarge the timeout of connecting network and receiving
callback to prevent network cannot reconnect in time or
callback cannot be received in a short time.
Bug: 153485744
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Change-Id: I1aa0e107cf6797b06dee4a15896c63321d822156
This is a partial revert of the change that removed the parole
(Icd7b6eff8777f9b53a10eca521b73988f58f2d84).
Bug: 151802309
Test: atest --rerun-until-failure 10 com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: I65f5ff20cdd342905e1afd1f4897017aa60682d3
This commit:
-Extend TunUtils for processing IKE packets
-Add IkeSessionBaseTest containing common functionality for all IkeSession tests
-Add end-to-end test for IKEv2 PSK verifying creating IKE SA, creating child SAs
and closing sessions
-Add basic tests for error scenarios
Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: Ie6c18591ffcc883abbf0484d9a59dfda61b33257
Merged-In: Ie6c18591ffcc883abbf0484d9a59dfda61b33257
Fixed the error message when the expected number of broadcasts is exceeded.
Bug: 147139427
Test: atest hostsidetests/net/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I7e69dca81abdb29a9eb7d110266edbe483e17a01
Merged-In: I7e69dca81abdb29a9eb7d110266edbe483e17a01
There is no guarantee that Wifi will automatically reconnect after
enabling, especially in cases where no internet access was detected on
the access point the last time it was connected.
Use WifiManager#reconnect to force wifi to reconnect to the access
point. The API is deprecated for general use, but system apps are
documented as exempted from the deprecation.
Bug: 152280218
Test: atest --rerun-until-failure 200 CtsNetTestCases:CaptivePortalTest
Merged-In: Ia7d83337ee0ffad9414031711cf7e937b14f968d
Change-Id: Ia7d83337ee0ffad9414031711cf7e937b14f968d
Check the apps cannot get the per uid stats of another uid by directly
calling the getUidStats binder interface call provided by
networkStatsService.
Bug: 129151407
Test: NetworkStatsBinderTest
Change-Id: Iabca53a8b37b259cf7e232d603676dbc9887084c
Add a test verifying that when the device has detected a captive portal,
or when the user is trying to login to a captive portal, the captive
portal network does not become the default network if another network
can provide internet access.
This follows R CDD requirements.
Test: atest CtsNetTestCases:android.net.cts.CaptivePortalTest
Bug: 152280218
Merged-In: I6a97ed26dba665efdc67abb2371e0fc30ede020c
Change-Id: I6a97ed26dba665efdc67abb2371e0fc30ede020c
This commit adds tests for building IkeSessionParams with PSK. It
also tests configuring SA lifetimes, retransmissions and PCSCF
server requests
Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: I16fdc1ff9a22acb82b376211e0f187c4ead4cae5
Merged-In: I16fdc1ff9a22acb82b376211e0f187c4ead4cae5
(cherry picked from commit c98c75308f)
Temporarily make copies. Eventually will statically include the
source files in CtsIkeTestCases
Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: I7dd5c8b849f0d987fa6d76bc5a0bc1a7eed49b0d
Merged-In: I7dd5c8b849f0d987fa6d76bc5a0bc1a7eed49b0d
(cherry picked from commit 52716ec0e6)
This class will be extended by both IkeSessionParamsTest and
IkeSessionTestBase
Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: I98979758a7a684219e35c02ded93224ea172d44f
Merged-In: I98979758a7a684219e35c02ded93224ea172d44f
(cherry picked from commit 50908b9266)
If cellular is the mobile network, tethering should select it as
upstream. If DUN is required, tethering should use DUN as its upstream.
Bug: 153614366
Bug: 150644305
Test: atest CtsTetheringTest
Change-Id: Ief9c745322e8705c0e50185e749a81c5a9d20743
Merged-In: Ief9c745322e8705c0e50185e749a81c5a9d20743
Test legacy tether/untether API behavior. tether() rely on downstream
setup ready for tethering. Currently the only user is bluetooth
tethering. For other tetherings, there is no guaranteed that calling
tether() can always switch given interface to tethered. Tethering
may callback with onError depend on the interface status. Caller
should use startTethering/stopTethering API instead of these
legacy APIs.
This change also change the precondition verification of startTethering.
If tethering interface got error last time, such interface would not
be reported as tetherable.
Bug: 150632712
Test: atest CtsTetheringTest
Change-Id: Ifb3a0618208ffd0ff224c60f377036bc22ba0565
Merged-In: Ifb3a0618208ffd0ff224c60f377036bc22ba0565
1. Test whether start tethering is gated by suitable permission.
2. Test stopAllTethering
Bug: 153613718
Test: atest CtsTetheringTest
Merged-In: I38702886ea355e1aec8eb8ac404fdd46a44582e3
Change-Id: I38702886ea355e1aec8eb8ac404fdd46a44582e3