Commit Graph

4990 Commits

Author SHA1 Message Date
Cody Kesting
9f8a87c7e2 [automerger skipped] Merge "CTS test ConnectivityDiagnostics via CarrierPrivilegesTracker." into rvc-dev am: efaf28e9f3 -s ours
am skip reason: Change-Id Iee8a428ada0b6e2127410267a13c3b688df83e6d with SHA-1 7d1159a2d4 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11916180

Change-Id: I27fb1f42bc60c4798bbb45257449142bfe0674e3
2020-06-22 17:30:14 +00:00
Cody Kesting
efaf28e9f3 Merge "CTS test ConnectivityDiagnostics via CarrierPrivilegesTracker." into rvc-dev 2020-06-22 17:12:41 +00:00
Cody Kesting
c60ca1afda resolve merge conflicts of 9e491121c5 to rvc-dev-plus-aosp. Caused by aosp/1316384
Bug: 148032944
Bug: 151332031
Change-Id: I7cc024249afb59631820819fed62c2417ffbd05e
2020-06-22 14:31:05 +00:00
TreeHugger Robot
f42e51ec45 Merge "Add net-utils-framework-common to cts-net" into rvc-dev am: f1a476d61e
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11931026

Change-Id: I5e0a161d7fd5af4f9d097189674727e2a8a4baa2
2020-06-22 12:56:31 +00:00
Luke Huang
6261d27a9f Add net-utils-framework-common to cts-net
In order to avoid class package missing problem, add
net-utils-framework-common in cts net test build. Also jarjar
the package name to prevent conflict.

Test: build
Test: atest DnsResolverTest
Bug: 150952393
Change-Id: I40e2d4c4945a0579f6e1923e4722b09354ff050c
2020-06-22 15:08:27 +08:00
Lorenzo Colitti
9e491121c5 Merge "CTS test ConnectivityDiagnostics via CarrierPrivilegesTracker." am: c7f94d5052
Original change: https://android-review.googlesource.com/c/platform/cts/+/1316384

Change-Id: If5630e02b0ae9a15976c0d21fe48eb4a88f53cf6
2020-06-22 04:55:45 +00:00
Cody Kesting
a9dda29874 CTS test ConnectivityDiagnostics via CarrierPrivilegesTracker.
This change adds a CTS test for ConnectivityDiagnostics using
CarrierPrivilegesTracker to receive permissions for
ConnectivityDiagnostics callbacks.

Specifically, the test provides CarrierPrivileges to the test package
(android.net.cts) for the active subscription via Carrier Configs
overrides. CarrierPrivilegesTracker listens to the Carrier Configs
change and matches the loaded certificate with the test package, then
includes the test package UID as an administrator for the Network in
ConnectivityService. Then, a ConnectivityDiagnosticsCallback is
registered and receives a ConnectivityReport on register for the active
subscription.

Bug: 148032944
Bug: 151332031
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: Iee8a428ada0b6e2127410267a13c3b688df83e6d
Merged-In: Iee8a428ada0b6e2127410267a13c3b688df83e6d
2020-06-22 04:44:17 +00:00
Lorenzo Colitti
c7f94d5052 Merge "CTS test ConnectivityDiagnostics via CarrierPrivilegesTracker." 2020-06-22 04:41:43 +00:00
Remi NGUYEN VAN
fd265a7858 Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev am: a530216c7d
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11835437

Change-Id: I773c676203488e9a323fa6a5b6c78e2006031fa0
2020-06-19 01:08:48 +00:00
Remi NGUYEN VAN
a530216c7d Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev 2020-06-19 00:49:29 +00:00
Lorenzo Colitti
946b09bb5c Merge "Update DnsPacket package name" into rvc-dev am: 7703986e4c
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11863010

Change-Id: I166a083b41e7a7ccb5206e0c332ae0a77825f42a
2020-06-18 10:34:11 +00:00
Lorenzo Colitti
7703986e4c Merge "Update DnsPacket package name" into rvc-dev 2020-06-18 10:14:47 +00:00
Cody Kesting
286a433d78 Only run ConnectivityDiagnosticsManagerTest as AppModeFull. am: 7c9d2128de
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11904000

