Commit Graph

4126 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Sarah Chin
4777f25a6e Merge "Add cts for TEMPORARILY_NOT_METERED" am: bab248804b
Change-Id: Ie40c6ec697f646f5dda84b681af3929fdfff8683
2020-05-21 01:53:47 +00:00
Sarah Chin
bab248804b Merge "Add cts for TEMPORARILY_NOT_METERED" 2020-05-21 01:37:51 +00: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
Remi NGUYEN VAN
7211c19196 Merge "Fix CtsNetTestCasesLatestSdk fail on Q platform" am: 114a0914bd
Change-Id: I16a1048ac92ecf1499f55a703346fa57b96931b4
2020-05-19 04:43:54 +00:00
Remi NGUYEN VAN
114a0914bd Merge "Fix CtsNetTestCasesLatestSdk fail on Q platform" 2020-05-19 04:27:39 +00:00
Luke Huang
f33aae95c7 Merge "Revert "Fix flaky test for DnsResolverTest"" am: 430bcaa1f4
Change-Id: Ibbc118c40d9f75a4225fc8bd06d21f73c56f1adb
2020-05-19 01:26:39 +00:00
Luke Huang
dfa5480414 Revert "Fix flaky test for DnsResolverTest"
This reverts commit fb735de0e8.

Reason for revert: This CL made whole test failed.

Bug: 153624005
Bug: 150952393
Bug: 151122313
Change-Id: I083529616dbf80421ea6a322bb57d2bb0f2bca62
2020-05-19 01:18:49 +00:00
Ken Chen
5dd02e3103 Fix CtsNetTestCasesLatestSdk fail on Q platform
The CtsNetTestCasesLatestSdk needs to build against platform (for hidden
API access), The JNI library libnativedns_jni used by
CtsNetTestCasesLatestSdk needs to build against stable SDK (for running
on Q). To fulfill the combination, property jni_uses_sdk_apis must be
set.

Bug: 151122313
Bug: 150904735
Bug: 150918852
Test: atest CtsNetTestCasesLatestSdk on R and Q platforms
Change-Id: I5db3cb28829847e74412d270db7d17b81c5e26a2
2020-05-18 19:55:29 +08:00
Luke Huang
486e2eca5f Merge "Fix flaky test for DnsResolverTest" am: 7207fc3400
Change-Id: I60bc8560501761f000098fb959ab5a8edbc23a92
2020-05-17 07:03:29 +00:00
Luke Huang
fb735de0e8 Fix flaky 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
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: 153624702
Test: atest DnsResolverTest --rerun-until-failure 100
Change-Id: Iaed6285677f74a5ee6cc6684534ddc0758b25974
2020-05-15 23:39:19 +08:00
Paul Hu
1f9e324de0 Merge "Address aosp/1272946 leftover comment" am: ebe9cb15a4
Change-Id: I24a71cc5dd7e6805b23b16c10bc3c000ac892774
2020-05-15 01:24:54 +00:00
Paul Hu
ebe9cb15a4 Merge "Address aosp/1272946 leftover comment" 2020-05-15 01:11:14 +00:00
Chiachang Wang
224cd7a74f Merge "Move testInvariantInCanBeSatisfiedBy to be its own test" am: d40f746ea0
Change-Id: I55eccca940812dfb4a842de31ccbfd858b1a2331
2020-05-12 05:50:26 +00:00
Chiachang Wang
d40f746ea0 Merge "Move testInvariantInCanBeSatisfiedBy to be its own test" 2020-05-12 05:36:50 +00:00
Chiachang Wang
8ddd0227a9 Move testInvariantInCanBeSatisfiedBy to be its own test
Bug: 154451660
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkRequestTest
Change-Id: Id65b7189202108b232905535587f8a282e48007b
2020-05-12 09:39:16 +08:00
Chiachang Wang
85f6412866 Merge "Use local defined NetworkSpecifier to verify test" am: c23b2ac096
Change-Id: I49e3a182037652141e673ce54dad2daf7860d240
2020-05-11 14:35:53 +00:00
Chiachang Wang
c23b2ac096 Merge "Use local defined NetworkSpecifier to verify test" 2020-05-11 14:19:34 +00:00
Chiachang Wang
a495965c67 Use local defined NetworkSpecifier to verify test
Test will be affected by logic modification from different
NetworkSpecifiers. Since this test tries to test the behavior
of NetworkRequest but not NetworkSpecifier, use local defined
NetworkSpecifier to test to prevent repeating noisy breaks.
Also update test for testing invariant.

