Commit Graph

2068 Commits

Author SHA1 Message Date
Jiyong Park
4072d4d5d4 Drop .stubs from android.test.[base|runner|mock].stubs
The .stubs library refer to the stub library of a java_sdk_library.
Since the name of the stub library is the implementation detail of the
build system, direct use of the name should be prohibited. Actually,
clients don't need to use the stub name directly because the build
system automatically redirects <name> to <name>.stubs.

Exempt-From-Owner-Approval: too many owners are involved. This is a
simple build script change.

Bug: 157007292
Test: m
Change-Id: I32502de3d87c5cfdbbcfe5545dd7db5e9bb551a7
2020-06-29 11:30:39 +00:00
Cody Kesting
dd6c474ec0 Merge "Fix ConnDiags Test for invoke-after-validate and unregister CBs." into rvc-dev am: ba9dd48cca am: 0660737884 am: 3e127b8fc1 am: 5812b032d5
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11916181

Change-Id: If75f768952b68ed726cc97289467e2a30cff94fe
2020-06-22 19:03:37 +00:00
Cody Kesting
ba9dd48cca Merge "Fix ConnDiags Test for invoke-after-validate and unregister CBs." into rvc-dev 2020-06-22 18:17:28 +00:00
Cody Kesting
72e0ed49b8 Merge "resolve merge conflicts of 9e491121c5 to rvc-dev-plus-aosp. Caused by aosp/1316384" into rvc-dev-plus-aosp am: 0b4f6cbacd am: f30e887ac6 am: cc1bf75970
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11954340

Change-Id: I6e76e346aaa4cd44d3891a868e878ee97cd22aec
2020-06-22 17:21:00 +00:00
Cody Kesting
efaf28e9f3 Merge "CTS test ConnectivityDiagnostics via CarrierPrivilegesTracker." into rvc-dev 2020-06-22 17:12:41 +00:00
Cody Kesting
cce29fc44d Fix ConnDiags Test for invoke-after-validate and unregister CBs.
This change fixes several things in ConnectivityDiagnosticsManagerTest:
- testOnConnectivityReportAvailable creates the Test Network after
registering the ConnectivityDiagnosticsCallback. This ensures that the
callback is invoked only after the network is validated (not for the
on-register behavior).

- The TestNetworkInterface created while setting up the Test Network is
held onto for the duration of each test. This ensures that the interface
is not garbage collected during the test. While the interface is not
needed for the test, this change makes it clear when the interface is
cleaned up.

- All registered ConnectivityDiagnosticsCallbacks are unregistered at
the end of each test. This ensures that all accompanying NetworkRequests
are cleaned up. If NetworkRequests are leaked, unrelated test failures
can occur (the platform limits the number of NetworkRequests per UID).

Bug: 156294356
Bug: 148032944
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: I1836536fe60a65ba33170cd80e8f4996f1965d19
2020-06-22 16:03:15 +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
a28197e420 Merge "Add net-utils-framework-common to cts-net" into rvc-dev am: f1a476d61e am: 1b1f4cc178 am: 9f801155e2 am: 6af0878b00
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11931026

Change-Id: I62138c69bd5eacd7518fb41fb3a9e5d24f05d07c
2020-06-22 13:45:48 +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
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
90f54351ac Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev am: a530216c7d am: fd265a7858 am: d5f741e7af am: e1c185562e
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11835437

Change-Id: I8ca444753c0586404a4494a3df4e419036e48d19
2020-06-19 01:57:56 +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
a4896f95c1 Merge "Update DnsPacket package name" into rvc-dev am: 7703986e4c am: 946b09bb5c am: 19ed0f05f2 am: 5cd251ba4a
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11863010

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

Change-Id: Icb4ad50997ab906a484b58e4f1b91df2ebd6c729
2020-06-18 07:21:44 +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
8badddb04d Merge "Verify owner of IKEv2 VPNs" into rvc-dev 2020-06-17 15:26:22 +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
Treehugger Robot
ffe449ac54 Merge "Toggle wifi when running CaptivePortalTest" am: 1ae290c1a6 am: 5f38f3067d am: 909eeeed43 am: 73f9a5063b am: a1c99d2018
Original change: https://android-review.googlesource.com/c/platform/cts/+/1336114

Change-Id: If915365510cdd47b6c4796ddce01fa0999114192
2020-06-16 01:53:51 +00: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
1ae290c1a6 Merge "Toggle wifi when running CaptivePortalTest" 2020-06-16 00:43:07 +00:00
Benedict Wong
82dc776f15 Merge "Verify owner of IKEv2 VPNs" am: a330e50192 am: 7f63ec96d9 am: ed0ddfc96c am: 8324c6660c am: b27aadc00e
Original change: https://android-review.googlesource.com/c/platform/cts/+/1326393

Change-Id: I6b582289688dbfa40f6b3f4bce4244527271346d
2020-06-15 17:54:29 +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
a330e50192 Merge "Verify owner of IKEv2 VPNs" 2020-06-15 17:09:46 +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
2e0648a758 Merge "Bump CtsNetTestCasesLatestSdk to target SDK 30." into rvc-dev am: d69d28f755 am: 6c56cf06e3 am: 3d5228c19d am: eff4bb36ab
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11850382

Change-Id: I2c78a6eb6b2511f026af622f64b7c7c5246291ba
2020-06-15 12:16:33 +00:00
TreeHugger Robot
eff4bb36ab Merge "Bump CtsNetTestCasesLatestSdk to target SDK 30." into rvc-dev am: d69d28f755 am: 6c56cf06e3 am: 3d5228c19d
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/11850382

Change-Id: I2b2853be306c9b761e93fa41094fd1e849e26335
2020-06-15 12:04:01 +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
Treehugger Robot
42b94813bd Merge "Fix CtsTetheringTest on devices without permanent softAp interfaces." am: 10f23078c1 am: 9d3ae2e188 am: 174f529ce4 am: d55432238a am: f5a50c1258
Original change: https://android-review.googlesource.com/c/platform/cts/+/1331096

Change-Id: I73d245ed8c3fc58462a082ecf0852bf28539ac17
2020-06-15 11:03:36 +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
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
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
c4c06f9e91 Merge "Fix MultinetworkApiTest fail problem in instant mode" am: 3475b733b5 am: 59fdc91b04 am: c0a62623af am: 86e056dd01 am: ba61f51a7f
Original change: https://android-review.googlesource.com/c/platform/cts/+/1326955

Change-Id: Ic8fa1421b1092efdb011a124836d9f466a231f43
2020-06-11 01:37:16 +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
3475b733b5 Merge "Fix MultinetworkApiTest fail problem in instant mode" 2020-06-11 00:22:51 +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
49698e8d36 Merge "Fix tests that failed on devices without IPsec tunnel feature" am: 08a29ff260 am: fdf0db07d9 am: 0ec5b40aa5 am: 2d59aa499a am: ea5bca5dab
Original change: https://android-review.googlesource.com/c/platform/cts/+/1322980

Change-Id: Id0eb9e8aa4cf50aec69a479113bc9dd277de7051
2020-06-09 20:22:44 +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
08a29ff260 Merge "Fix tests that failed on devices without IPsec tunnel feature" 2020-06-09 18:56:32 +00:00