Commit Graph

4534 Commits

Author SHA1 Message Date
android-build-team Robot
317e6eeb3e Snap for 6596975 from c368711fcce3857dd473f85243377b7ad27a6dbc to rvc-release
Change-Id: If69c4db63e42d4f17b1d38bd4fb8b27fad42ee73
2020-06-17 01:07:50 +00:00
TreeHugger Robot
3cc6da3e61 Merge "Toggle wifi when running CaptivePortalTest" into rvc-dev 2020-06-16 09:09:17 +00:00
Treehugger Robot
ec38685a7f Toggle wifi when running CaptivePortalTest
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
2020-06-16 16:53:25 +09:00
android-build-team Robot
e52ad06ca2 Snap for 6592941 from 61724720b0a3ab468d1a399b2023338b527a9c05 to rvc-release
Change-Id: Ia86338596cf610e4b11638610f26fae30c9661ee
2020-06-16 01:03:41 +00:00
Yan Yan
91e4a69abe Merge "Fix tests that failed on devices without IPsec tunnel feature" into rvc-dev 2020-06-15 17:03:23 +00:00
Treehugger Robot
3abe36567c Fix CtsTetheringTest on devices without permanent softAp interfaces.
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
2020-06-15 11:30:50 +00:00
Lorenzo Colitti
53430127ec Bump CtsNetTestCasesLatestSdk to target SDK 30.
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
2020-06-15 11:24:02 +00:00
android-build-team Robot
85b0be9be3 Snap for 6582636 from 70ba9ad724dad32a5ce5aa991e5e147f14206c43 to rvc-release
Change-Id: Ie428c18695969f7c852d2f050d05282dcd390d3f
2020-06-12 01:13:20 +00:00
Treehugger Robot
791d142a98 Fix MultinetworkApiTest fail problem in instant mode
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)
2020-06-11 02:37:41 +00:00
android-build-team Robot
c134c605b5 Snap for 6578268 from 2c8ba6485c722f648f3a789dd661b0ccfb5ec396 to rvc-release
Change-Id: Icb463387e89edeed1f46152273f8422e37ab6bfa
2020-06-11 01:13:21 +00:00
TreeHugger Robot
c63627c23c Merge "Enlarge the onAvailable callback timeout to 30 seconds" into rvc-dev 2020-06-10 15:21:05 +00:00
android-build-team Robot
1e44184901 Snap for 6573866 from 2a3e73df0397a66a77ac1310c5df5754eb71b46e to rvc-release
Change-Id: I5d47b197b468a2705fd0497bd2cbd614096f0733
2020-06-10 01:08:45 +00:00
Treehugger Robot
dfd08cab51 Fix tests that failed on devices without IPsec tunnel feature
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)
2020-06-09 20:39:48 +00:00
Treehugger Robot
c5bad6f58c Reset vpn provision status
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
2020-06-09 05:40:49 +00:00
Lucas Lin
bac55b7eeb Enlarge the onAvailable callback timeout to 30 seconds
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
2020-06-08 03:54:48 +00:00
android-build-team Robot
511c7265f6 Snap for 6565919 from dd6e7fffce37867dba429b4884e2d30273d1657e to rvc-release
Change-Id: Ie9155c286eb16cb3b5b7e11d36c45ec4a471efb3
2020-06-06 23:06:50 +00:00
Treehugger Robot
f0a78c385d Add CtsNetTestCasesLatestSdk to postsubmit
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
2020-06-05 06:54:18 +00:00
android-build-team Robot
91e09accad Snap for 6560464 from 43d5ac236efca54b67d685344b9b0a55c906f954 to rvc-release
Change-Id: Iaab682d5ad7a4c17ff59052350f973bbc236f036
2020-06-05 01:09:11 +00:00
Treehugger Robot
d1c80d7e20 Fix CtsNetUtils connectTo/disconnectFromWifi
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
2020-06-04 03:08:34 +00:00
android-build-team Robot
3fd98cb0c8 Snap for 6557338 from e196cfd8b907ae00e62d6205743d2e3b2a2da463 to rvc-release
Change-Id: Iec065729034dbf0e8f1ff0dd285703296b37a0b5
2020-06-04 01:05:04 +00:00
TreeHugger Robot
b4c27a20b3 Merge "Skip Ikev2VpnTest on Q" into rvc-dev 2020-06-03 03:34:31 +00:00
Treehugger Robot
6566ca3d0a Remove dependency on kotlin-reflect
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
2020-06-03 02:07:21 +00:00
Remi NGUYEN VAN
2bc22844e8 Skip Ikev2VpnTest on Q
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
2020-06-03 02:06:59 +00:00
android-build-team Robot
96ea8c8de1 Snap for 6553159 from 87995bdfc043ad0259012a74109b0dfb425b5b4b to rvc-release
Change-Id: I3b29be68862a7c7b1d4e21cf56e0a8c620420872
2020-06-03 01:03:39 +00:00
Treehugger Robot
caee6ff9cb Fix TetheringManagerTest failure when using entitlement required SIM
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
2020-06-02 04:04:55 +00:00
android-build-team Robot
52928888bb Snap for 6544675 from 89373f4c36c2d1dea14065af4c71f0f0f2bfce3a to rvc-release
Change-Id: I71cdd57ee4107019fca68c00cbaee78441335d2c
2020-05-30 23:08:59 +00:00
Benedict Wong
477e59f84a Merge changes Ic0f71df7,Ib6635f00,Ia5d35c32,I9aeafa45 into rvc-dev
* 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
2020-05-30 09:48:32 +00:00
Cody Kesting
01f7568231 Merge "Test Data Stall with unknown detection type." into rvc-dev 2020-05-30 05:35:42 +00:00
Cody Kesting
9ce134cf40 Merge "Add CTS testing for ConnectivityDiagnostics Data Stall callback." into rvc-dev 2020-05-30 05:35:16 +00:00
Cody Kesting
ed86e4622d Merge "Add CTS tests for ConnectivityDiagnostics callbacks." into rvc-dev 2020-05-30 05:35:05 +00:00
android-build-team Robot
823b7cadee Snap for 6542686 from 50c6093b008cbb42c6b79a8b49857327d4ff4289 to rvc-release
Change-Id: I82c3833e6852637429ca9e809aebcef0067e3130
2020-05-30 01:01:26 +00:00
Benedict Wong
1f0bdd40bd Add IPv6 testing for IKEv2 VPN tests
This change adds tests for IPv6 IKEv2 VPN profiles.

