Commit Graph

5433 Commits

Author SHA1 Message Date
markchien
2888ab7bc7 Migrate Tethering util functions to CtsTetheringUtils
Bug: 166057846
Bug: 170265597
Test: atest MtsTetheringTest
      atest CtsTetheringTest
Change-Id: I59d529cb50b4b6cdafc6be78ad61a55ee1be0404
2020-10-16 17:11:20 +08:00
Yan Yan
d8f0f4a3c7 Merge "Migrate IPsec CTS out of tests/tests/net" 2020-10-15 17:30:49 +00:00
Yan Yan
b4d5a4b66f Migrate IPsec CTS out of tests/tests/net
Bug: 170487836
Test: atest CtsIkeTestCases
Change-Id: I08f069c2a11f3daa3f0332c631055a1e0be7ce7b
2020-10-14 10:58:37 -07:00
Treehugger Robot
b54ca7b0c3 Merge "Do not expect broadcasts in CaptivePortalTest" 2020-10-14 11:57:25 +00:00
Sudheer Shanka
468293beef Merge "Verify network state of apps hosting fg-service and in idle state." 2020-10-12 23:31:17 +00:00
xiamengsen
05c8a1ddd0 Verify network state of apps hosting fg-service and in idle state.
Test: atest hostsidetests/net/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java

Signed-off-by: xiamengsen <xiamengsen@xiaomi.com>
Change-Id: I0e6e40b714483e51cfee45c155d8ac8b2b356494
2020-10-12 18:42:00 +00:00
Treehugger Robot
1dd1530647 Merge "Update the QUIC packet format." 2020-10-12 11:40:54 +00:00
Remi NGUYEN VAN
48ea3b6816 Do not expect broadcasts in CaptivePortalTest
The legacy broadcast may not be sent if wifi does not become the default
network within timeout. CaptivePortalTest does not need wifi to be the
default network at the start of the test, as it will be
disconnected/reconnected immediately after anyway.

Bug: 169106352
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalTest
Change-Id: Ie4ee6b3c3ed7c0d414fd3cc162d4183248120895
2020-10-12 17:36:19 +09:00
Remi NGUYEN VAN
1bc58efade Merge "Use new test utilities from frameworks/libs/net" 2020-10-12 02:00:55 +00:00
Chalard Jean
43370c622d Merge "Fix a way for this test to flake." 2020-10-09 04:29:17 +00:00
Remi NGUYEN VAN
ae04a86b0b Use new test utilities from frameworks/libs/net
Use runAsShell from the new TestPermissionUtils, and rename popPacket to
poll.

This rolls forward the previous change as-is. See change
I34bad7ec79ef0fd03e5e40b643f0d85d686c53ec for details on why the
previous change was reverted.

Bug: 168868607
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I7b5176e84ffe08cc5ea1251f66cdcb9b7066ec0a
2020-10-09 02:54:33 +00:00
Remi NGUYEN VAN
dcc8bf6706 Merge "Revert "Use new test utilities from frameworks/libs/net"" 2020-10-09 01:48:20 +00:00
Remi NGUYEN VAN
0d4dee1c1a Revert "Use new test utilities from frameworks/libs/net"
Revert submission 1440811-iputils_constants_move

Reason for revert: Likely broke build in b/170438226
Reverted Changes:
Ic382d24e7:Move NetworkStackConstants to frameworks/libs/net
I0d938e296:Use new test utilities from frameworks/libs/net

Change-Id: Iec4709778ba1b30687df265a2a5c694c536b5456
2020-10-09 01:38:44 +00:00
Remi NGUYEN VAN
2087f3eeb1 Merge "Use new test utilities from frameworks/libs/net" 2020-10-09 00:14:15 +00:00
Treehugger Robot
c2339c4fb7 Merge "Remove vts10 suite setting" 2020-10-08 17:46:42 +00:00
Lorenzo Colitti
06aad059fb Update the QUIC packet format.
The QUIC packet format has changed again. Update the test to
ensure that the GFE can drop support for the old packet format
without causing all devices to fail CTS.

Packet format changes suggested by dschinazi@.

