Commit Graph

4567 Commits

Author SHA1 Message Date
android-build-team Robot
df678100ba Snap for 6687127 from d86b80fc72c30a835387fa34ffc1ff3f6cd766cc to rvc-release
Change-Id: Ib79e62a413600173542552bf468cd5f8a7946149
2020-07-17 01:16:37 +00:00
Remi NGUYEN VAN
bd340d8912 Merge "Auto-configure wifi on virtual devices" into rvc-dev 2020-07-16 13:25:51 +00:00
TreeHugger Robot
47b8426932 Merge "Add CtsNetTestCasesLatestSdk to mainline-presubmit" into rvc-dev 2020-07-16 02:48:20 +00:00
Remi NGUYEN VAN
10980d136c Auto-configure wifi on virtual devices
At the moment tests run on virtual devices through TEST_MAPPING do not
necessarily have wifi configured to auto-connect to a test SSID.

This could be fixed by adding a TargetPreparer in AndroidTest.xml with a
given SSID, but that configuration would then apply to all runs,
including local ones. There is also no good way to apply a preparer that
configures wifi "if it is not already connected": WifiPreparer in
particular will not configure wifi even if just a mobile network is
active.

Implement auto-configuration in CtsNetUtils#connectToWifi so that if no
network is configured, and a virtual SSID is detected when scanning,
that SSID will be added to the list of configured networks. This allows
addressing the issue until TEST_MAPPING can support configuring wifi,
with minimal side-effects on other runs.

Test: atest CtsNetTestCasesLatestSdk:CaptivePortalTest
Bug: 158153057
Change-Id: I47df4c325b073f8a9bf320894245eed211606952
2020-07-16 10:07:37 +09:00
android-build-team Robot
b83151727c Snap for 6676900 from 3100b16907360af0618e7303563503c881dc7b84 to rvc-release
Change-Id: I3504eafb0df01623a096b442d460f12f4646cb33
2020-07-14 01:07:47 +00:00
TreeHugger Robot
79b592dd26 Merge "Don't run testRequestLatestEntitlementResult if not supported" into rvc-dev 2020-07-13 16:04:39 +00:00
Mark Chien
1e19cd613f Don't run testRequestLatestEntitlementResult if not supported
If tethering is not supported, skip testRequestLatestEntitlementResult
which test TetheringManager#requestLatestTetheringEntitlementResult
API.

Bug: 159869957
Test: atest CtsTetheringTest
Merged-In: I65c32d5bc26f18f8c9d91593ab0c178e69e75c39
Change-Id: I65c32d5bc26f18f8c9d91593ab0c178e69e75c39
2020-07-13 02:52:45 +00:00
android-build-team Robot
347e21366d Snap for 6671561 from e27c2d254440b4d75c87ef4947553eadf7151922 to rvc-release
Change-Id: I9ad92d4c733a3e63b8d77f820dffc5bebf8a5ada
2020-07-11 01:07:37 +00:00
Chalard Jean
b6f64fb76c Ignore non-matching callbacks to fix flakiness
This is a host-side tests that receives its network callbacks
through a custom AIDL that proxies them to this host-side
process. As this runs of the real callbacks from a real network,
this test receives unrelated callbacks – in particular calls to
onCapabilitiesUpdated to warn the process of updates of the
signal strength.
This skips these callbacks across the board by only matching
the expected callback. This will fix flakiness in the test.

Also, as a drive-by fix, this also checks the network in
the onBlockedStatusChanged callback. If the network object
is not the expected one, the test should not pass.

Bug: 160270536
Test: NetworkCallbackTests
Original-Change: https://android-review.googlesource.com/1318219
Merged-In: I67c685ebfb2c5e2ee6f7615196eedea8292ca3ff
Change-Id: I67c685ebfb2c5e2ee6f7615196eedea8292ca3ff
2020-07-10 04:34:04 +00:00
easoncylee
d6d19a9d92 Add CtsNetTestCasesLatestSdk to mainline-presubmit
This is the pilot run for mainline testing in Test Mapping Suite.

For supporting mainline testing in Test Mapping Suite, developers can
run tests by configuring the TEST_MAPPING file, the 3 simple steps are:
  - Add tests to be part of general-tests suite if the test does not
    depend on a device specific features.
  - Update test configureation for TradeFed to run mainline testing.
  - Update TEST_MAPPING file with test-group as "mainline-presubmit"

