Commit Graph

2451 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
9980f77bc2 Merge "Allow connectivity tests to use hidden APIs" into sc-dev 2021-04-02 02:18:51 +00:00
Remi NGUYEN VAN
eeeed136e0 Allow connectivity tests to use hidden APIs
The tests have been building against hidden APIs to provide additional
coverage.

Test: m TetheringCoverageTests CtsNetTestCases
Bug: 182859030
Ignore-AOSP-First: needs manual cherry-picks
Change-Id: I37d748411a34f25834214a2412c49aed1423e526
2021-04-01 06:37:53 +00:00
Sudheer Shanka
fd8bfb3f97 Merge "Revert NPMS threshold to BFGS." into sc-dev 2021-03-30 17:51:52 +00:00
lifr
ac6614fa05 Add session ID to VpnTransportInfo
- This will be visible only to apps with the NETWORK_SETTINGS
  permissions (signature), and will be redacted for all other callers.
- This string is expected to be the same as set by
  VpnService#setSession, and in general, VpnConfig.session. But it
  will be a general API that Vpn.java can call when setting the
  VpnTransportInfo.
- This string cannot be updated once the VPN NetworkAgent is connected.

Bug: 171872481
Ignore-AOSP-First: needed to prevent automerger race breaking build
Test: atest ConnectivityServiceTest
      atest VpnTransportInfoTest
      atest NetworkAgentTest
Change-Id: I883035262465238c35c5a931d89707f3e84feef8
2021-03-29 14:51:25 +00:00
Sudheer Shanka
384fb5cb42 Revert NPMS threshold to BFGS.
Earlier, we changed the threshold to IMP_FG to allow
HPJs to bypass power saving network restrictions but
later we made a change to instead use network capability
for HPJs, so reverting the threshold to BGFS.

Bug: 177641226
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Ignore-AOSP-First: This depends on an earlier cl which is not in AOSP
Change-Id: I6364ca04254bdbcc3d2081a70babfbd927e0084e
2021-03-26 13:25:58 -07:00
Lorenzo Colitti
cb938eca7b Mark most VpnServiceTest methods as @AppModeFull. am: 60b26ee453 am: f7ff930e3a am: 29ab4cfc4a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1648190

Change-Id: I2e0c1d036bd8907df22eb98fa3d4a1218c5cfdc0
2021-03-22 19:55:59 +00:00
Sudheer Shanka
0d8452ab81 Merge "Try reconnecting to wifi if it doesn't automatically connect." into sc-dev 2021-03-22 17:12:30 +00:00
Lorenzo Colitti
f7ff930e3a Mark most VpnServiceTest methods as @AppModeFull. am: 60b26ee453
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1648190

Change-Id: I6fcb53be747a5e95d58f2d84b16214cf9607a3d0
2021-03-22 15:29:05 +00:00
Lorenzo Colitti
60b26ee453 Mark most VpnServiceTest methods as @AppModeFull.
In S, instant apps can no longer access the system service that
backs the VPN APIs, so these tests started to fail in instant
mode.

Regardless of that change in S, though, instant apps cannot
create VPNs because they cannot access the package manager.

Previously, the tests were only passing because they did not
check that the VPN would actually work, they only checked that
the VPN API calls failed.

Fix: 181575083
Test: atest --instant CtsNetTestCases:VpnServiceTest
Change-Id: Idd35051bd1c908a8b85c02e8d0c54d3dea2dde38
2021-03-22 13:16:02 +00:00
Treehugger Robot
bf0c19e52f Merge "Revert^2 "Replace the usage of UidRange"" 2021-03-21 16:41:13 +00:00
Sudheer Shanka
2b5735165a Shorten the name for the dump file.
The file name is getting truncated by tradefed and
we are missing the information to actually idenity
the test. So, instead shorten the filename to preserve
the test name.

Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Ignore-AOSP-First: Submitting internally first to avoid merge conflicts.
Change-Id: Ic0f87b97bb58e115fe81e2d688ce0e633397da42
2021-03-21 12:24:09 +00:00
Remi NGUYEN VAN
cc305b2fa5 Move connectivity AIDLs to android.net
java_sdk_libraries and apexes need to contain bootclasspath classes
under predefined packages. Tethering currently uses android.net, so make
sure all the connectivity bootclasspath classes are under android.net.

This avoids maintaining two packages for the tethering APEX, where
com.android.connectivity.aidl is only used by internal AIDL files.

