Commit Graph

1648 Commits

Author SHA1 Message Date
Treehugger Robot
08a29ff260 Merge "Fix tests that failed on devices without IPsec tunnel feature" 2020-06-09 18:56:32 +00:00
Treehugger Robot
5469352727 Merge "Reset vpn provision status" 2020-06-09 04:06:06 +00:00
evitayan
ce3c9ae278 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
2020-06-08 11:07:02 -07:00
Lucas Lin
fbf126a6f8 Merge "Enlarge the onAvailable callback timeout to 30 seconds" 2020-06-05 08:53:49 +00:00
Treehugger Robot
10944b6376 Merge "Add CtsNetTestCasesLatestSdk to postsubmit" 2020-06-05 04:38:40 +00:00
lucaslin
072e96ebdf 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
Change-Id: Ie89936ecc2d70ee22dd312067ccedd2523e81855
2020-06-05 02:55:22 +00:00
Remi NGUYEN VAN
f33b6ea261 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
Change-Id: I48b2b5490d3fd5eb6f9456825c11f3fee0ec5b67
2020-06-05 09:57:11 +09:00
Chiachang Wang
abf0c1d1e6 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
Change-Id: I4856cfc7ddfd70125c513a4201132256704d1a66
2020-06-04 12:52:31 +08:00
Treehugger Robot
d99c455167 Merge "Fix CtsNetUtils connectTo/disconnectFromWifi" 2020-06-03 07:21:49 +00:00
Remi NGUYEN VAN
7deca3e618 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
Change-Id: I244b91bdd8708694fce9f10d92b8b6646d28188f
2020-06-03 15:05:25 +09:00
Treehugger Robot
9bbb79f173 Merge "Remove dependency on kotlin-reflect" 2020-06-03 00:19:37 +00:00
Remi NGUYEN VAN
bdfc18bc1e Merge "Skip Ikev2VpnTest on Q" 2020-06-03 00:13:16 +00:00
Treehugger Robot
1691078821 Merge "Fix TetheringManagerTest failure when using entitlement required SIM" 2020-06-02 02:35:43 +00:00
Remi NGUYEN VAN
eef04c75ce 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
Change-Id: I6691a07ef8d6c63e68cb78813a5e3e499ef897df
2020-06-02 11:01:58 +09:00
Remi NGUYEN VAN
539bfc16ee Skip Ikev2VpnTest on Q
The Ikev2 VPN feature was introduced in R.

Bug: 150904735
Test: atest CtsNetTestCasesLatestSdk:Ikev2VpnTest
Change-Id: I51ded6e967291c110ff0bbd18a3631ab9a742e74
2020-06-02 10:51:55 +09:00
Cody Kesting
43fbab7444 Merge "Test Data Stall with unknown detection type." 2020-05-29 20:46:59 +00:00
Cody Kesting
f665174aaa Merge "Add CTS testing for ConnectivityDiagnostics Data Stall callback." 2020-05-29 20:44:42 +00:00
Cody Kesting
21763671f4 Merge "Add CTS tests for ConnectivityDiagnostics callbacks." 2020-05-29 19:49:06 +00:00
Benedict Wong
c75e8886ed Merge changes from topic "vpn-cts"
* 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-29 18:51:26 +00:00
Benedict Wong
3d95958d01 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
2020-05-29 02:28:07 -07:00
markchien
f74fce0d0c 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
Change-Id: I85299841d60afba97ffcc4ae908a85e51139319b
2020-05-29 11:53:34 +08:00
Remi NGUYEN VAN
b0d3cd455c Merge "Add CTS test for the capport API" 2020-05-29 00:35:24 +00:00
Benedict Wong
e777f4076e 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
2020-05-28 14:14:16 -07:00
Benedict Wong
670639c13c 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
2020-05-28 10:45:57 -07:00
Benedict Wong
9986109df8 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
2020-05-28 10:43:16 -07:00
Yan Yan
4a7fcbcb54 Merge "Test IKE Session setup in IPv6 network" 2020-05-28 17:03:51 +00:00
Remi NGUYEN VAN
be87265e09 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
Change-Id: I734dbd05c0f50b8dc4553102ab286f0d8807a7ac
2020-05-28 16:30:31 +09:00
Yan Yan
77a425820a Merge "Test handling authentication failure" 2020-05-28 04:22:35 +00:00
Treehugger Robot
555ca8801b Merge "Fix testTetheringUpstream flaky" 2020-05-28 01:36:55 +00:00
Yan Yan
06c7ebc8e4 Merge "Test remotely initiated rekey" 2020-05-28 01:10:38 +00:00
Yan Yan
aecb7c05e2 Merge "Test IKE Session setup with EAP-MSCHAPv2" 2020-05-28 01:09:11 +00:00
Yan Yan
6b5975c9fb Merge "Test IKE Session setup with digital-signature-based Auth" 2020-05-27 23:38:25 +00:00
markchien
47e3788e3e 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