Test: atest --rerun-until-failure 100 CtsNetTestCasesLatestSdk:MultinetworkApiTest#testNativeDatagramTransmission
Change-Id: I8625ac9a58c55fc19dfb9fdb5f34a89cee40caaf
2020-10-08 16:28:33 +09:00
Dan Shi
d65405de4b Remove vts10 suite setting
Bug: 169583551
Test: build
Change-Id: I42d38bd2f9e8b1e932571a38c2ebe72861d18fca

Exempt-From-Owner-Approval: This CL remove vts10 from test_suites setting.
Change-Id: I42d38bd2f9e8b1e932571a38c2ebe72861d18fca
2020-10-07 02:31:26 +00:00
Remi NGUYEN VAN
ddb629663b Merge "Add a test for getCaptivePortalServerUrl" 2020-10-07 00:53:06 +00:00
Chiachang Wang
d074c9ea58 Merge "Don't wait for unnecessary disconnect broadcast" 2020-10-07 00:50:36 +00:00
Treehugger Robot
7ba787cc83 Merge "Move CtsNetTestCasesLatestSdk to presubmit" 2020-10-06 14:12:49 +00:00
Chiachang Wang
b40f760f8d Don't wait for unnecessary disconnect broadcast
testTetheringUpstream does not require WIFI to be default
network since the test disconnects WIFI and verifies that
tethering use cellular network to be its upstream. Test only
needs to ensure WIFI is disconnected so the broadcast is not
necessary. Change to alternative method that does not wait for
disconnect broadcast to prevent flaky caused by unvalidated
wifi network.

Bug: 168217651
Test: atest TetheringManagerTest
Change-Id: If74fcad192cb4d4947ac2c99cd9ea2d3971d2cac
2020-10-05 14:11:43 +08:00
Remi NGUYEN VAN
8b8e27df06 Use new test utilities from frameworks/libs/net
Use runAsShell from the new TestPermissionUtils, and rename popPacket to
poll.

Bug: 168868607
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I0d938e2967f3adc324dd2bc81138b4b2910af5f8
2020-10-05 14:32:57 +09:00
Remi NGUYEN VAN
a1b195ee3f Add a test for getCaptivePortalServerUrl
The API returns a URL that can be used to test the presence of a captive
portal.
The only requirements are that the URL is valid, and HTTP (as per
javadoc).

Bug: 168755498
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I9a92b422a7df2379fadab79ed49b77e7c2fcc393
2020-10-05 13:02:21 +09:00
Remi NGUYEN VAN
a773ccbe97 Move CtsNetTestCasesLatestSdk to presubmit
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
2020-10-05 10:34:35 +09:00
Treehugger Robot
accaf62b80 Merge "Skip unsupported hardware for testB141603906" 2020-10-02 02:53:35 +00:00
Chalard Jean
4613c7e02a Fix a way for this test to flake.
While tests are hopefully cleaning up after themselves,
there is no guarantee that there is a currently available
default network milliseconds after any given test. Some
tests need to disconnect to check something, or to change
a property of the wifi network that they have to revert at
the end for example. Or, a test may fail leaving the device
without a default network.

To make sure the state is correctly cleaned up, have
tearDown make sure the device is connected to a working
Internet connection before the test ends, so that the next
test can be sure to find established connectivity
immediately. It's possible the device needs a few hundred
milliseconds to re-establish connectivity, so this patch
gives a grace of up to 30 seconds (the default waiting
timer for TestCallback) for connectivity to be restored at
the end of any test.

