Commit Graph

1926 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
b4889df5f2 Merge "Skip NetworkStatsBinderTest on Q" into rvc-dev am: 964f3f9ef2
Change-Id: I59e6f154e44e59799ef7e4788ac8803c4333c96c
2020-05-28 01:03:36 +00:00
Remi NGUYEN VAN
964f3f9ef2 Merge "Skip NetworkStatsBinderTest on Q" into rvc-dev 2020-05-28 00:16:07 +00:00
Yan Yan
8686dab17a Merge "Test IKE Session setup with digital-signature-based Auth" am: 6b5975c9fb am: 8515216fea
Change-Id: I85c90e750f1191a7c99d003ab6dd656d0440273b
2020-05-28 00:09:28 +00:00
Yan Yan
6b5975c9fb Merge "Test IKE Session setup with digital-signature-based Auth" 2020-05-27 23:38:25 +00:00
Yan Yan
6236d15b63 Merge "Apply MainlineTestModuleController to IKE CTS" into rvc-dev am: eccce8ea27
Change-Id: Ice5e324a422470f00d540e063cd01ad0dc39e3ae
2020-05-27 17:31:41 +00:00
Yan Yan
64db03e386 Merge changes from topic "ike-cts-mts" into rvc-dev
* changes:
  Cleanup of IkeSessionPskTest
  Exit test if device does not support IPsec tunnel
2020-05-27 17:18:17 +00:00
Yan Yan
eccce8ea27 Merge "Apply MainlineTestModuleController to IKE CTS" into rvc-dev 2020-05-27 17:18:17 +00:00
Treehugger Robot
530000eef0 Merge "Add logs to NetworkCallbackTest to diagnose issues" am: 89b5be1e4d am: 212fc42b22
Change-Id: I258765037afa2dc06def25b6c8b65b5b3d444f4c
2020-05-27 10:52:50 +00: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
Yan Yan
3f3ed1614c Merge "Move common logic in testing and verification to IkeSessionTestBase" am: 609752fca4 am: b02350d9f5
Change-Id: Iff52af4eec73ba51e913649ad2ba028291128139
2020-05-26 23:06:44 +00:00
Yan Yan
a85845a730 Merge "Verify creation and deletion of IpSecTransform pair" am: 3e8456302a am: f455a5dd27
Change-Id: Ie6cab2a307a44d7717e47a3055217c4d5b320fae
2020-05-26 23:06:04 +00:00
evitayan
e5c451c1db Apply MainlineTestModuleController to IKE CTS
Only run the tests when com.google.android.ipsec is
installed on device.

This CL follows aosp/11427976 as an example.

Bug: 150497352
Test: m mts && mts-tradefed run mts-ipsec
Change-Id: I5992c54f9c0b9f1aa9752a207660f9f6e97ccace
2020-05-26 22:59:31 +00:00
Yan Yan
f580c71a43 Cleanup of IkeSessionPskTest
- Add java doc in IkeSessionTestBase about the necessity to use
  different addresses and Networks in each test
- Use ArrayTrackRecord in Test Session Callback to retrieve the
  latest result.
- Verify that IpSecTransform pair is created and deleted

Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: Ib747c8cdfe1827e8df2aa7544e28e98a177d3d1c
Merged-In: Ib747c8cdfe1827e8df2aa7544e28e98a177d3d1c
(cherry picked from commit f729d7a112e83e04c008b0bbeed333238482d3e9)
2020-05-26 22:58:10 +00:00
Automerger Merge Worker
9604af3544 Exit test if device does not support IPsec tunnel
Bug: 155926216
Test: CtsIkeTestCases
Change-Id: I4e426b8f3509e56e7e2e7532e216533ad8bfbc2f
Merged-In: I4e426b8f3509e56e7e2e7532e216533ad8bfbc2f
(cherry picked from commit eb70555351725a608afac0fb9f94a327e9236729)
2020-05-26 22:57:58 +00:00
Yan Yan
609752fca4 Merge "Move common logic in testing and verification to IkeSessionTestBase" 2020-05-26 22:51:40 +00: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
46b3c762bb Skip NetworkStatsBinderTest on Q
The fix verified by that test is only applied on R+.

