Commit Graph

8062 Commits

Author SHA1 Message Date
Lorenzo Colitti
06513c4cd2 Merge "Pass in proper NetworkCapabilities in testSetUnderlyingNetworks." am: 78f7c04770
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1518566

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie50ba58b6d067fdcaf18df5593898afef11a0aa3
2020-12-09 02:16:48 +00:00
Lorenzo Colitti
78f7c04770 Merge "Pass in proper NetworkCapabilities in testSetUnderlyingNetworks." 2020-12-09 00:11:23 +00:00
Lorenzo Colitti
977464ef5a Pass in proper NetworkCapabilities in testSetUnderlyingNetworks.
The CL that introduced testSetUnderlyingNetworks allowed tests to
pass in NetworkCapabilities when registering an agent, but
incorrectly always set the agent's capabilities anyway. This
resulted in testSetUnderlyingNetworks registering an agent with
TRANSPORT_VPN and NET_CAPABILITY_NOT_VPN.

Fix this by ensuring that createNetworkAgent either uses the
passed-in capabilities unmodified, or creates its own. Assert
that the test VPN network does not have NET_CAPABILITY_NOT_VPN.

While I'm at it, remove the manual unregistration of the callback
by using the registerNetworkCallback helper method.

Also add a little bit of extra test coverage.

Bug: 173331190
Test: test-only change
Change-Id: I114d876a1b2bf5344dd7c6fa23862df1c0a412c3
2020-12-08 01:15:32 +09:00
Remi NGUYEN VAN
7fc54e7294 Set noparent in connectivity CTS owners am: d01761e07f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1516266

Change-Id: I7e6e9d5cbf2ac3d22bcfde2faeeac4ac0b61ec4f
2020-12-03 10:11:05 +00:00
Remi NGUYEN VAN
d01761e07f Set noparent in connectivity CTS owners
Also reorganize the files to have one toplevel CTS owners file, and only
additional owners in subdirectories.

Change-Id: I28ce193896e1ade2034589327805870774a4d608
Test: m
2020-12-03 08:07:32 +00:00
Lorenzo Colitti
6bd26a9f30 Merge "Add a CTS test for NetworkAgent#setUnderlyingNetworks." am: 7d04b2a26c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1511114

Change-Id: I27f049c42e03d5ce4958ab3f94346c57f858db86
2020-11-28 03:20:41 +00:00
Lorenzo Colitti
7d04b2a26c Merge "Add a CTS test for NetworkAgent#setUnderlyingNetworks." 2020-11-28 02:49:53 +00:00
Lorenzo Colitti
7b4b6f40a8 Merge changes I82811a97,Ic508b17e,I23ca7980 am: e74700dd5d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1512851

Change-Id: I480d4d7cea8d6009ef71e0bf30f6d7a18dd99783
2020-11-27 10:44:42 +00:00
Treehugger Robot
59ecc20061 Merge "Fix race condition in NetworkWatchListTest" am: de39ae42ac
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1511070

Change-Id: I14fa977efaf51d591409a8a4c2c547bba7d8bed1
2020-11-27 10:44:33 +00:00
Lorenzo Colitti
e74700dd5d Merge changes I82811a97,Ic508b17e,I23ca7980
* changes:
  Add OWNERS for packages/modules/Connectivity.
  Add repo hooks for packages/modules/Connectivity.
  Add a .gitignore in packages/modules/Connectivity.
2020-11-27 10:33:30 +00:00
Treehugger Robot
de39ae42ac Merge "Fix race condition in NetworkWatchListTest" 2020-11-27 10:12:05 +00:00
Lorenzo Colitti
3657ce9cda Add a CTS test for NetworkAgent#setUnderlyingNetworks.
Bug: 173331190
Test: atest CtsNetTestCases:NetworkAgentTest#testSetUnderlyingNetworks
Change-Id: I442a618d2d50eb15dbcb8926b60fc6fd0d5b2f3e
2020-11-27 18:09:24 +09:00
Lorenzo Colitti
99fcd0bbf8 Add OWNERS for packages/modules/Connectivity.
Specify the owners here instead of including them from other
places (e.g., frameworks/base, NetworkStack) because we hope that
this project will eventually contain all the code.

Test: none
Change-Id: I82811a9758480f16654145c4d55ef784be09de2b
2020-11-27 18:09:24 +09:00
Lorenzo Colitti
a7d3c79a76 Add repo hooks for packages/modules/Connectivity.
This adds the Java and Kotlin linters.

Test: repo upload
Change-Id: Ic508b17ed0b4e33c41debbbeb7a6c0406c46a973
2020-11-27 18:09:24 +09:00
Lorenzo Colitti
1fb77ae003 Add a .gitignore in packages/modules/Connectivity.
Test: None
Change-Id: I23ca7980db01b3f32e94876fa9a0b3952cf29914
2020-11-27 18:09:21 +09:00
Remi NGUYEN VAN
9d29736aea Merge "Add TEST_MAPPING config for CTS postsubmit" am: d4430d28ba
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1509694