It's only for postsubmit now, and will be moved to actual presubmit
once the whole mechanism is stable.

For more details about the usage, please refer to go/test-mapping-mainline-user-guide

Bug: 160753366
Test: forrest.
Change-Id: I8704cc5626a3e049eb3c27adb86e9c1a4d828273
Merged-In: I8704cc5626a3e049eb3c27adb86e9c1a4d828273
2020-07-10 10:34:12 +08:00
Treehugger Robot
eb41de1d35 Increase a timeout that's too short
This should have been longer to start with. This oversight is due
to a poor API in TestNetworkCallback that was made that way for
backwards compatibility ; b/157405399 tracks improving this API.

Test: this
Bug: 160660082
Original-Change: https://android-review.googlesource.com/1358064
Merged-In: If0587a2a91977427a2f679a502d838fbecdd82f2
Change-Id: If0587a2a91977427a2f679a502d838fbecdd82f2
2020-07-10 01:13:50 +00:00
android-build-team Robot
51126ac82e Snap for 6650198 from cbf0845a5dbfb09e120a1e23e1a43d6420a4a401 to rvc-release
Change-Id: Ibea18413fe82f780489151022ee77dd64689384c
2020-07-03 01:03:09 +00:00
Chalard Jean
8742267b94 Let testB141603906 run over ADB-over-network
This test (added in R) failed to take the adb-over-network
case into account like most other tests in the same file. As
such it erroneously fails when tested over such a test setup.
This patch exempts the shell from being subject to the VPN,
like other similar tests do, to avoid the adb connections
being killed.

Test: VpnTest
Bug: 159761399
Original-Change: https://android-review.googlesource.com/1349862
Merged-In: I0bc14d4d2cade7618c59b2cb88638bdf608d43d3
Change-Id: I0bc14d4d2cade7618c59b2cb88638bdf608d43d3
2020-07-01 23:16:54 +00:00
android-build-team Robot
75938574e6 Snap for 6634012 from 11d58914c588cf9dc1f8adefb876460f3017987a to rvc-release
Change-Id: I4f2665480356a6fbfc51f4a57077710a00ffdd98
2020-06-27 01:12:41 +00:00
Lorenzo Colitti
af7ca2d11f Increase ConnDiagsTest timeout for end-to-end test.
This change increases the delay allowed for administratorUid updates to
reach ConnectivityService in #testRegisterCallbackWithCarrierPrivileges.
Currently, there is no deterministic signal that can be used to wait for
this change, so Thread#sleep is required. This value is increased
because the previous delay did not give enough time for the
administratorUid change to reach CS, causing test flake.

Bug: 159718782
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Original-Change: https://android-review.googlesource.com/1349068
Merged-In: I36347f6d52e3ce1bd30e3f74c35f4ecd15c8c65e
Change-Id: I36347f6d52e3ce1bd30e3f74c35f4ecd15c8c65e
2020-06-26 08:18:39 +00:00
android-build-team Robot
eed2e2b9a8 Snap for 6626121 from e461ca99d7a2f37b3a0b1309bd750e7373045f44 to rvc-release
Change-Id: Ie072ed0921cc34522838e4e9a6b257399ecd1f46
2020-06-25 01:09:54 +00:00
Remi NGUYEN VAN
4feab037a5 Skip flaky CTS tests for presubmit
Skip testRegisterCallbackWithCarrierPrivileges and
testContinuousQueriesInline for presubmit, as they are highly flaky.
These tests are still run in postsubmit as part of MTS. In order to put
the CTS suite in presubmit as early as possible, add the annotation so
they are skipped in TEST_MAPPING.