Change-Id: I6b433560fb27a3b4bd80c4198ccdb58a5be701b6
2020-05-27 23:03:07 +08:00
Treehugger Robot
89b5be1e4d Merge "Add logs to NetworkCallbackTest to diagnose issues" 2020-05-27 10:19:57 +00:00
Chalard Jean
796ccadc00 Add logs to NetworkCallbackTest to diagnose issues
Bug: 157391946
Test: NetworkCallbackTests
Change-Id: I552a1ad05f97a2a9f83f5f7de77d2e7b64084ddc
2020-05-27 15:51:53 +09:00
evitayan
8719bd68eb Test IKE Session setup in IPv6 network
Bug: 148689509
Test: atest testIkeSessionSetupAndChildSessionSetupWithTunnelModeV6
Change-Id: Ia2fa9462c66a283697e0cb9dd4c475215c0eafde
2020-05-26 17:22:21 -07:00
evitayan
ac96b659d3 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
2020-05-26 15:52:14 -07:00
Yan Yan
609752fca4 Merge "Move common logic in testing and verification to IkeSessionTestBase" 2020-05-26 22:51:40 +00:00
evitayan
c0b2dbdaf6 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
2020-05-26 15:49:56 -07:00
evitayan
ce7032f0be Test IKE Session setup with EAP-MSCHAPv2
Bug: 155821007
Test: atest CtsIkeTestCases
Change-Id: Ie8a328c53b531027ce63edaa874c4cd0904e0068
2020-05-26 15:49:43 -07:00
evitayan
ab4bc2dd35 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
2020-05-26 15:49:36 -07:00
Yan Yan
3e8456302a Merge "Verify creation and deletion of IpSecTransform pair" 2020-05-26 22:34:00 +00:00
evitayan
13f043a8db 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
2020-05-26 10:30:28 -07:00
evitayan
908f1d3365 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
2020-05-26 10:21:00 -07:00
Remi NGUYEN VAN
6dfe6412a2 Skip testTemporarilyNotMeteredCapability on Q
The capability did not exist on Q.

Bug: 155993662
Test: atest NetworkRequestTest
Change-Id: I94e874e37cadadd90397278bf519db68db48a50f
2020-05-25 19:21:21 +09:00
Remi NGUYEN VAN
aa660b56cf Use Q permission on Q for startCaptivePortalApp
on Q startCaptivePortalApp was guarded by CONNECTIVITY_INTERNAL instead
of NETWORK_SETTINGS: change the permission adopted by shell on Q to
match the platform.

Test: atest CaptivePortalTest on a Q device
Bug: 150904735

Change-Id: I24b6907d164aba07df0f5a1a3715669e99cddd88
2020-05-25 19:15:53 +09:00
Remi NGUYEN VAN
2f5879f6c7 Fix and deflake ConnectivityManagerTest
- Migrate the test to JUnit4, as JUnit3 cannot use assumeTrue
 - Skip IPv4 keepalive tests on networks that do not have native IPv4.
 - Refactor usage of adoptShellPermissionIdentity to use try / finally
   or runAsShellPermissionIdentity: test failures could lead to
   permission failures in other tests due to mismatched adopt/drop.
 - Fix ensureWifiConnected to support the "wifi enabled but not fully
   connected" case.

Bug: 150949391
Test: atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest \
      --rerun-until-failure 50
Change-Id: I7459753b1068e1760a95337760db58d1df213fad
2020-05-25 19:15:39 +09:00
Remi NGUYEN VAN
c7cd60d9d4 Merge "Add a cts test for PermissionMonitor security problem" 2020-05-25 09:21:39 +00:00
Luke Huang
76fdd5976f Merge "Deflaky test for DnsResolverTest" 2020-05-22 15:28:05 +00:00
Yan Yan
27349420bd Merge "Cleanup of IkeSessionPskTest" 2020-05-22 01:49:08 +00:00