Bug: 182984842
Test: m
Change-Id: I23feb26c5de2fd7a4177797a3bc1d0dcbef4ade7
Merged-In: I23feb26c5de2fd7a4177797a3bc1d0dcbef4ade7
2021-03-20 22:24:08 +09:00
Sudheer Shanka
aae0d619ae Try reconnecting to wifi if it doesn't automatically connect.
When meteredness of wifi changes during test, wifi disconnects.
Try reconnecting if it automatically connects after this.
Also, change the way we update metereness so that we can
use callback mechanism to wait for the state change instead of
polling for it regularly.

Bug: 181686645
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Ignore-AOSP-First: Submitting internally first to avoid merge conflicts
Change-Id: I31fb127ef333d39fe4697043876c7cef15d525e3
2021-03-20 04:36:47 -07:00
Remi NGUYEN VAN
66a8357ede Merge "Move connectivity AIDLs to android.net" into sc-dev 2021-03-19 10:51:22 +00:00
Remi NGUYEN VAN
9cb8dfc110 Move connectivity AIDLs to android.net
java_sdk_libraries and apexes need to contain bootclasspath classes
under predefined packages. Tethering currently uses android.net, so make
sure all the connectivity bootclasspath classes are under android.net.

This avoids maintaining two packages for the tethering APEX, where
com.android.connectivity.aidl is only used by internal AIDL files.

Bug: 182984842
Test: m
Ignore-AOSP-First: needs manual cherry-pick
Change-Id: I23feb26c5de2fd7a4177797a3bc1d0dcbef4ade7
2021-03-19 08:57:00 +00:00
Chiachang Wang
2fb0846d70 Revert^2 "Replace the usage of UidRange"
274c796731

The parameter of NetworkCapabilities.setUids() and
NetworkRequest.Builder.setUids() are updated to take a set of
integer Range instead of a set of UidRange because of refactor
work for the incoming connectivity mainline module.

The parameter change stops NetworkRequestTest to work in the
different API levels. Replace the usage with shims to work in
both current and stable APIs.

Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk

Change-Id: I7d18402f051051371f3054f6897b05b6da072105
Merged-In: I4bc0daf5ad9e4b4043f4a897ddab16aec8f8a536
2021-03-19 02:10:06 +00:00
Chiachang Wang
41918d6cd1 Replace the usage of UidRange
The parameter of NetworkCapabilities.setUids() and
NetworkRequest.Builder.setUids() are updated to take a set of
integer Range instead of a set of UidRange because of refactor
work for the incoming connectivity mainline module.

The parameter change stops NetworkRequestTest to work in the
different API levels. Replace the usage with shims to work in
both current and stable APIs.

Ignore-AOSP-First: Prevent race in automerger
Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: I4bc0daf5ad9e4b4043f4a897ddab16aec8f8a536
2021-03-19 00:51:19 +00:00
Anthony Stange
ed43a3d28d Merge "Revert "Replace the usage of UidRange"" am: 83f77d83fd am: 0f97255402 am: abc4b59c47
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1645769

Change-Id: I7182b6f373405d7e12f92f29e7cbaf4ab66b8a13
2021-03-18 18:23:31 +00:00
Anthony Stange
abc4b59c47 Merge "Revert "Replace the usage of UidRange"" am: 83f77d83fd am: 0f97255402
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1645769

Change-Id: I86886953ab47f4d176b11d64a915e637559b3987
2021-03-18 17:41:40 +00:00
Anthony Stange
83f77d83fd Merge "Revert "Replace the usage of UidRange"" 2021-03-18 16:40:53 +00:00
Anthony Stange
274c796731 Revert "Replace the usage of UidRange"
Revert "Replace the usage of UidRange"

Revert "Add shims for NetworkRequest"

Revert submission 1626206-replaceUidRange

Reason for revert: Breaking build - b/183106405
Reverted Changes:
I0b79c73e8:Add shims for NetworkRequest
I4bc0daf5a:Replace the usage of UidRange
I4e5aec6ef:Replace the usage of UidRange
I107c329d4:Expose uids related APIs in NetworkRequest and Net...

Change-Id: I5a4addc562d180487e2891fd2081c593126e6ffc
2021-03-18 16:30:59 +00:00
Chiachang Wang
871e5043d3 Merge "Replace the usage of UidRange" am: 1241156261 am: 73a03e9ca8 am: 54bf54b774
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1597481

