The network permission tests perform a connectivity check before
running, which means that a SIM card is required to check for
mobile data. However, there is no SIM card token sharding defined
in the AndroidTest.xml to make sure that the SIM card is
available for testing. Therefore, add the definition to the
AndroidTest.xml file.
Bug: 295708437
Bug: 295611982
Test: m
Change-Id: I20201ea8c7272771fdc59752aa2aae22b14d1e34
Mark fixed this test in aosp/2709233
Bug: 295829521
Test: Dashboard will stop showing this failure
Change-Id: I439d4b65b2fc5981af924fb1f1155273bdd52e7a
These tests are no longer flaky.
Test: the dashboard shows no failure over the last 2 weeks
Bug: 292173706
Bug: 292174832
Change-Id: I2269596fd62328c54fff21238379d518d5bbd0cc
The testMobileDataPreferredUids was disabled from presubmit
because of flaky test. It's no longer flaky now, so add the test
back to presubmit.
Fix: 292174275
Test: atest android.net.cts.ConnectivityManagerTest\
#testMobileDataPreferredUids --iterations 1000
Change-Id: I191888069a00942aa4c82f62bd1d62b7fc70b4fa
...so they don't disconnect in the middle of the test
Test: strategically add a sleep to reproduce the failure
apply the patch, observe the test passing with the sleep
Bug: 293844884
Change-Id: I4388e151d886461ca44185639e292ccd9795c50e
There may be additional CapabilitiesChanged callbacks before
the test network is torn down. To verify ON_LOST, use
eventuallyExpect instead of expect.
Bug: 295829521
Test: atest ConnectivityManager#testSetOemNetworkPreferenceForTestOnlyPref
Change-Id: I24bb11bf2c2da08e5757c845beeb35b7004f25a4
Ikev2VpnTest uses TestNetworkRunnable to start test networks
to perform VPN related tests. In some low performance devices,
such as cuttlefish, the request to disconnect test network
at the end of the previous test may not be executed completely
yet. It results in the disconnect-pending network being used
by the follow-up test and fail the test. To fix this, the utility
method should wait for onLost callback before performing next
test.
Bug: 293239828
Test: atest CtsNetTestCases:android.net.cts.Ikev2VpnTest \
--rerun-until-failure 100
Change-Id: I6f3c4f45d3dbadc7e8783c05d6cf67f0896ffa95
This test is run by resolver MTS and it should pre-check device
connectivity before running. The reason why the test never or
seldom failed in the past is probably that it usually ran after
CtsNetTestCasesLatestSdk DnsResolverTest (which is also run by
resolver MTS) that already pre-checked the connectivity.
Bug: 291495329
Test: atest CtsNativeNetDnsTestCases
Change-Id: I20159029c7e68e9c21dcb6e7bbf221cda39117a5
Add end-to-end testing for conflicts happening during and after probing.
This includes making sure that interfaces have a usable IPv6 address
before starting each test, as mdnsresponder would not probe on the
interface if the address is not present, and would go straight to
advertising otherwise.
Bug: 266151066
Test: atest NsdManagerTest
Change-Id: Ie1a1e888afbcd5c1bafaf218a98ac4c2f5fe63ee
Fix flaky test by only catch relevant the AddOrUpdateEvent and
RemoveEvent.
Bug: 294685851
Test: atest CtsNetTestCases
Change-Id: Ia12e51a6527f1e23610fdb0bea1068ebb5b80a73
The NsdService will throw a NPE if a new client is registered
with a null INsdManagerCallback object. To avoid this, perform
a null check before registering a new client and throw an
IllegalArgumentException if the callback is null.
Bug: 293285797
Test: atest FrameworksNetTests
Change-Id: Id61e27873591031c3fe383879aee0d40eebc08b3
Fix kotlin nullable errors that were exposed by setting the retention
of android.annotation.NonNull and android.annotation.Nullable to
class retention.
Bug: 294110802
Test: builds
Change-Id: Id49e4a2ee0b7b463d99bce6eb22919b84c21443a
EthernetNetworkFactory does not track interfaces in server mode; use
EthernetTracker#getInterfaceState() instead.
Bug: 241070589
Test: atest EthernetManagerTest
Change-Id: Id68f2ae8b30dd5bacef09b828692a9692c6dba75
eventuallyExpect(CallbackEntry) was missing an assertNotNull, which
essentially made it a no-op.
Bug: 241070589
Test: atest EthernetManagerTest
Change-Id: I0ebf54bc9b7ae8a5de59f2bc302b06747174d4ea
Test main thread mocked settings object but use that on the handler
thread as well, which is not thread-safe.
Create a real object instead of mocking it instead.
Test: atest ConnectivityCoverageTests:android.net.connectivity.com.android.server.net.NetworkStatsServiceTest#testDataMigration_differentFromFallback \
--rerun-until-failure 500
Fix: 289705810
Change-Id: Ibfb722818467fdf2b69a4b8fa87b4ac04a713573
These tests were disabled from presubmit because of flaky test.
It's no longer flaky now, so add these tests back to presubmit.
Bug: 293233390
Test: atest FrameworksNetTests
Change-Id: I7f1f36385d2ca6ed210e1d9b7399b6509fd26519
When the device is very slow to run this test, cell might end
its lingering period in the middle of the test while wifi is
the default. VPN will then ignore it as an underlying network,
causing the test to fail.
Test: testVpnSetUnderlyingNetworks
Added sleep in a strategic place to make sure the problem
was correctly identified, and observed the test failing.
After the fix, the test passes with the sleep.
Fixes: 280627836
Fixes: 293844384
Change-Id: Iaf56de963eb17845c1d76a0310b55f7f9321f7e4
This test assumes the data saver mode is initially disabled, but WearOS enables the mode on boot. This change fixes the precondition in the setUp method.
Test: run cts -m CtsHostsideNetworkTests
Bug: 280542664
(cherry picked from https://android-review.googlesource.com/q/commit:2cdeffc7e97a915a847cfc40d89e091aeadf20b3)
Merged-In: Ibcceaf0f44821100c861ef7b3c61d0888ae30481
Change-Id: Ibcceaf0f44821100c861ef7b3c61d0888ae30481
Components that can provide offload like IpClient (packet
filter offloading) can use the API to register a callback to be notified
when offload is necessary.
Bug: 269240366
Test: atest CtsNetTestCases
Change-Id: I8080702f5b530001b88e79e504f4722ac01bc576