Bug: 158153057
Bug: 159718782
Bug: 159762682
Test: m
Change-Id: I4763db869fbc714767ea5ca3651e4a0b0c9e9378
2020-06-24 06:02:27 +00:00
android-build-team Robot
382b1e6a9f Snap for 6617762 from 8e12d6b86aec86419d7bb8022d2aee8c93fe5d1f to rvc-release
Change-Id: I0ef2ce3172867f4de8211d1d9bd39b76f7f9a43c
2020-06-23 01:02:45 +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
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
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
android-build-team Robot
e63682a541 Snap for 6610691 from c174fb10332afdcece0dc33ce8c6d1a5b9d10ef9 to rvc-release
Change-Id: I7dad20798bd57fe8a85535ee1197dc3689305ec1
2020-06-20 01:13:07 +00:00
android-build-team Robot
cee51a84b8 Snap for 6606167 from d16053fe496c695f6b20901d89766c3763daa53a to rvc-release
Change-Id: I48562ee7fddac58c83041beeb8097dc7d04d2029
2020-06-19 01:03:19 +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
7703986e4c Merge "Update DnsPacket package name" into rvc-dev 2020-06-18 10:14:47 +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
android-build-team Robot
63c98de934 Snap for 6601700 from a0a201b735bbe3adaf84984b7b2a288fb9a66ff0 to rvc-release
Change-Id: I0a53cfe3d240540de587c18dede2bb24a024839f
2020-06-18 01:10:17 +00:00
TreeHugger Robot
8badddb04d Merge "Verify owner of IKEv2 VPNs" into rvc-dev 2020-06-17 15:26:22 +00:00
android-build-team Robot
317e6eeb3e Snap for 6596975 from c368711fcce3857dd473f85243377b7ad27a6dbc to rvc-release
Change-Id: If69c4db63e42d4f17b1d38bd4fb8b27fad42ee73
2020-06-17 01:07:50 +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
android-build-team Robot
e52ad06ca2 Snap for 6592941 from 61724720b0a3ab468d1a399b2023338b527a9c05 to rvc-release
Change-Id: Ia86338596cf610e4b11638610f26fae30c9661ee
2020-06-16 01:03:41 +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
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
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
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
android-build-team Robot
85b0be9be3 Snap for 6582636 from 70ba9ad724dad32a5ce5aa991e5e147f14206c43 to rvc-release
Change-Id: Ie428c18695969f7c852d2f050d05282dcd390d3f
2020-06-12 01:13:20 +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
android-build-team Robot
c134c605b5 Snap for 6578268 from 2c8ba6485c722f648f3a789dd661b0ccfb5ec396 to rvc-release
Change-Id: Icb463387e89edeed1f46152273f8422e37ab6bfa
2020-06-11 01:13:21 +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
android-build-team Robot
1e44184901 Snap for 6573866 from 2a3e73df0397a66a77ac1310c5df5754eb71b46e to rvc-release
Change-Id: I5d47b197b468a2705fd0497bd2cbd614096f0733
2020-06-10 01:08:45 +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
c5bad6f58c Reset vpn provision status
The vpn status of cts app is updated to be consented in this
tests which will impact the following test related to vpn.
Thus, reset the status after finishing the test.

Bug: 153760253
Test: atest CtsNetTestCasesLatestSdk
Merged-In: I4856cfc7ddfd70125c513a4201132256704d1a66
Change-Id: I4856cfc7ddfd70125c513a4201132256704d1a66
2020-06-09 05:40:49 +00:00
Lucas Lin
bac55b7eeb Enlarge the onAvailable callback timeout to 30 seconds
Sometimes the device may take a long time to connect to the wifi,
try to enlarge the timeout to lower the fail rate of test.

Bug: 157391946
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Original-Change: https://android-review.googlesource.com/1324092
Merged-In: Ie89936ecc2d70ee22dd312067ccedd2523e81855
Change-Id: Ie89936ecc2d70ee22dd312067ccedd2523e81855
2020-06-08 03:54:48 +00:00
android-build-team Robot
511c7265f6 Snap for 6565919 from dd6e7fffce37867dba429b4884e2d30273d1657e to rvc-release
Change-Id: Ie9155c286eb16cb3b5b7e11d36c45ec4a471efb3
2020-06-06 23:06:50 +00:00
Treehugger Robot
f0a78c385d Add CtsNetTestCasesLatestSdk to postsubmit
Also exclude some tests that cannot run on cuttlefish.
This is a first step to add the suite to presubmit. Having the test in
presubmit is essential to avoid regressions and keep it passing.

Bug: 158153057
Test: m CtsNetTestCases; this patch will provide postsubmit results
Original-Change: https://android-review.googlesource.com/1322430
Merged-In: I48b2b5490d3fd5eb6f9456825c11f3fee0ec5b67
Change-Id: I48b2b5490d3fd5eb6f9456825c11f3fee0ec5b67
2020-06-05 06:54:18 +00:00