Change-Id: I3998c164b05983a4f4528ed5bef8089e89868d3f
2021-03-18 15:12:52 +00:00
Chiachang Wang
54bf54b774 Merge "Replace the usage of UidRange" am: 1241156261 am: 73a03e9ca8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1597481

Change-Id: I82fadd50f3141dab679d361cd17bf7a1f4349e9c
2021-03-18 14:28:24 +00:00
Chiachang Wang
1241156261 Merge "Replace the usage of UidRange" 2021-03-18 13:36:39 +00:00
Chalard Jean
1be69c5bb6 Merge "Fix a bug where any() returns null" am: 3a1932cd79 am: dea6a318db am: 3f46774f42
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1640139

Change-Id: Ie5f6b41c8025940a1897a2fec5feb2bc605b4d8b
2021-03-18 12:04:13 +00:00
Chalard Jean
3f46774f42 Merge "Fix a bug where any() returns null" am: 3a1932cd79 am: dea6a318db
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1640139

Change-Id: I07d5c7f5e2a49cf7229176abc398f4f138351920
2021-03-18 11:14:37 +00:00
Chalard Jean
3a1932cd79 Merge "Fix a bug where any() returns null" 2021-03-18 09:59:21 +00:00
Remi NGUYEN VAN
48aac8f642 Merge "Remove networkAttributes resource usage" am: 584cfc6b67 am: 5916c38d92 am: 13e433b63e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1639708

Change-Id: Ia59896f5fb23f4bdd07641485c516f30bde7588f
2021-03-17 13:17:06 +00:00
Remi NGUYEN VAN
13e433b63e Merge "Remove networkAttributes resource usage" am: 584cfc6b67 am: 5916c38d92
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1639708

Change-Id: Ib09dccf181d2d9fa9cf31e8da3d4ee7454d2dc68
2021-03-17 12:34:22 +00:00
Remi NGUYEN VAN
584cfc6b67 Merge "Remove networkAttributes resource usage" 2021-03-17 11:24:28 +00:00
Kimberly Kreider
38e41e4404 Merge "Enable networking tests to be included in partial MTS files as well as full mts." am: 6f4d35119f am: 8266302ee7 am: 17eae52145
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1531141

Change-Id: Ic16ee449e5eec1e947ac215d5aa27845c0e2e675
2021-03-17 03:48:42 +00:00
Kimberly Kreider
17eae52145 Merge "Enable networking tests to be included in partial MTS files as well as full mts." am: 6f4d35119f am: 8266302ee7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1531141

Change-Id: Id1fc29e6bfcc8422a2a2b8b0f609035b6ab9ae09
2021-03-17 03:07:27 +00:00
Kimberly Kreider
6f4d35119f Merge "Enable networking tests to be included in partial MTS files as well as full mts." 2021-03-17 02:23:54 +00:00
Chalard Jean
1705798d13 Fix a bug where any() returns null
The type needs to be specified

Test: NetworkAgentTest
Change-Id: I7128ae520cb7175f1fb9467a94edfd1a4bdeb9da
2021-03-16 21:49:29 +09:00
Remi NGUYEN VAN
f1c04fb6b3 Remove networkAttributes resource usage
Supported network types are now deduced from system features, not the
networkAttributes resource.
Update the test to expect network types to be configured as per
resources before S, and to match system features on S+.

Bug: 146206136
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Change-Id: I715924d562f439f7239c1c95d2dc5bca7095a123
2021-03-16 16:54:17 +09:00
Chalard Jean
9ade183256 Merge "[NS01.cn] Adjust calls for NetworkScore" am: bc786632cf am: 1834461387 am: 830216e3f8
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1620870

Change-Id: Id40e21d52e0c8bd059f91004b69f5993652c7b54
2021-03-16 07:11:40 +00:00
Chalard Jean
830216e3f8 Merge "[NS01.cn] Adjust calls for NetworkScore" am: bc786632cf am: 1834461387
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1620870