Test: atest NetworkStatsBinderTest
Bug: 150904735
Change-Id: I5ac69a121e5fa1b927ec94f3873f5c31b9031419
2020-05-26 17:12:40 +09:00
Luke Huang
fd4a967604 Deflaky test for DnsResolverTest
It's possible that private DNS setting is not in the state we expected
when we tried to enable strict mode during tests. The problem here is
that there are 2 setting Uris(mode and specifier) relating to strict
mode, each of them might trigger private DNS setting changing evnet in
ConnectivityService.
Previously, we tried to enable strict mode with first set private DNS
mode and then private DNS specifier. This may result in 2 consecutive
private DNS changes events with very short intervals, which caused
conflicts between DnsResolver / NetworkMonitor and lead to flaky tests.

So
0. Use opportunistic as default mode if no default mode existed.
1. Change the order (mode and specifier) for enabling strict mode.
2. Change private DNS mode only when needed.
     (If original mode is "hostname", then we only need to set
     specifier)

Bug: 153624005
Bug: 151122313
Bug: 150952393
Test: atest DnsResolverTest --rerun-until-failure 100
Test: forrest (git_master, cts/networking/gce-all)
Test: forrest (git_rvc-dev, atest CtsNetTestCases)
Test: forrest (git_rvc-dev, mts/dnsresolver/device-all)
Merged-In: I224a6493c87cebaf0bf954c2644e2945ccd50db1
Change-Id: Ib61ad7bd510341366ebbbb72aa451e5809ee3e9d
(cherry picked from commit 7561b1499c1b8da0334b32c0452d49113d9e4806)
2020-05-26 08:05:15 +00:00
Remi NGUYEN VAN
b407f77bd0 Merge "Use Q permission on Q for startCaptivePortalApp" into rvc-dev 2020-05-26 02:00:19 +00:00
Remi NGUYEN VAN
6b23e3b0e3 Merge "Skip testTemporarilyNotMeteredCapability on Q" into rvc-dev 2020-05-26 02:00:05 +00:00
Remi NGUYEN VAN
d79613570d Skip testTemporarilyNotMeteredCapability on Q
The capability did not exist on Q.

Bug: 155993662
Test: atest NetworkRequestTest
Original-Change: https://android-review.googlesource.com/1316082
Merged-In: I94e874e37cadadd90397278bf519db68db48a50f
Change-Id: I94e874e37cadadd90397278bf519db68db48a50f
2020-05-26 00:51:56 +00:00
Remi NGUYEN VAN
e878df691e 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

Original-Change: https://android-review.googlesource.com/1316081
Merged-In: I24b6907d164aba07df0f5a1a3715669e99cddd88
Change-Id: I24b6907d164aba07df0f5a1a3715669e99cddd88
2020-05-26 00:51:39 +00:00
Remi NGUYEN VAN
8c91b0feaf 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
Original-Change: https://android-review.googlesource.com/1310419
Merged-In: I7459753b1068e1760a95337760db58d1df213fad
Change-Id: I7459753b1068e1760a95337760db58d1df213fad
2020-05-26 00:48:51 +00:00
Remi NGUYEN VAN
6287cf1e3f Merge "Skip testTemporarilyNotMeteredCapability on Q" am: 352a01edfd am: 850cd533e0
Change-Id: Id5558ca121fc83510486e4ce80a68541dabf5bdf
2020-05-26 00:41:04 +00:00
Remi NGUYEN VAN
2c249c861b Merge "Use Q permission on Q for startCaptivePortalApp" am: efcc79f2a5 am: 3742699f21
Change-Id: Ie70dfd728b48fd8b4bd169a77140e46fe9ca25b6
2020-05-26 00:40:42 +00:00
Remi NGUYEN VAN
fff4665e6a Merge "Fix and deflake ConnectivityManagerTest" am: 591263914c am: 1d4d950451
Change-Id: I0b1dd2ad17b3c6460187d7e029ad787a7ba57824
2020-05-26 00:40:14 +00: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
paulhu
b568c3baa6 Add a cts test for PermissionMonitor security problem am: 5a86f4b18a
Change-Id: Iad7a6bc06d8d10787c70b99ccb559e9075d5917a
2020-05-25 08:13:18 +00:00
paulhu
5a86f4b18a Add a cts test for PermissionMonitor security problem
Add a cts test to check whether app can have netd sytem
permission even the app didn't grant the
CONNECTIVITY_USE_RESTRICTED_NETWORKS permission.