Change-Id: Id6c5b6d1150a0c30a55cbaafc7cdbcad56263bb3
2020-11-27 08:56:54 +00:00
Remi NGUYEN VAN
d4430d28ba Merge "Add TEST_MAPPING config for CTS postsubmit" 2020-11-27 08:42:31 +00:00
Alan Stokes
36529b250a Fix race condition in NetworkWatchListTest
We were running cp to create a file and then running a command to read
the file. However were weren't waiting for the cp to finish (or,
indeed, start), so occasionally the read would fail saying the file
didn't exist.

Also added some logging, because diagnosing failure without it is
painful. Also simplify & improve file closing logic.

Some of this was previously submitted on internal master as change
I1c875102f0cce32cbbe2e3b36de913741c9abb92, but I've reverted that in
favor of this.

Bug: 168216494
Test: atest CtsNetTestCases:android.net.cts.NetworkWatchlistTest
Change-Id: I46a9db8b7a1885a9829f00bbd3233b863cfd1f5d
2020-11-26 14:27:39 +00:00
Treehugger Robot
8f501fea9c Merge "Tune up TIMEOUTs of IPSec CTS for low end devices" am: 1de9621925
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1498276

Change-Id: I0c22f28721ee625c86912459a14860b6d6a859ea
2020-11-25 20:23:12 +00:00
Treehugger Robot
1de9621925 Merge "Tune up TIMEOUTs of IPSec CTS for low end devices" 2020-11-25 19:56:50 +00:00
Remi NGUYEN VAN
1bc6287249 Add TEST_MAPPING config for CTS postsubmit
The new configuration runs tests on physical devices with SIM cards.
This is only done in postsubmit, as such tests can only run a few (~2) times a day due to
availability of the devices.

This configuration allows running all tests, so there is no annotation filter.

Change-Id: If95e4deeed8098327023f99e6e610331b8e86a0f
Test: TH validates TEST_MAPPING configurations
2020-11-25 18:27:48 +08:00
Junyu Lai
3e5a3ed5d5 Merge changes from topic "TrafficStats.getTxRxBytes" am: 42fbb57b31
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1490181

Change-Id: I93a1a017b55c30ba08da434a05c1335719ffcbcd
2020-11-25 04:14:47 +00:00
junyulai
34fe3e48e4 Add CTS for getTx/RxBytes in TrafficStats am: 549cc56731
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1490180

Change-Id: Id02aa1ab9038287da16594d513368935408ed8c5
2020-11-25 04:14:46 +00:00
Junyu Lai
42fbb57b31 Merge changes from topic "TrafficStats.getTxRxBytes"
* changes:
  Exclude lingering traffic from loopback iface stats check
  Add CTS for getTx/RxBytes in TrafficStats
2020-11-25 02:35:20 +00:00
Chalard Jean
a56ea8445c Merge "This bug was fixed in S, don't test for it in R" am: d639d12161
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1505171

Change-Id: I80515e22a2434f5deb6001d77c7cad79d9f92615
2020-11-24 09:51:51 +00:00
Chalard Jean
d639d12161 Merge "This bug was fixed in S, don't test for it in R" 2020-11-24 07:01:57 +00:00
Chalard Jean
e90c48c9aa This bug was fixed in S, don't test for it in R
Bug: 172401665
Test: CtsNetTestCasesLatestSdk
Change-Id: Ib9fb3ec09eeaebbb4ac1b1b458cfcc5c4f506cff
2020-11-20 17:54:26 +09:00
Cody Kesting
38cda37e44 Merge "Use READ_PHONE_STATE when checking Carrier Configs." am: b9e51da2e8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1489639

Change-Id: I84dedf9b3ff80d837f7b1fcd4a608e45db6afa00
2020-11-17 18:39:43 +00:00
Cody Kesting
b9e51da2e8 Merge "Use READ_PHONE_STATE when checking Carrier Configs." 2020-11-17 17:54:09 +00:00
Yintang Gu
5c39147e5a Tune up TIMEOUTs of IPSec CTS for low end devices
Ikev2VpnTest#testStartStopVpnProfileV4 and testStartStopVpnProfileV6
contains the IKE sequences and requires the phone to send and receive
the required packet in 1000ms.
On some low end devices, the response time may exceeds this TIMEOUT
sometimes.
So we need to use larger timeouts.

Bug: 171176723
Change-Id: I005b83ffecd8ade5063000690bfd4136d82f1a07
2020-11-13 10:43:31 +08:00
Treehugger Robot
107b0a0745 Merge "Add an owner for NetworkWatchlistTest." am: 4eda64baca
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1492980

Change-Id: Icbadae3abb93626916d0d5533d515767e424a9b8
2020-11-12 13:31:55 +00:00
Treehugger Robot
4eda64baca Merge "Add an owner for NetworkWatchlistTest." 2020-11-12 13:02:46 +00:00
Treehugger Robot
85dfa5cae0 Merge "Use ACCESS_WIFI_STATE when clearing wifi blacklist" am: f5ae03550a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1490016