Bug: 161767594 and others
Test: ConnectivityManagerTest
Change-Id: I8cf3e6e6c116cabd5b04bf2562da84f7e635ca2a
2020-09-29 10:03:01 +00:00
Chiachang Wang
4ffaa483a7 Merge "Don't check broadcast intent on connection status check" 2020-09-24 10:07:56 +00:00
Chiachang Wang
8ff9c262ca Don't check broadcast intent on connection status check
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
2020-09-24 09:38:53 +00:00
paulhu
01f9b00e88 Add CTS to verify DownloadManager permission
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
2020-09-24 10:47:19 +08:00
Bill Yi
a0ad1c6b11 Merge "Merge mainline-release 6664920 to master - DO NOT MERGE" 2020-09-18 18:47:56 +00:00
Bill Yi
27c07910ff Merge mainline-release 6664920 to master - DO NOT MERGE
Merged-In: I583836eeeaf604391ed9b1196d4b41e872dc635d
Change-Id: Ifd90a94f57f27c2477c0bc52efaea91870080501
2020-09-17 21:56:56 -07:00
Chiachang Wang
17ee20dc59 Deflake test to ensure airplane mode switches work as expected
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
2020-09-18 10:51:11 +08:00
Josh Yang
ae3412405d Skip unsupported hardware for testB141603906
Bug: 168748249
Fix: 168748249
Test: local cts passed.
Change-Id: I8af0d5f9716a510322b2bfb0cdf6f05f94b12604
2020-09-17 00:27:59 +00:00
Xin Li
1684245304 Mark RP1A.200720.001 as merged
Bug: 167588565
Merged-In: I787906cd0776c1a335b44755b6c162df29de173c
Change-Id: Ie267fa877d7e455352cc505dc7aba0d5b531a9a3
2020-09-02 11:44:50 -07:00
Xin Li
77065af37d Merge "Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)" into stage-aosp-master 2020-09-01 20:03:43 +00:00
Treehugger Robot
b974f51473 Merge "Don't require WiFi in CtsHostsideNetworkTests." 2020-09-01 09:15:35 +00:00
Treehugger Robot
74bfd2d74c Merge "Specify CAPABILITY_INTERNET for ConnDiags CTS test." 2020-09-01 06:11:22 +00:00
Tse Ho Lin
243c42a9b9 Don't require WiFi in CtsHostsideNetworkTests.
Skip test for non-WiFi connections.

Bug: 162192335
Test: run cts -m CtsHostsideNetworkTests -t com.android.cts.net.HostsideNetworkCallbackTests#testOnBlockedStatusChanged_dataSaver
Change-Id: I7c20e3454a2fe81671162e0a50f90d64ed7516d0
2020-09-01 05:20:44 +00:00
Cody Kesting
cb00911ada Specify CAPABILITY_INTERNET for ConnDiags CTS test.
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
2020-08-31 11:00:26 -07:00
Xin Li
9d04ab0a42 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Id9ba142af9d2da12bda66d0c376d4b8c13f1503b
Change-Id: I1a1bdaabd06f43b695ac94172a6f46d00b7f5b84
2020-08-29 01:22:07 -07:00
Treehugger Robot
d863e35484 Merge "Add working internet precondition check" 2020-08-27 11:12:35 +00:00
Chiachang Wang
48d952a502 Add working internet precondition check
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
2020-08-27 17:58:48 +08:00
Treehugger Robot
5e759307ff Merge "Run validation tests even with an eth interface" am: 856ad3bc23
Original change: https://android-review.googlesource.com/c/platform/cts/+/1400131

Change-Id: I9c072749777457d4930535cde79d994f6717f48f
2020-08-24 10:51:39 +00:00
Remi NGUYEN VAN
fe093f509b Merge "Add utilities for network validation testing" am: ff15197c34
Original change: https://android-review.googlesource.com/c/platform/cts/+/1364518

Change-Id: Ia6f360509892910706d5f92aa98a9243feb9fd98
2020-08-24 07:41:30 +00:00
Remi NGUYEN VAN
c47fa617f2 Run validation tests even with an eth interface
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
2020-08-21 19:17:09 +09:00
Remi NGUYEN VAN
0e9b130cbc Add utilities for network validation testing
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
2020-08-21 19:17:03 +09:00
Treehugger Robot
2d1446b55a Merge "Add a dependency test for getFrequency" am: 7b965d116d
Original change: https://android-review.googlesource.com/c/platform/cts/+/1398411

Change-Id: Icf8f6f4c61fb435137649ccf3f4bd91224707ea7
2020-08-14 04:21:49 +00:00
Treehugger Robot
7b965d116d Merge "Add a dependency test for getFrequency" 2020-08-14 04:02:54 +00:00
Remi NGUYEN VAN
1cf2445443 Add a dependency test for getFrequency
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
2020-08-13 15:19:27 +09:00
Chalard Jean
f0adb99511 Merge "Rename Kotlin util files to not include the Kt suffix" am: a42b415dc9
Original change: https://android-review.googlesource.com/c/platform/cts/+/1353402

Change-Id: Ib895f34ce8580dbd8daf941243a1a3724bb10582
2020-08-13 04:09:27 +00:00