Bug: 144679405
Test: atest android.net.cts.ConnectivityManagerTest
Change-Id: I2c717a11bda43db166a55d343eb752ab45947fe8
Merged-In: I2c717a11bda43db166a55d343eb752ab45947fe8
(cherry picked from commit 1bc6b39789, ag/10285567)
2020-05-25 05:43:18 +00:00
Luke Huang
f45270dab9 Merge "Deflaky test for DnsResolverTest" am: 76fdd5976f am: 39edee84c8
Change-Id: I7fb9cab2b8ff2e2b42de94a3e7f9d3a4d0389b2f
2020-05-22 16:00:08 +00:00
Luke Huang
76fdd5976f Merge "Deflaky test for DnsResolverTest" 2020-05-22 15:28:05 +00:00
Yan Yan
dee6ff4e4b Merge "Cleanup of IkeSessionPskTest" am: 27349420bd am: 762d3c0be1
Change-Id: Idf907ac333dc9c00077dfb92e82f9a578cb8aee2
2020-05-22 02:18:14 +00:00
Yan Yan
27349420bd Merge "Cleanup of IkeSessionPskTest" 2020-05-22 01:49:08 +00:00
Yan Yan
ad21ee4800 Merge "Exit test if device does not support IPsec tunnel" am: 32d03b84b6 am: 3a264ff900
Change-Id: Ic18d851039d7aae231845a9b3b5e0373caf8683f
2020-05-21 23:35:00 +00:00
evitayan
34e71a5b68 Cleanup of IkeSessionPskTest
- Add java doc in IkeSessionTestBase about the necessity to use
  different addresses and Networks in each test
- Use ArrayTrackRecord in Test Session Callback to retrieve the
  latest result.
- Verify that IpSecTransform pair is created and deleted

Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: Ib747c8cdfe1827e8df2aa7544e28e98a177d3d1c
2020-05-21 16:23:02 -07:00
Yan Yan
32d03b84b6 Merge "Exit test if device does not support IPsec tunnel" 2020-05-21 23:10:54 +00:00
Luke Huang
d6e36d820e Deflaky test for DnsResolverTest
It's possible that private DNS setting is not in the state we expected
when we tried to enable strict mode during tests. The problem here is
that there are 2 setting Uris(mode and specifier) relating to strict
mode, each of them might trigger private DNS setting changing evnet in
ConnectivityService.
Previously, we tried to enable strict mode with first set private DNS
mode and then private DNS specifier. This may result in 2 consecutive
private DNS changes events with very short intervals, which caused
conflicts between DnsResolver / NetworkMonitor and lead to flaky tests.

So
0. Use opportunistic as default mode if no default mode existed.
1. Change the order (mode and specifier) for enabling strict mode.
2. Change private DNS mode only when needed.
     (If original mode is "hostname", then we only need to set
     specifier)

Bug: 153624005
Bug: 151122313
Bug: 150952393
Test: atest DnsResolverTest --rerun-until-failure 100
Test: forrest (git_master, cts/networking/gce-all)
Test: forrest (git_rvc-dev, atest CtsNetTestCases)
Test: forrest (git_rvc-dev, mts/dnsresolver/device-all)
Change-Id: I224a6493c87cebaf0bf954c2644e2945ccd50db1
2020-05-21 16:04:49 +08:00
TreeHugger Robot
ed6b680e0c Merge "Create NetworkAgent CTS for NET_CAP_TEMP_NOT_METERED" into rvc-dev 2020-05-21 05:30:50 +00:00
Sarah Chin
8e28d8789d Create NetworkAgent CTS for NET_CAP_TEMP_NOT_METERED
Test: atest NetworkAgentTest
Bug: 155993662
Change-Id: Ic968bf37075c23e9ea7d98eaec7f4f37d9ebc337
2020-05-20 18:58:21 -07:00
Sarah Chin
ae36797b69 Add cts for TEMPORARILY_NOT_METERED
Bug: 155993662
Test: atest NetworkRequestTest
Change-Id: I6838dff70e6608f166119b99750db3bc59c59e42
Merged-In: I6838dff70e6608f166119b99750db3bc59c59e42
2020-05-20 17:27:55 -07:00
evitayan
677a1c1554 Exit test if device does not support IPsec tunnel
Bug: 155926216
Test: CtsIkeTestCases
Change-Id: I4e426b8f3509e56e7e2e7532e216533ad8bfbc2f
2020-05-20 15:18:32 -07:00
Sarah Chin
0a0d71f1ec Add cts for TEMPORARILY_NOT_METERED
Bug: 155993662
Test: atest NetworkRequestTest
Change-Id: I6838dff70e6608f166119b99750db3bc59c59e42
2020-05-20 15:03:38 -07:00
TreeHugger Robot
eded3fd9be Merge "Apply MainlineTestModuleController to tethering cts tests" into rvc-dev 2020-05-19 19:32:00 +00:00