Commit Graph

4798 Commits

Author SHA1 Message Date
TreeHugger Robot
e85a80d3f3 [automerger skipped] Merge "Deflaky test for DnsResolverTest" into rvc-dev am: 3f9e3e848b -s ours
am skip reason: Change-Id I224a6493c87cebaf0bf954c2644e2945ccd50db1 with SHA-1 d6e36d820e is in history

Change-Id: I31a3d1e92a8c59a4c167b927e4353eed30f6e112
2020-05-27 01:06:30 +00: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
b02350d9f5 Merge "Move common logic in testing and verification to IkeSessionTestBase" am: 609752fca4
Change-Id: I679bd2de52fd8fecc4cda484fa8de07b279cac4b
2020-05-26 23:06:21 +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
Yan Yan
609752fca4 Merge "Move common logic in testing and verification to IkeSessionTestBase" 2020-05-26 22:51:40 +00:00
Yan Yan
f455a5dd27 Merge "Verify creation and deletion of IpSecTransform pair" am: 3e8456302a
Change-Id: I71dc9d2f37a1e7b34cb33325a4d705307c47229b
2020-05-26 22:46:42 +00: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
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
e3a59ef575 [automerger skipped] Merge "Use Q permission on Q for startCaptivePortalApp" into rvc-dev am: b407f77bd0 -s ours
am skip reason: Change-Id I24b6907d164aba07df0f5a1a3715669e99cddd88 with SHA-1 aa660b56cf is in history

Change-Id: I46ba7e75687fa8dcaf6892c3014e9c478388d99d
2020-05-26 02:12:24 +00:00
Remi NGUYEN VAN
7a4db12ffe [automerger skipped] Merge "Skip testTemporarilyNotMeteredCapability on Q" into rvc-dev am: 6b23e3b0e3 -s ours
am skip reason: Change-Id I94e874e37cadadd90397278bf519db68db48a50f with SHA-1 6dfe6412a2 is in history

Change-Id: I228bee83996468bd8a66177a4da2da8a7c801c25
2020-05-26 02:11:50 +00:00
Remi NGUYEN VAN
6c67c21ee8 [automerger skipped] Fix and deflake ConnectivityManagerTest am: 8c91b0feaf -s ours
am skip reason: Change-Id I7459753b1068e1760a95337760db58d1df213fad with SHA-1 2f5879f6c7 is in history

Change-Id: I5ed932453d08d05eed232c6303ef0cae2c703610
2020-05-26 02:11:36 +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
850cd533e0 Merge "Skip testTemporarilyNotMeteredCapability on Q" am: 352a01edfd
Change-Id: Id2fe42bb26d215fe2b0cf23b38927f26dc92d2cd
2020-05-26 00:27:10 +00:00
Remi NGUYEN VAN
3742699f21 Merge "Use Q permission on Q for startCaptivePortalApp" am: efcc79f2a5
Change-Id: I7985ae613e89e7376555c3ba3d53d075ffc71596
2020-05-26 00:26:35 +00:00
Remi NGUYEN VAN
1d4d950451 Merge "Fix and deflake ConnectivityManagerTest" am: 591263914c
Change-Id: I8caf45c73d7fb9a44251d0403734c675064e0335
2020-05-26 00:25:56 +00:00
Remi NGUYEN VAN
352a01edfd Merge "Skip testTemporarilyNotMeteredCapability on Q" 2020-05-26 00:00:45 +00:00
Remi NGUYEN VAN
efcc79f2a5 Merge "Use Q permission on Q for startCaptivePortalApp" 2020-05-26 00:00:17 +00:00
Remi NGUYEN VAN
591263914c Merge "Fix and deflake ConnectivityManagerTest" 2020-05-25 23:59:11 +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
deb1fca4e5 [automerger skipped] Merge "Add a cts test for PermissionMonitor security problem" am: c7cd60d9d4 am: b1e20af9bc -s ours
am skip reason: Change-Id I2c717a11bda43db166a55d343eb752ab45947fe8 with SHA-1 5a86f4b18a is in history

Change-Id: I542d55feeb19d951df96a65c804a46a66aaab1cc
2020-05-25 09:54:15 +00:00
Remi NGUYEN VAN
b1e20af9bc Merge "Add a cts test for PermissionMonitor security problem" am: c7cd60d9d4
Change-Id: I69979d9fdb77e8066f90cc2d88ff655fcd5f8b85
2020-05-25 09:32:32 +00: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
39edee84c8 Merge "Deflaky test for DnsResolverTest" am: 76fdd5976f
Change-Id: Id693a9bbeb3533515ccb8f3920e5e2602c5c841a
2020-05-22 15:47:28 +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
762d3c0be1 Merge "Cleanup of IkeSessionPskTest" am: 27349420bd
Change-Id: Ida17fac36eb6fcfe088c4e4a5c425ca305e78a14
2020-05-22 02:03:27 +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
Yan Yan
3a264ff900 Merge "Exit test if device does not support IPsec tunnel" am: 32d03b84b6
Change-Id: I7c2e36102ec1020a74d323d098484cf035b50340
2020-05-21 23:23:34 +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
a9e81620ff Merge "Create NetworkAgent CTS for NET_CAP_TEMP_NOT_METERED" into rvc-dev am: ed6b680e0c
Change-Id: I4e144146796c3281680532a54f714d5340f76e36
2020-05-21 05:40:08 +00: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
f773b852ad [automerger skipped] Merge "Add cts for TEMPORARILY_NOT_METERED" am: bab248804b am: 4777f25a6e -s ours
am skip reason: Change-Id I6838dff70e6608f166119b99750db3bc59c59e42 with SHA-1 0a0d71f1ec is in history

Change-Id: I077cfb0ba6fb367e67fd42deca650a2a71235f2d
2020-05-21 02:05:34 +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