Bug: 148582947
Test: IPv6 tests passing
Change-Id: Ic0f71df739bd9162653b5f2878e7ddc446ddde0e
Merged-In: Ic0f71df739bd9162653b5f2878e7ddc446ddde0e
(cherry picked from commit e19a04da9d2ff0993af8884888bb4a327c546098)
2020-05-29 12:00:46 -07:00
Benedict Wong
a68fbd80f6 Add Ikev2VpnTests including IKE negotiation.
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)
2020-05-29 12:00:36 -07:00
Benedict Wong
bfc3ee8559 Add basic tests for IKEv2/IPsec VPNs
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)
2020-05-29 12:00:25 -07:00
Benedict Wong
fec419cdd6 Extract IPsec and test network utility methods
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)
2020-05-29 12:00:14 -07:00
Cody Kesting
6609fbbfe1 Test Data Stall with unknown detection type.
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)
2020-05-29 11:32:12 -07:00
Cody Kesting
a4107118ff Add CTS testing for ConnectivityDiagnostics Data Stall callback.
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)
2020-05-29 11:28:46 -07:00
Cody Kesting
caf797ef34 Add CTS tests for ConnectivityDiagnostics callbacks.
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)
2020-05-29 11:28:07 -07:00
Remi NGUYEN VAN
1a3aa4dd6c Merge "Add CTS test for the capport API" into rvc-dev 2020-05-29 11:26:06 +00:00
Remi NGUYEN VAN
450854f8ba Add CTS test for the capport API
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
2020-05-29 11:41:09 +09:00
android-build-team Robot
3b80c3975b Snap for 6538416 from f034d7c25aa22203c1fa7d4df5a4407885ac960f to rvc-release
Change-Id: I099ac6f47958841605d3a8c713a1168ca2096ec6
2020-05-29 01:05:13 +00:00
Yan Yan
ff0471554e Test IKE Session setup in IPv6 network
Bug: 148689509
Test: atest testIkeSessionSetupAndChildSessionSetupWithTunnelModeV6
Change-Id: Ia2fa9462c66a283697e0cb9dd4c475215c0eafde
Merged-In: Ia2fa9462c66a283697e0cb9dd4c475215c0eafde
(cherry picked from commit 71a855de7dcdc3bdbdb75c78be0f57f3055b0c72)
2020-05-28 19:50:22 +00:00
Yan Yan
a2b2ab5473 Test handling authentication failure
- 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)
2020-05-28 19:48:40 +00:00
Yan Yan
188e220da7 Test remotely initiated rekey
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)
2020-05-28 19:47:03 +00:00
Yan Yan
783b9ad7f7 Test IKE Session setup with EAP-MSCHAPv2
Bug: 155821007
Test: atest CtsIkeTestCases
Change-Id: Ie8a328c53b531027ce63edaa874c4cd0904e0068
Merged-In: Ie8a328c53b531027ce63edaa874c4cd0904e0068
(cherry picked from commit aa4b9da896a4fd37ba01f4802fdf3de72b07a911)
2020-05-28 19:45:16 +00:00
Yan Yan
1e024e26cf Test IKE Session setup with digital-signature-based Auth
This commit adds a test for setting up IKE Session with
digital-signature-based authentication.

