If tethering is not supported, skip testRequestLatestEntitlementResult
which test TetheringManager#requestLatestTetheringEntitlementResult
API.
Bug: 159869957
Test: atest CtsTetheringTest
Merged-In: I65c32d5bc26f18f8c9d91593ab0c178e69e75c39
Change-Id: I65c32d5bc26f18f8c9d91593ab0c178e69e75c39
This should have been longer to start with. This oversight is due
to a poor API in TestNetworkCallback that was made that way for
backwards compatibility ; b/157405399 tracks improving this API.
Test: this
Bug: 160660082
Original-Change: https://android-review.googlesource.com/1358064
Merged-In: If0587a2a91977427a2f679a502d838fbecdd82f2
Change-Id: If0587a2a91977427a2f679a502d838fbecdd82f2
This test (added in R) failed to take the adb-over-network
case into account like most other tests in the same file. As
such it erroneously fails when tested over such a test setup.
This patch exempts the shell from being subject to the VPN,
like other similar tests do, to avoid the adb connections
being killed.
Test: VpnTest
Bug: 159761399
Original-Change: https://android-review.googlesource.com/1349862
Merged-In: I0bc14d4d2cade7618c59b2cb88638bdf608d43d3
Change-Id: I0bc14d4d2cade7618c59b2cb88638bdf608d43d3
This change increases the delay allowed for administratorUid updates to
reach ConnectivityService in #testRegisterCallbackWithCarrierPrivileges.
Currently, there is no deterministic signal that can be used to wait for
this change, so Thread#sleep is required. This value is increased
because the previous delay did not give enough time for the
administratorUid change to reach CS, causing test flake.
Bug: 159718782
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Original-Change: https://android-review.googlesource.com/1349068
Merged-In: I36347f6d52e3ce1bd30e3f74c35f4ecd15c8c65e
Change-Id: I36347f6d52e3ce1bd30e3f74c35f4ecd15c8c65e
Skip testRegisterCallbackWithCarrierPrivileges and
testContinuousQueriesInline for presubmit, as they are highly flaky.
These tests are still run in postsubmit as part of MTS. In order to put
the CTS suite in presubmit as early as possible, add the annotation so
they are skipped in TEST_MAPPING.
Bug: 158153057
Bug: 159718782
Bug: 159762682
Test: m
Change-Id: I4763db869fbc714767ea5ca3651e4a0b0c9e9378
This change fixes several things in ConnectivityDiagnosticsManagerTest:
- testOnConnectivityReportAvailable creates the Test Network after
registering the ConnectivityDiagnosticsCallback. This ensures that the
callback is invoked only after the network is validated (not for the
on-register behavior).
- The TestNetworkInterface created while setting up the Test Network is
held onto for the duration of each test. This ensures that the interface
is not garbage collected during the test. While the interface is not
needed for the test, this change makes it clear when the interface is
cleaned up.
- All registered ConnectivityDiagnosticsCallbacks are unregistered at
the end of each test. This ensures that all accompanying NetworkRequests
are cleaned up. If NetworkRequests are leaked, unrelated test failures
can occur (the platform limits the number of NetworkRequests per UID).
Bug: 156294356
Bug: 148032944
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: I1836536fe60a65ba33170cd80e8f4996f1965d19
In order to avoid class package missing problem, add
net-utils-framework-common in cts net test build. Also jarjar
the package name to prevent conflict.
Test: build
Test: atest DnsResolverTest
Bug: 150952393
Change-Id: I40e2d4c4945a0579f6e1923e4722b09354ff050c
This change adds a CTS test for ConnectivityDiagnostics using
CarrierPrivilegesTracker to receive permissions for
ConnectivityDiagnostics callbacks.
Specifically, the test provides CarrierPrivileges to the test package
(android.net.cts) for the active subscription via Carrier Configs
overrides. CarrierPrivilegesTracker listens to the Carrier Configs
change and matches the loaded certificate with the test package, then
includes the test package UID as an administrator for the Network in
ConnectivityService. Then, a ConnectivityDiagnosticsCallback is
registered and receives a ConnectivityReport on register for the active
subscription.
Bug: 148032944
Bug: 151332031
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: Iee8a428ada0b6e2127410267a13c3b688df83e6d
Merged-In: Iee8a428ada0b6e2127410267a13c3b688df83e6d
This CL restricts ConnectivityDiagnosticsManagerTest to only being run
as @AppModeFull. This is required, as Instant Apps are not allowed
CHANGE_NETWORK_STATE (required for CM#requestNetwork) or
MANAGE_TEST_NETWORKS (required for TestNetworkManager#setupTestNetwork)
permissions - both of which are required for
ConnectivityDiagnosticsManagerTest.
Bug: 158431112
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: Id867b8dcaca758cfeb83009848e1099e900a0790
The package name needs to be updated as
the class is moved into com.android.net.module.util.
Bug: 149403767
Test: atest DnsResolverTest
Change-Id: I908cb5f7bc6150e461748c8e34c92a19aa0206e4
Instead of reconnecting without disabling/re-enabling wifi in
CaptivePortalTest, actually do the toggle during the test and
on teardown to ensure that the BSSID blacklist is cleared.
CaptivePortalTest intentionally makes the network not validate, which
causes it to be added to the BSSID blacklist. Toggling wifi is necessary
to make sure the test does not affect other tests.
Also check development SDK instead of the exact SDK_INT number so that
the test can pass on current AOSP builds.
Bug: 158924461
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalTest \
CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Original-Change: https://android-review.googlesource.com/1336114
Merged-In: I31f9f4a9678e11042005c29535af840246358764
Change-Id: I31f9f4a9678e11042005c29535af840246358764
This change adds assertions to ensure that the owner UIDs of IKEv2 VPNs
are correctly set.
Bug: 150135470
Test: This
Merged-In: Iabf2859c289aa86ec38aea1edcc1fb248b9d0d26
Change-Id: Iabf2859c289aa86ec38aea1edcc1fb248b9d0d26
(cherry picked from commit 30234827aa24716062a23f28b1effc59e9ef46de)
Normally stop wifi tethering flow would be:
Tethering#stopTethering -> WifiManager#stopSoftAp -> softAp disabled,
then have WIIF_AP_STATE_CHANGED intent -> stop IpServer and broadcast
TETHER_STATE_CHANGED intent. SoftAp is disabled before tethering stop.
Because tethering would shutdown the corresponding IpServer if it
observed the interface is removed. For those devices that softAp
interface would be removed when stop tethering, the flow may be
Tethering#stopTethering -> WifiManager#stopSoftAp -> softAp disabing,
softAp interface is removed -> tethering trigger stop IpServer and
broadcast TETHER_STATE_CHANGED intent -> -> softAp disabled, then wifi
broadcast WIIF_AP_STATE_CHANGED intent. In this case, tethering is
stopped ready before softap is disabled.
For this case, CtsTeteringTest would have race between two test cases.
If two case need to start wifi tethering for testing and stop wifi
tethering after finish testing.
The second test may suffer from startTethering fail problem due to
softAP is not disabled yet.
E WifiService: Tethering is already active.
Bug: 157806780
Test: atest CtsTetheringTest
Original-Change: https://android-review.googlesource.com/1331096
Merged-In: I0ba6bc9dcbf7829dcad5561c707d5f5c5540f10b
Change-Id: I0ba6bc9dcbf7829dcad5561c707d5f5c5540f10b
This is not necessary for the tests to be able to use APIs
introduced in R because they can already access hidden APIs.
But it is important to ensure that they are subject to whatever
new system behaviour is applied to SDK 30 apps.
Fix: 158839774
Test: treehugger
Test: atest CtsNetTestCasesLatestSdk has no new failures
Change-Id: Ic86fe84b28b5becc722903650f00e9ca7d6e5f3f
The classes should not be picked up from frameworks/base, as they are
part of several mainline modules.
Bug: 151052811
Test: m; manual: flashed, wifi and telephony working
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalApiTest
Change-Id: Ic7534afe3a437f2089ed33cebdad391dc498d187
CtsNetUtils#storePrivateDnsSetting might require WRITE_SECURE_SETTINGS
permission to run.
Therefore, move it from setUp to only belong to the required test case.
Bug: 158538281
Test: run cts --include-filter "arm64-v8a CtsNetTestCases[instant]
android.net.cts.MultinetworkApiTest"
Merged-In: I8ecadd134824a4023a3c6e173d52ba088d46b103
Change-Id: Ic8fa1421b1092efdb011a124836d9f466a231f43
(cherry picked from commit 9451fdf5031d2de02ac9011696b56760ea4943a0)
Three tests failed when they try to set up IKE Session with a
tunnel mode Child SA and the device does not have ipsec tunnel
feature. This commit changed these tests to set up IKE Session
with a transport mode SA because 1) the logic these tests are
verifying is unrelated to the Child SA type and 2) using
transport mode make sure these tests run on all the devices.
Bug: 158268209
Test: CtsIkeTestCases, verified on taimen
Change-Id: I9a8c7f631f0e6e02492816e3fbf0d751017dc2b3
Merged-In: I9a8c7f631f0e6e02492816e3fbf0d751017dc2b3
(cherry picked from commit 0224324097f36106dfb7eccad3325024403e0381)
The vpn status of cts app is updated to be consented in this
tests which will impact the following test related to vpn.
Thus, reset the status after finishing the test.
Bug: 153760253
Test: atest CtsNetTestCasesLatestSdk
Merged-In: I4856cfc7ddfd70125c513a4201132256704d1a66
Change-Id: I4856cfc7ddfd70125c513a4201132256704d1a66
Sometimes the device may take a long time to connect to the wifi,
try to enlarge the timeout to lower the fail rate of test.
Bug: 157391946
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Original-Change: https://android-review.googlesource.com/1324092
Merged-In: Ie89936ecc2d70ee22dd312067ccedd2523e81855
Change-Id: Ie89936ecc2d70ee22dd312067ccedd2523e81855
Also exclude some tests that cannot run on cuttlefish.
This is a first step to add the suite to presubmit. Having the test in
presubmit is essential to avoid regressions and keep it passing.
Bug: 158153057
Test: m CtsNetTestCases; this patch will provide postsubmit results
Original-Change: https://android-review.googlesource.com/1322430
Merged-In: I48b2b5490d3fd5eb6f9456825c11f3fee0ec5b67
Change-Id: I48b2b5490d3fd5eb6f9456825c11f3fee0ec5b67
connectToWifi needs to clear the wifi networks blacklist before calling
reconnect(), otherwise wifi may not reconnect if the previous network
was blacklisted.
disconnectFromWifi should not wait for a onLost callback if wifi was
already disconnected.
Test: atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Test: atest CtsNetApi23TestCases
Bug: 150949391
Original-Change: https://android-review.googlesource.com/1322428
Merged-In: I244b91bdd8708694fce9f10d92b8b6646d28188f
Change-Id: I244b91bdd8708694fce9f10d92b8b6646d28188f
While local runs pass, kotlin-reflect.jar is not found on the test
infrastructure. Depending on that library does not make the test much
more simple.
Bug: 156062304
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalApiTest
Original-Change: https://android-review.googlesource.com/1322415
Merged-In: I6691a07ef8d6c63e68cb78813a5e3e499ef897df
Change-Id: I6691a07ef8d6c63e68cb78813a5e3e499ef897df
The Ikev2 VPN feature was introduced in R.
Bug: 150904735
Test: atest CtsNetTestCasesLatestSdk:Ikev2VpnTest
Original-Change: https://android-review.googlesource.com/1322414
Merged-In: I51ded6e967291c110ff0bbd18a3631ab9a742e74
Change-Id: I51ded6e967291c110ff0bbd18a3631ab9a742e74
If run tethering cts with entitlement required SIM, the test would
failure due to no tethering upstream. Tethering would default start
with UI base entitlement check which would have interfactive UI pop
up. Tethering's upstream is blocked because entitlement UI is keep
waiting for action till timeout.
To avoid UI interaction, start tethering with silent entitlement
check.
Bug: 156714671
Test: atest CtsTetheringTest
Merged-In: I85299841d60afba97ffcc4ae908a85e51139319b
Change-Id: I85299841d60afba97ffcc4ae908a85e51139319b
* changes:
Add IPv6 testing for IKEv2 VPN tests
Add Ikev2VpnTests including IKE negotiation.
Add basic tests for IKEv2/IPsec VPNs
Extract IPsec and test network utility methods
This commit expands IKEv2 VPN CTS testing to ensure that given a
successful IKEv2 negotiation, the VPN network will be correctly set up.
Additionally, it verifies that the stopProvisionedVpnProfile will
teardown the VPN network.
Bug: 148582947
Test: atest CtsNetTestCases:Ikev2VpnTest
Change-Id: Ib6635f0068200ac0172515989fbdee5c3d49e231
Merged-In: Ib6635f0068200ac0172515989fbdee5c3d49e231
(cherry picked from commit 0ef85ff5a391fe81fb7d06959566d869f805f8b5)
This change adds basic tests for all IKEv2/IPsec VPN public APIs.
Additional testing for ensuring IKEv2 setup completes will be done in a
subsequent CL.
Bug: 148582947
Test: Ikev2VpnTest added
Change-Id: Ia5d35c32525b32be4a0dc0584630f5bb9e7f1bcb
Merged-In: Ia5d35c32525b32be4a0dc0584630f5bb9e7f1bcb
(cherry picked from commit 12f571feaea736de875aebef8ad0cc70630ad6ab)
This patch moves some test setup functions to util classes in
preparation for IKEv2 VPN tests which will use those same utilities.
Bug: 148582947
Test: atest IpSecManagerTunnelTest; passing
Change-Id: I9aeafa45ab515ce72a72c3de6f70fb26e32e7fd4
Merged-In: I9aeafa45ab515ce72a72c3de6f70fb26e32e7fd4
(cherry picked from commit 30432fa7640603c1e746b7d8c83e2e6052d8f967)
This CL adds a CTS test for Data Stall events to
ConnectivityDiagnostics. This makes sure that new DataStall detection
methods are passed to ConnectivityDiagnostics callbacks with the
appropriate detection method bit mask.
Bug: 156294356
Bug: 148032944
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: Id6f1bff59b08192f09ebcc4578a3c233fd1c2768
Merged-In: Id6f1bff59b08192f09ebcc4578a3c233fd1c2768
(cherry picked from commit 03278ff4593ba697acc97097d458d752f33228b3)
Verify that onDataStallSuspected() is invoked by the System when
expected.
ConnectivityDiagnosticsManager provides an API for registering callbacks
with the System. These callbacks allow the System to notify registered
and permissioned callbacks on Network validation, suspected data stalls,
and Network connectivity reported.
Bug: 148032944
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: If6ceae9d2bbcabf88298d2d8c39cad5275fbd1ef
Merged-In: If6ceae9d2bbcabf88298d2d8c39cad5275fbd1ef
(cherry picked from commit dfcee1ac4a2843884034623601deb78b1a2d84df)
Verify that the callbacks onConnectivityReport() and
onNetworkConnectivityReported() are invoked by the System when expected.
ConnectivityDiagnosticsManager provides an API for registering callbacks
with the System. These callbacks allow the System to notify registered
and permissioned callbacks on Network validation, suspected data stalls,
and Network connectivity reported.
Bug: 148032944
Test: android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: I748229d41c16adf1561e03aa597d5aac00f12912
Merged-In: I748229d41c16adf1561e03aa597d5aac00f12912
(cherry picked from commit fa23ec3b252c33e4cdc3e1463d77ba279d7da144)
The test relies on EthernetManager#setIncludeTestInterfaces to run
validation on an "ethernet" network based on a tap interface, and
simulates DHCP and HTTP servers so the device sees the capport DHCP
option, and fetches the API contents.
Bug: 156062304
Test: atest CaptivePortalApiTest
(clean cherry-pick from aosp)
Merged-In: I734dbd05c0f50b8dc4553102ab286f0d8807a7ac
Change-Id: I734dbd05c0f50b8dc4553102ab286f0d8807a7ac
- Test receiving Authentication Failure notification
- Test setting up IKE Session with first Child setup failure
Bug: 155821007
Test: CtsIkeTestCases
Change-Id: I4ec43a3899d67a119cd4ba19e0ffc63c277325fb
Merged-In: I4ec43a3899d67a119cd4ba19e0ffc63c277325fb
(cherry picked from commit b765ebe3f26e61093dbe9ac0df1845afc5d42d3d)
This commit:
- Adds test for remotely initiated rekey for IKE and Child SA
- Makes IkeTunUtils support building and injecting requests
- Adds method to parse hex to long because Long.parseLong cannot
handle negative long value
Bug: 155821007
Test: atest CtsIkeTestCases
Change-Id: I299cf190261ac15397f9ed389adb2c69e94a6507
Merged-In: I299cf190261ac15397f9ed389adb2c69e94a6507
(cherry picked from commit a5bff5a7b46c31dfa4ae692328edfb2b2a6462c8)