The last 19 runs have been green. This is already in presubmit in other
branches.
Note that mainline-presubmit is still not supported in some branches.
Bug: 158153057
Test: m
Merged-In: I9d7954503990902ae807d74de14f4a2874328072
Change-Id: I9d7954503990902ae807d74de14f4a2874328072
testRequestNetworkCallback_onUnavailable is flaky because
the test expects a connectivity broadcast to be sent for the
lost network. But after testSetAirplaneMode, the wifi network
is not yet default network so a broadcast is never sent but
only onUnavailable is triggered. Replace disconnectFromWifi
with ensureWifiDisconnected to skip checking the broadcast.
Bug: 162323152
Test: atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest\
--rerun-until-failure 20
Change-Id: I88f434798ec83539df9cc6a81446ca37a0081e3b
If DownloadManager doesn't have
CONNECTIVITY_USE_RESTRICTED_NETWORKS permission, it can't bind
socket to VPN when it is in VPN disallowed list but requested
downloading app is in VPN allowed list. Add a new CTS test to
verify that DownloadManager can do the download successfully via
VPN network.
Bug: 165774987
Test: atest HostsideVpnTests
Change-Id: Iba9e2f26ad325d0fdb34ab9a06faaaf9cb623166
testSetAirplaneMode verifies the result by checking if intent is
broadcasted or not. The working internet may sometimes remain
connected if the commands processed fast but sometimes don't.
It will leave uncertain network status to the follow-up tests
and cause flaky. This behavior specifically breaks
testRequestNetworkCallback_onUnavailable. As WiFi is not
enabled and still disconnecting, the behavior will confuse
test to not to disconnect WiFi. However, test may still get an
active WiFi network since the WiFi is not disconneted yet. Thus,
verify that working internet should disconnect and reconnect
expectedly if airplane mode is updated.
Bug: 162323152
Test: atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest\
--rerun-until-failure 20
Change-Id: Id126c43b1f009e7bbce18d75020f25347448b7fb
This CL updates the NetworkCapabilities used for getting a cellular
data network in ConnectivityDiagnosticsManagerTest to require
CAPABILITY_INTERNET.
Bug: 166732795
Test: atest CtsNetTestCases
Change-Id: Ia32ac00f949a2ee9319c80c25f294bfa834ad0f9
ConnectivityManagerTest expects a working internet before testing
but is not verified before each test. Add a working internet
check in setup to clearly test it.
Bug: 161370134
Test: atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Change-Id: I47073ebff19fcf59d5d2ac86b43f8d54e621a55a
The test actually does not need the ethernet interface to be the
only ethernet interface, as ethernet test interfaces now have
TRANSPORT_TEST|TRANSPORT_ETHERNET, which can be used to differentiate
them in the network request.
Bug: 162469293
Test: atest CtsNetTestCasesLatestSdk:NetworkValidationTest
Change-Id: I84cc8b6b9aaa764705d91ed298655d869c4388a6
Refactor out TestHttpServer to share it between CaptivePortalApiTest and
CaptivePortalTest, move it to frameworks/libs/net, and add a
NetworkValidationTestUtil class with utilities to set the test
validation URLs.
Test: atest CtsNetTestCasesLatestSdk:CaptivePortal[Api]Test
Bug: 160617623
Bug: 160656765
Change-Id: Icd7829e680b2dddd1ddaa3dc2d946c14c20b5a15
WifiInfo#getFrequency is tested in CTS since R, but because it is used
on Q devices in the NetworkStack, it should be covered by MTS.
Because wifi should be connected to run this test, CTS is the best place
to add a test.
Bug: 160006669
Test: atest NetworkStackDependenciesTest
Change-Id: I0040c2a163ef5e1a3b725d5aedc67259d01ca173
Whitelisting the app resets forced idle state of an app, so
forcing idle state again.
Bug: 161477606
Test: atest ./hostsidetests/net/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: Ib57202a68071cc02d6071e0dc2c4780f026ad90b
At the moment tests run on virtual devices through TEST_MAPPING do not
necessarily have wifi configured to auto-connect to a test SSID.
This could be fixed by adding a TargetPreparer in AndroidTest.xml with a
given SSID, but that configuration would then apply to all runs,
including local ones. There is also no good way to apply a preparer that
configures wifi "if it is not already connected": WifiPreparer in
particular will not configure wifi even if just a mobile network is
active.
Implement auto-configuration in CtsNetUtils#connectToWifi so that if no
network is configured, and a virtual SSID is detected when scanning,
that SSID will be added to the list of configured networks. This allows
addressing the issue until TEST_MAPPING can support configuring wifi,
with minimal side-effects on other runs.
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalTest
Bug: 158153057
Change-Id: I47df4c325b073f8a9bf320894245eed211606952
Add a test to verify the NETWORK_AIRPLANE_MODE permission
Bug: 145164696
Test: atest android.net.cts.ConnectivityManagerTest#testSetAirplaneMode
Change-Id: I45c024f444988ec0c43d60778a1d9c9fd3acbdb5