Commit Graph

4207 Commits

Author SHA1 Message Date
Lorenzo Colitti
a86ff10ecf Merge "Increase ConnDiagsTest timeout for end-to-end test." 2020-06-26 07:13:56 +00:00
Cody Kesting
c8d9a5706e 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
Change-Id: I36347f6d52e3ce1bd30e3f74c35f4ecd15c8c65e
2020-06-26 07:13:45 +00:00
Cody Kesting
ee8feba3c1 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
Merged-In: I1836536fe60a65ba33170cd80e8f4996f1965d19
2020-06-25 01:07:48 +00:00
Luke Huang
10fa0790d9 Merge "Add net-utils-framework-common to cts-net" 2020-06-24 18:41:18 +00:00
Luke Huang
1ef852ef06 Merge "Update DnsPacket package name" 2020-06-24 18:39:56 +00:00
Cody Kesting
5c2e383949 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
Merged-In: Id867b8dcaca758cfeb83009848e1099e900a0790
2020-06-24 07:59:36 -07:00
Luke Huang
1eebfa3d87 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
(clean cherry-pick from internal branch)
Merged-In: I40e2d4c4945a0579f6e1923e4722b09354ff050c
Change-Id: I40e2d4c4945a0579f6e1923e4722b09354ff050c
2020-06-24 11:39:56 +00:00
Luke Huang
d9daaff707 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
(clean cherry-pick from internal branch)
Merged-In: I908cb5f7bc6150e461748c8e34c92a19aa0206e4
Change-Id: I908cb5f7bc6150e461748c8e34c92a19aa0206e4
2020-06-24 19:38:10 +08:00
Lorenzo Colitti
c7f94d5052 Merge "CTS test ConnectivityDiagnostics via CarrierPrivilegesTracker." 2020-06-22 04:41:43 +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
1ae290c1a6 Merge "Toggle wifi when running CaptivePortalTest" 2020-06-16 00:43:07 +00:00
Benedict Wong
a330e50192 Merge "Verify owner of IKEv2 VPNs" 2020-06-15 17:09:46 +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
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
Treehugger Robot
3475b733b5 Merge "Fix MultinetworkApiTest fail problem in instant mode" 2020-06-11 00:22:51 +00:00
Treehugger Robot
08a29ff260 Merge "Fix tests that failed on devices without IPsec tunnel feature" 2020-06-09 18:56:32 +00:00
Luke Huang
23710588f9 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"

Change-Id: I8ecadd134824a4023a3c6e173d52ba088d46b103
2020-06-10 00:51:39 +08:00
Treehugger Robot
5469352727 Merge "Reset vpn provision status" 2020-06-09 04:06:06 +00:00
Benedict Wong
9d1f86f3a8 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
Change-Id: Iabf2859c289aa86ec38aea1edcc1fb248b9d0d26
2020-06-08 14:19:14 -07:00
evitayan
ce3c9ae278 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
2020-06-08 11:07:02 -07:00
Xin Li
cacd78fef9 Merge changes from topic "QQ3A.200605.002_merge"
* changes:
  Convert Android.mk to Android.bp for CVE-2018-9536
  Merge QQ3A.200605.002 into master
2020-06-06 01:41:30 +00:00
Lucas Lin
fbf126a6f8 Merge "Enlarge the onAvailable callback timeout to 30 seconds" 2020-06-05 08:53:49 +00:00
Treehugger Robot
10944b6376 Merge "Add CtsNetTestCasesLatestSdk to postsubmit" 2020-06-05 04:38:40 +00:00
lucaslin
072e96ebdf 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
Change-Id: Ie89936ecc2d70ee22dd312067ccedd2523e81855
2020-06-05 02:55:22 +00:00
Remi NGUYEN VAN
f33b6ea261 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
Change-Id: I48b2b5490d3fd5eb6f9456825c11f3fee0ec5b67
2020-06-05 09:57:11 +09:00
Chiachang Wang
abf0c1d1e6 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
Change-Id: I4856cfc7ddfd70125c513a4201132256704d1a66
2020-06-04 12:52:31 +08:00
Treehugger Robot
fce5f45653 Merge "Fix CtsNetUtils connectTo/disconnectFromWifi" am: d99c455167
Original change: https://android-review.googlesource.com/c/platform/cts/+/1322428

Change-Id: I0483ab9f30828c328be8d8edb2a12234a156f5f9
2020-06-03 07:42:11 +00:00
Treehugger Robot
d99c455167 Merge "Fix CtsNetUtils connectTo/disconnectFromWifi" 2020-06-03 07:21:49 +00:00
Remi NGUYEN VAN
7deca3e618 Fix CtsNetUtils connectTo/disconnectFromWifi
connectToWifi needs to clear the wifi networks blacklist before calling
reconnect(), otherwise wifi may not reconnect if the previous network
was blacklisted.

disconnectFromWifi should not wait for a onLost callback if wifi was
already disconnected.

Test: atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Test: atest CtsNetApi23TestCases
Bug: 150949391
Change-Id: I244b91bdd8708694fce9f10d92b8b6646d28188f
2020-06-03 15:05:25 +09:00
Treehugger Robot
ba1290b755 Merge "Remove dependency on kotlin-reflect" am: 9bbb79f173
Original change: https://android-review.googlesource.com/c/platform/cts/+/1322415