Change-Id: I0ce24470417b17ad94f11c6dcdfd4e9d1587df81
2020-11-12 06:10:21 +00:00
Treehugger Robot
58ae094ec7 Merge "Use CONNECTIVITY_INTERNAL on Q for portal URL" am: 2a7cf08b8e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1490178

Change-Id: Ie871b98591231d2f92a87e023dfb2249a9f5d2ff
2020-11-12 06:10:07 +00:00
Treehugger Robot
f5ae03550a Merge "Use ACCESS_WIFI_STATE when clearing wifi blacklist" 2020-11-12 05:36:38 +00:00
Treehugger Robot
2a7cf08b8e Merge "Use CONNECTIVITY_INTERNAL on Q for portal URL" 2020-11-12 05:35:20 +00:00
paulhu
cd34630e6b Fix tethering doesn't turn off issue am: 862c8a1ea0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1484019

Change-Id: I58cad341b3ac7623ae7303f66bb95b057485a8c6
2020-11-10 15:19:39 +00:00
Alan Stokes
108f82b463 Add an owner for NetworkWatchlistTest.
Test: N/A
Change-Id: Icfbeaf60e1ff98d29c449b9fcc43c0e5ce39a20e
2020-11-10 11:36:30 +00:00
paulhu
862c8a1ea0 Fix tethering doesn't turn off issue
When user restriction turns on, all tethering functions should
be disabled. But tethering functions still work after
restrication is on. Because tethering request would be removed
from mActiveTetheringRequests after starting tethering that
will result in Tethering#isTetheringActive() always returns
false. Thus, update the design to check tethered interface to
ensure that any of tethering function is working.

Bug: 169596583
Test: atest TetheringTests
Test: Manually test that tethering function would be disabled
      and notification would show to user after restriction
      was on.
Change-Id: Icb9649a5ecdec2d029ac763b5b9b80042ad50eb9
2020-11-10 16:47:52 +08:00
junyulai
42ea4318f7 Exclude lingering traffic from loopback iface stats check
Lingering traffic from previous tests are only happens in
non-loopback interface. Stats gets from loopback interface
would not see them. Thus, exclude them from in-range check.

Test: atest TrafficStatsTest --rerun-until-failure 100
Bug: 164965653
Change-Id: Ic15c4c2e27f86b5711ada904c22734206c67d671
2020-11-10 10:11:14 +08:00
Nikita Ioffe
b2bfb81567 Merge "com.android.tethering: set min_sdk_version 30" am: 06bf173b20
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1489717

Change-Id: I652a8be5f230b1e88474e6944dc4a3306db896e9
2020-11-09 05:34:45 +00:00
Mark Chien
668adf955c Merge "Fix null DadProxy failure in R Tethering unit test" am: 220e7854bd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1485808

Change-Id: I5d40f774391b43b51c8945ca93c8d34a3b8312d2
2020-11-09 05:34:12 +00:00
Luke Huang
f904b98507 Fix minor bug and deflaky for DnsResolverTest am: fcabfc688d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1486780

Change-Id: I4283722e9600588b703c68f6170bb668cfa5eea2
2020-11-09 05:33:43 +00:00
junyulai
549cc56731 Add CTS for getTx/RxBytes in TrafficStats
Test: atest TrafficStatsTest
Bug: 164965653
Change-Id: Ic3d253bbd036f40781d4f2706a67fb145ab4a575
2020-11-09 11:59:39 +08:00
Baligh Uddin
6a41dd4d8e Merge history of CTS
BUG: 167962976
Test: TH
Merged-In: I30d52c4df571c894b7797300e8f56ddd4b2cc2dd
Change-Id: Id343f5a31604abfe70140343bffab20503cd2705
2020-11-09 02:17:15 +00:00
Baligh Uddin
667aeac161 Merge "Merge history of CTS" into stage-aosp-master 2020-11-09 01:58:08 +00:00
Cody Kesting
a9bdde8881 Use READ_PHONE_STATE when checking Carrier Configs.
This CL Updates ConnectivityDiagnosticsManagerTest to explicitly use
the READ_PHONE_STATE permission when checking Carrier Configs for the
specified subId.

Bug: 169739061
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: I2307d7b03bcf9a918904a89be86777872a759293
2020-11-06 10:22:48 -08:00
Nikita Ioffe
06bf173b20 Merge "com.android.tethering: set min_sdk_version 30" 2020-11-06 12:46:39 +00:00
Mark Chien
220e7854bd Merge "Fix null DadProxy failure in R Tethering unit test" 2020-11-06 11:00:19 +00:00
Remi NGUYEN VAN
78cb3a9de0 Use CONNECTIVITY_INTERNAL on Q for portal URL
getCaptivePortalServerUrl requires CONNECTIVITY_INTERNAL or
MAINLINE_NETWORK_STACK on Q, and NETWORK_SETTINGS or
MAINLINE_NETWORK_STACK on R+.

Use CONNECTIVITY_INTERNAL on Q instead of NETWORK_SETTINGS to test it.

Bug: 172626873
Test: atest CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Change-Id: I03309de945b198ad9b40d51d799d2619bb3179ea
2020-11-06 16:14:37 +09:00