Change-Id: Ib4318c685e4dd62ce68004041551e26437a8a631
2021-03-16 07:07:59 +00:00
Chalard Jean
bc786632cf Merge "[NS01.cn] Adjust calls for NetworkScore" 2021-03-16 06:36:07 +00:00
Lorenzo Colitti
71a25a49ff Merge "Fix NullPointerException when running testRequestBackgroundNetwork" am: 25e4e50f25 am: 79cd256ec2 am: 6643be3850
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1635299

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie3cf6439b4d2873cc12a8c0a79b815db83f4c483
2021-03-15 15:09:22 +00:00
Lorenzo Colitti
ecada021e7 Merge "Fix NullPointerException when running testRequestBackgroundNetwork" am: 25e4e50f25 am: 79cd256ec2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1635299

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iefc6962434fd20ed37c13904227ebc0cc9ee04f4
2021-03-15 14:25:23 +00:00
lucaslin
bfaefe42d1 Fix NullPointerException when running testRequestBackgroundNetwork
aosp/1622675 made handler to be nonnull but
testRequestBackgroundNetwork still pass null as handler when
calling requestBackgroundNetwork, so there is a NullPointerException
when running testRequestBackgroundNetwork.

Bug: 175662146
Test: atest CtsNetTestCases:ConnectivityManagerTest#testRequestBackgroundNetwork
Change-Id: I871992549dfc8cc356221164f1dd49c64f0dae67
2021-03-15 18:49:10 +08:00
Chalard Jean
1fc092ac59 [NS01.cn] Adjust calls for NetworkScore
Test: NetworkAgentTest
Change-Id: I67b7adb867ec0fdb4ef17f00edd518836b69c8f3
2021-03-15 09:50:03 +00:00
Chiachang Wang
c1f14634a4 Replace the usage of UidRange
The parameter of NetworkCapabilities.setUids() and
NetworkRequest.Builder.setUids() are updated to take a set of
integer Range instead of a set of UidRange because of refactor
work for the incoming connectivity mainline module.

The parameter change stops NetworkRequestTest to work in the
different API levels. Replace the usage with shims to work in
both current and stable APIs.

Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: I4bc0daf5ad9e4b4043f4a897ddab16aec8f8a536
2021-03-15 10:04:08 +08:00
Remi NGUYEN VAN
ce2ab07074 Merge "Rename StringNetworkSpecifier to Ethernet" 2021-03-11 23:51:49 +00:00
Sudheer Shanka
f3774740d1 Merge "Skipping printing AssumptionViolatedExceptions." am: b94021ab6e am: 188fa60f90 am: 391af8dda0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1620820

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If3858650d6c90212384c982a8d916e622d16f712
2021-03-10 15:44:15 +00:00
Sudheer Shanka
bc0bb0fe3f Merge "Skipping printing AssumptionViolatedExceptions." am: b94021ab6e am: 188fa60f90
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1620820

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7e5bbaf02285a87b9887301227ebe8f91f7d4dd2
2021-03-10 14:58:12 +00:00
Remi NGUYEN VAN
be88fae8a3 Merge "Rename StringNetworkSpecifier to Ethernet" into sc-dev 2021-03-09 22:43:46 +00:00
Remi NGUYEN VAN
dd128f6ea3 Rename StringNetworkSpecifier to Ethernet
Tests just need a specifier to verify general NetworkSpecifier
functionality. They can use EthernetNetworkSpecifier the same way they
use StringNetworkSpecifier.

To keep the tests passing on Q and R, add a CompatUtil class that will
keep creating StringNetworkSpecifiers (now removed) instead.

Bug: 179329291
Test: atest CtsNetTestCases
Ignore-AOSP-First: Must be merged manually downstream first
Change-Id: Ic6bf611ba36b555e4e0bb1bd3fa0053fe29dc8cf
2021-03-09 22:42:51 +00:00
Lorenzo Colitti
86b0a68b2e Use NET_CAPABILITY_NOT_VCN_MANAGED from ConstantsShim.
This is required to build in mainline-prod, which does not have
access to in-progress S APIs.

Bug: 167645754
Ignore-AOSP-First: already in AOSP
Test: m NetworkStack CtsNetTestCasesLatestSdk CtsHostsideNetworkTests CtsHostsideNetworkTestsApp
Change-Id: I1f234454e1e5ac4aa4d8828a2fb192c4cd18add9
(cherry picked from commit 7246474dfd)
2021-03-08 12:01:24 +00:00
Sudheer Shanka
c19cd34a35 Skipping printing AssumptionViolatedExceptions.
Right now, if there are any failures along with
the cases where we skip the test, we end up printing
failure exception and all AssumptionViolatedExceptions
which makes it hard to find the actual failures.

Bug: 181686645
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: Ib3f1622fc259ad4966789cfafdc54203c2559471
2021-03-05 09:30:34 +00:00