Change-Id: Ia6830bfbb3c15fa04553433c8320eb0a79b3a299
2020-06-18 06:27:23 +00:00
Cody Kesting
7c9d2128de Only run ConnectivityDiagnosticsManagerTest as AppModeFull.
This CL restricts ConnectivityDiagnosticsManagerTest to only being run
as @AppModeFull. This is required, as Instant Apps are not allowed
CHANGE_NETWORK_STATE (required for CM#requestNetwork) or
MANAGE_TEST_NETWORKS (required for TestNetworkManager#setupTestNetwork)
permissions - both of which are required for
ConnectivityDiagnosticsManagerTest.

Bug: 158431112
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: Id867b8dcaca758cfeb83009848e1099e900a0790
2020-06-18 13:38:00 +09:00
Luke Huang
8f3a1b5091 Update DnsPacket package name
The package name needs to be updated as
the class is moved into com.android.net.module.util.

Bug: 149403767
Test: atest DnsResolverTest
Change-Id: I908cb5f7bc6150e461748c8e34c92a19aa0206e4
2020-06-18 03:27:27 +00:00
Cody Kesting
7d1159a2d4 CTS test ConnectivityDiagnostics via CarrierPrivilegesTracker.
This change adds a CTS test for ConnectivityDiagnostics using
CarrierPrivilegesTracker to receive permissions for
ConnectivityDiagnostics callbacks.

Specifically, the test provides CarrierPrivileges to the test package
(android.net.cts) for the active subscription via Carrier Configs
overrides. CarrierPrivilegesTracker listens to the Carrier Configs
change and matches the loaded certificate with the test package, then
includes the test package UID as an administrator for the Network in
ConnectivityService. Then, a ConnectivityDiagnosticsCallback is
registered and receives a ConnectivityReport on register for the active
subscription.

Bug: 148032944
Bug: 151332031
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: Iee8a428ada0b6e2127410267a13c3b688df83e6d
2020-06-17 10:38:48 -07:00
TreeHugger Robot
5ec4c0ebce [automerger skipped] Merge "Verify owner of IKEv2 VPNs" into rvc-dev am: 8badddb04d -s ours
am skip reason: Change-Id Iabf2859c289aa86ec38aea1edcc1fb248b9d0d26 with SHA-1 9d1f86f3a8 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11876501

Change-Id: I35aecabe6bfc78de6b59f04f4bba16ce78e0b15c
2020-06-17 15:35:35 +00:00
TreeHugger Robot
8badddb04d Merge "Verify owner of IKEv2 VPNs" into rvc-dev 2020-06-17 15:26:22 +00:00
TreeHugger Robot
1e1e07e884 [automerger skipped] Merge "Toggle wifi when running CaptivePortalTest" into rvc-dev am: 3cc6da3e61 -s ours
am skip reason: Change-Id I31f9f4a9678e11042005c29535af840246358764 with SHA-1 fa761d5917 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11863009

Change-Id: I00d4a6bc63ff9489a732d404769018bd69b031bc
2020-06-16 09:25:56 +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
Benedict Wong
21bf8ba8e7 Verify owner of IKEv2 VPNs
This change adds assertions to ensure that the owner UIDs of IKEv2 VPNs
are correctly set.

Bug: 150135470
Test: This
Merged-In: Iabf2859c289aa86ec38aea1edcc1fb248b9d0d26
Change-Id: Iabf2859c289aa86ec38aea1edcc1fb248b9d0d26
(cherry picked from commit 30234827aa24716062a23f28b1effc59e9ef46de)
2020-06-16 01:43:34 +00:00
Treehugger Robot
909eeeed43 Merge "Toggle wifi when running CaptivePortalTest" am: 1ae290c1a6 am: 5f38f3067d
Original change: https://android-review.googlesource.com/c/platform/cts/+/1336114

Change-Id: Id369a526b18d70fdb72a5dcaf12092d6085efe27
2020-06-16 01:16:18 +00:00
Treehugger Robot
5f38f3067d Merge "Toggle wifi when running CaptivePortalTest" am: 1ae290c1a6
Original change: https://android-review.googlesource.com/c/platform/cts/+/1336114

Change-Id: I4a878a7d328a7a001355e092b81e1e3635dcb853
2020-06-16 00:59:52 +00:00
Treehugger Robot
1ae290c1a6 Merge "Toggle wifi when running CaptivePortalTest" 2020-06-16 00:43:07 +00:00
Benedict Wong
ed0ddfc96c Merge "Verify owner of IKEv2 VPNs" am: a330e50192 am: 7f63ec96d9
Original change: https://android-review.googlesource.com/c/platform/cts/+/1326393

Change-Id: Ib77195b5116622e42730d1e25ed48c3fcbbeaa36
2020-06-15 17:33:32 +00:00
Benedict Wong
7f63ec96d9 Merge "Verify owner of IKEv2 VPNs" am: a330e50192
Original change: https://android-review.googlesource.com/c/platform/cts/+/1326393

Change-Id: Ia3e9f26c6e28fa02b25b3098fbda98c2bf07c2bf
2020-06-15 17:18:15 +00:00
Benedict Wong
a330e50192 Merge "Verify owner of IKEv2 VPNs" 2020-06-15 17:09:46 +00:00
Yan Yan
5cf96925d2 [automerger skipped] Merge "Fix tests that failed on devices without IPsec tunnel feature" into rvc-dev am: 91e4a69abe -s ours
am skip reason: Change-Id I9a8c7f631f0e6e02492816e3fbf0d751017dc2b3 with SHA-1 ce3c9ae278 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11813719

Change-Id: I4379b1f57e74d5cb10dbabf57c6245c73a8b7c29
2020-06-15 17:05:09 +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
b49bc69af3 [automerger skipped] Fix CtsTetheringTest on devices without permanent softAp interfaces. am: 3abe36567c -s ours
am skip reason: Change-Id I0ba6bc9dcbf7829dcad5561c707d5f5c5540f10b with SHA-1 24d8b8391e is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11863001

Change-Id: I59264cbfcd41a0e5382a41ba6cbb1096cfcea15e
2020-06-15 13:47:27 +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
TreeHugger Robot
9daa97c7d6 Merge "Bump CtsNetTestCasesLatestSdk to target SDK 30." into rvc-dev am: d69d28f755
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11850382

Change-Id: Ifcf2a6cc2ad2a5573a92aa936d17cb6518b61277
2020-06-15 11:25:23 +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
Remi NGUYEN VAN
fa761d5917 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
Change-Id: I31f9f4a9678e11042005c29535af840246358764
2020-06-15 19:38:01 +09:00
Treehugger Robot
174f529ce4 Merge "Fix CtsTetheringTest on devices without permanent softAp interfaces." am: 10f23078c1 am: 9d3ae2e188
Original change: https://android-review.googlesource.com/c/platform/cts/+/1331096

Change-Id: I0eb4c872456981e346d95d57bc2e69cc327342bf
2020-06-15 10:18:21 +00:00
Treehugger Robot
9d3ae2e188 Merge "Fix CtsTetheringTest on devices without permanent softAp interfaces." am: 10f23078c1
Original change: https://android-review.googlesource.com/c/platform/cts/+/1331096

Change-Id: I77c08e18837bd0d04744c4dd5b058c368e90f85d
2020-06-15 10:06:52 +00:00
Treehugger Robot
10f23078c1 Merge "Fix CtsTetheringTest on devices without permanent softAp interfaces." 2020-06-15 09:49:44 +00:00
markchien
24d8b8391e 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

Change-Id: I0ba6bc9dcbf7829dcad5561c707d5f5c5540f10b
2020-06-15 13:42:40 +08:00
Remi NGUYEN VAN
484f0d4901 Move Inet[4]AddressUtils to libs/net
The classes should not be picked up from frameworks/base, as they are
part of several mainline modules.

Bug: 151052811
Test: m; manual: flashed, wifi and telephony working
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalApiTest
Change-Id: Ic7534afe3a437f2089ed33cebdad391dc498d187
2020-06-12 17:59:16 +09:00
Treehugger Robot
6eb4e0e759 [automerger skipped] Fix MultinetworkApiTest fail problem in instant mode am: 791d142a98 -s ours
am skip reason: Change-Id I8ecadd134824a4023a3c6e173d52ba088d46b103 with SHA-1 23710588f9 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11823248

Change-Id: I5e620b4ed80b70b61120528dd42146befe86e86b
2020-06-11 04:05:12 +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
Treehugger Robot
c0a62623af Merge "Fix MultinetworkApiTest fail problem in instant mode" am: 3475b733b5 am: 59fdc91b04
Original change: https://android-review.googlesource.com/c/platform/cts/+/1326955

Change-Id: Icf0cd88cfb5bdcf18173c8464666a9055ae903a8
2020-06-11 00:52:33 +00:00
Treehugger Robot
59fdc91b04 Merge "Fix MultinetworkApiTest fail problem in instant mode" am: 3475b733b5
Original change: https://android-review.googlesource.com/c/platform/cts/+/1326955

Change-Id: I70b8832c7b00cff6d8f9154e4f5b97a3d2fc28de
2020-06-11 00:41:11 +00:00
Treehugger Robot
3475b733b5 Merge "Fix MultinetworkApiTest fail problem in instant mode" 2020-06-11 00:22:51 +00:00
TreeHugger Robot
4b9e8d6166 [automerger skipped] Merge "Enlarge the onAvailable callback timeout to 30 seconds" into rvc-dev am: c63627c23c -s ours
am skip reason: Change-Id Ie89936ecc2d70ee22dd312067ccedd2523e81855 with SHA-1 072e96ebdf is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11761870

Change-Id: Iea063e207ceffc51cbd4fa157bd3074b0b5d38e8
2020-06-10 15:33:30 +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
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
0ec5b40aa5 Merge "Fix tests that failed on devices without IPsec tunnel feature" am: 08a29ff260 am: fdf0db07d9
Original change: https://android-review.googlesource.com/c/platform/cts/+/1322980

Change-Id: I640782fb9108b8bfa433517d3b424638af70993b
2020-06-09 19:51:56 +00:00
Treehugger Robot
fdf0db07d9 Merge "Fix tests that failed on devices without IPsec tunnel feature" am: 08a29ff260
Original change: https://android-review.googlesource.com/c/platform/cts/+/1322980

Change-Id: Ifbf0790825a9fa6e3e3d6ceca342037401985ce0
2020-06-09 19:41:19 +00:00