Bug: 154451660
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkRequestTest
Change-Id: I7e357c75a68244432231d59646ddf67c8d969c6d
2020-05-11 20:24:47 +08:00
paulhu
e5e8ae9e1b Address aosp/1272946 leftover comment
Verify that entitlement check bypass with TETHER_ERROR_NO_ERROR
response.

Bug: 152829363
Test: atests CtsTetheringTest
Change-Id: I6272d7b297bdf0e641612a09ffe12942cc2b42e1
2020-05-11 15:27:35 +08:00
Lucas Lin
06cb65fa80 Merge "Refine NetworkCallbackTest" am: ea89469f83
Change-Id: I5cb3c3b2340ad77bd89611abcb5e847b0c6b5767
2020-05-08 09:56:46 +00:00
Lucas Lin
ea89469f83 Merge "Refine NetworkCallbackTest" 2020-05-08 09:33:45 +00:00
lucaslin
5d57ec4a8f Refine NetworkCallbackTest
In R, to avoid data overages due to apps not detecting a
meteredness change, when a wifi network changes from unmetered
to metered the network will go down and will be replaced with a
new network. It will make NetworkCallbackTest fail because the
original design is getting the active network in setUp(). So once
the wifi reconnects, the network which is got in setUp() will be
meaningless and make the test fail due to network mismatches.
The new changes are:
1. Moving some initial pre-configurations into setUp().
2. Override the onCapabilitiesChanged() to check if network has
   changed to metered or not.
3. Add unregisterNetworkCallback() into iMyService.aidl so that
   NetworkCallbackTest can call it to unregister the network
   callback.
4. Enlarge the timeout of connecting network and receiving
   callback to prevent network cannot reconnect in time or
   callback cannot be received in a short time.

Bug: 153485744
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Change-Id: I1aa0e107cf6797b06dee4a15896c63321d822156
Merged-In: I1aa0e107cf6797b06dee4a15896c63321d822156
2020-05-08 08:01:34 +00:00
Mark Chien
93e798ee75 Merge "Tag CtsTetheringTest for sim card required" am: d4383032f5
Change-Id: I5c5768e76ba31bf5b3827814706d3251155d515e
2020-05-07 08:04:59 +00:00
markchien
f941ae9c03 Tag CtsTetheringTest for sim card required
Bug: 155598732
Test: atest CtsTetheringTest
Change-Id: I79f841682049707d7cc26bf1ecc3e5affc86d196
2020-05-06 14:55:29 +08:00
Yan Yan
8f22e4bdf1 Merge "Initial CL for testing IkeSession creation" am: 2e10c55003
Change-Id: I3111d16b1dea8d1d5912bc61aaecb60d83fd13c1
2020-05-01 06:07:12 +00:00
Yan Yan
2e10c55003 Merge "Initial CL for testing IkeSession creation" 2020-05-01 05:58:18 +00:00
evitayan
653d7ebb44 Initial CL for testing IkeSession creation
This commit:
-Extend TunUtils for processing IKE packets
-Add IkeSessionBaseTest containing common functionality for all IkeSession tests
-Add end-to-end test for IKEv2 PSK verifying creating IKE SA, creating child SAs
 and closing sessions
-Add basic tests for error scenarios

Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: Ie6c18591ffcc883abbf0484d9a59dfda61b33257
2020-04-30 18:56:12 -07:00