Change-Id: I7d0d10a0fbd59dea4f9dfa70081a7ce1b514a251
2020-06-03 00:25:55 +00:00
Remi NGUYEN VAN
247548cc30 Merge "Skip Ikev2VpnTest on Q" am: bdfc18bc1e
Original change: https://android-review.googlesource.com/c/platform/cts/+/1322414

Change-Id: I3cff2faf1e67d98ad8b5406fbbd7a69ea86d46c6
2020-06-03 00:25:42 +00:00
Treehugger Robot
9bbb79f173 Merge "Remove dependency on kotlin-reflect" 2020-06-03 00:19:37 +00:00
Remi NGUYEN VAN
bdfc18bc1e Merge "Skip Ikev2VpnTest on Q" 2020-06-03 00:13:16 +00:00
Treehugger Robot
fbd2113de5 Merge "Fix TetheringManagerTest failure when using entitlement required SIM" am: 1691078821
Original change: undetermined

Change-Id: I4c58b3803a13271dfd45103fbd32a3a8e3238aff
2020-06-02 02:51:01 +00:00
Treehugger Robot
1691078821 Merge "Fix TetheringManagerTest failure when using entitlement required SIM" 2020-06-02 02:35:43 +00:00
Remi NGUYEN VAN
eef04c75ce Remove dependency on kotlin-reflect
While local runs pass, kotlin-reflect.jar is not found on the test
infrastructure. Depending on that library does not make the test much
more simple.

Bug: 156062304
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalApiTest
Change-Id: I6691a07ef8d6c63e68cb78813a5e3e499ef897df
2020-06-02 11:01:58 +09:00
Remi NGUYEN VAN
539bfc16ee Skip Ikev2VpnTest on Q
The Ikev2 VPN feature was introduced in R.

Bug: 150904735
Test: atest CtsNetTestCasesLatestSdk:Ikev2VpnTest
Change-Id: I51ded6e967291c110ff0bbd18a3631ab9a742e74
2020-06-02 10:51:55 +09:00
Cody Kesting
2a898a5d7a Merge "Test Data Stall with unknown detection type." am: 43fbab7444
Change-Id: If62bf0f152893d904b79320354267db1ce3cc320
2020-05-29 21:30:41 +00:00
Cody Kesting
0b07d517bc Merge "Add CTS testing for ConnectivityDiagnostics Data Stall callback." am: f665174aaa
Change-Id: Ie6259540b61f8bc4dc53da9fe2fb899a154c171e
2020-05-29 21:29:59 +00:00
Cody Kesting
43fbab7444 Merge "Test Data Stall with unknown detection type." 2020-05-29 20:46:59 +00:00
Cody Kesting
f665174aaa Merge "Add CTS testing for ConnectivityDiagnostics Data Stall callback." 2020-05-29 20:44:42 +00:00
Cody Kesting
55a841b153 Merge "Add CTS tests for ConnectivityDiagnostics callbacks." am: 21763671f4
Change-Id: I71342f839fe9f8e6ebc9b130c5246ca22ff336d3
2020-05-29 19:56:23 +00:00
Benedict Wong
e2fda73ecb Merge changes from topic "vpn-cts" am: c75e8886ed
Change-Id: Ie1e0bd4029ebc2d2c8843d451f74785e21fc050c
2020-05-29 19:56:11 +00:00
Cody Kesting
21763671f4 Merge "Add CTS tests for ConnectivityDiagnostics callbacks." 2020-05-29 19:49:06 +00:00
Benedict Wong
c75e8886ed Merge changes from topic "vpn-cts"
* changes:
  Add IPv6 testing for IKEv2 VPN tests
  Add Ikev2VpnTests including IKE negotiation.
  Add basic tests for IKEv2/IPsec VPNs
  Extract IPsec and test network utility methods
2020-05-29 18:51:26 +00:00
Benedict Wong
3d95958d01 Add IPv6 testing for IKEv2 VPN tests
This change adds tests for IPv6 IKEv2 VPN profiles.

Bug: 148582947
Test: IPv6 tests passing
Change-Id: Ic0f71df739bd9162653b5f2878e7ddc446ddde0e
2020-05-29 02:28:07 -07:00
Remi NGUYEN VAN
8116784031 Merge "Add CTS test for the capport API" am: b0d3cd455c
Change-Id: Ieec3bd1d21daddcbac98114857d44cf9eb93fa10
2020-05-29 07:56:58 +00:00
markchien
f74fce0d0c Fix TetheringManagerTest failure when using entitlement required SIM
If run tethering cts with entitlement required SIM, the test would
failure due to no tethering upstream. Tethering would default start
with UI base entitlement check which would have interfactive UI pop
up. Tethering's upstream is blocked because entitlement UI is keep
waiting for action till timeout.
To avoid UI interaction, start tethering with silent entitlement
check.

Bug: 156714671
Test: atest CtsTetheringTest
Change-Id: I85299841d60afba97ffcc4ae908a85e51139319b
2020-05-29 11:53:34 +08:00
Remi NGUYEN VAN
b0d3cd455c Merge "Add CTS test for the capport API" 2020-05-29 00:35:24 +00:00