This test also verifies sending and receiving IKE fragments

Bug: 155821007
Test: atest CtsIkeTestCases:IkeSessionDigitalSignatureTest
Change-Id: I5829dfa955c47c0810760b7bf97372031e740f1e
Merged-In: I5829dfa955c47c0810760b7bf97372031e740f1e
(cherry picked from commit 3fde403c39e048e82223256ec7ca5c3ac7c93751)
2020-05-28 19:42:48 +00:00
Yan Yan
fd9c5eb675 Move common logic in testing and verification to IkeSessionTestBase
This commit moves following logics to IkeSessionTestBase so that all
subclasses can share it:
- build ChildParams
- perform IKE and first Child setup
- perform deleting IKE
- verifying IKE and first Child setup

Bug: 155821007
Test: atest CtsIkeTestCases:IkeSessionDigitalSignatureTest
Change-Id: Ib35b18240396a7b4823111e37be9a338d8ff6f06
Merged-In: Ib35b18240396a7b4823111e37be9a338d8ff6f06
(cherry picked from commit 34cdddb039da37c07bacf15f4c7a5fb36e757fad)
2020-05-28 19:41:17 +00:00
Automerger Merge Worker
f50119bbe4 Verify creation and deletion of IpSecTransform pair
- Verify that inbound and outbound IpSecTransforms
  are created when a Child Session is created
- Verify that when Child Session is deleted,
  the IpSecTransform pair is deleted

Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: If142b3fb2ac791322921beeab1bc8d43db255317
Merged-In: If142b3fb2ac791322921beeab1bc8d43db255317
(cherry picked from commit a91fc43cbdfc6e58347493506fa5079a4280dca8)
2020-05-28 19:39:24 +00:00
Treehugger Robot
994edc463e Fix testTetheringUpstream flaky
testTetheringUpstream test case need cellular network. So it disable
wifi and getActiveNetwork to check whether current network is cellular.
But there is a race that call getActiveNetwork right away after
disconnect wifi. getActiveNetwork may return null because switching
network is not ready yet.

Bug: 156314879
Test: atest CtsTetheringTest

Merged-In: I6b433560fb27a3b4bd80c4198ccdb58a5be701b6
Change-Id: I6b433560fb27a3b4bd80c4198ccdb58a5be701b6
2020-05-28 04:17:51 +00:00
Chalard Jean
3eeb88d3b0 Merge "Add logs to NetworkCallbackTest to diagnose issues" into rvc-dev 2020-05-28 01:23:44 +00:00