Commit graph android_packages_modules_Co.../tests/common/java/android
Message SHA1
Merge "Add enterpriseSpecifier"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-12-23 22:25:20 +00:00
fbe500351e
Add enterpriseSpecifier
Add enterpriseSpecifier to network capability

Bug: 194332512
CTS-Coverage-Bug: 211133973
Test: CTS and unit test.
Change-Id: If16c8e17cee71cc6788c43a8818bcca68a00bf99

Sooraj Sasindran   commited 2021-12-23 09:32:20 -08:00
4196937bdd
Merge "Revert "Revert "Unhide IpPrefix(InetAddress, int)"""
Taras Antoshchuk   authored and   Gerrit Code Review   commited 2021-12-23 12:41:23 +00:00
37ff6df023
Merge "Revert "Revert "Unhide RouteInfo#getType and related fields"""
Taras Antoshchuk   authored and   Gerrit Code Review   commited 2021-12-23 12:41:23 +00:00
839cb2692e
Revert "Revert "Unhide IpPrefix(InetAddress, int)""
This reverts commit 758ead6dd3.

Reason for revert: Re-landing changes not related to postsubmit failure

Change-Id: I2f705549d85af4ba45dc294e0a86d757490b1cd7

Taras Antoshchuk   commited 2021-12-19 11:54:56 +00:00
3bbbffe133
Revert "Revert "Unhide RouteInfo#getType and related fields""
This reverts commit 6d1ea2bb16.

Reason for revert: Re-landing changes not related to postsubmit failure

Change-Id: If7940801518be5ddec91270b3663ddfc8b42eadb

Taras Antoshchuk   commited 2021-12-19 11:51:39 +00:00
2b3d62f3e9
Revert "Unhide IpPrefix(InetAddress, int)"
Revert "Add APIs that allow to exclude routes from VPN"

Revert "Suppress NewApi warnings for @SystemApi -> public APIs"

Revert "Add VpnServiceBuilderShim for VpnService.Builder"

Revert submission 1551943-vpn-impl

Reason for revert: <DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=mainline_modules_x86_64-userdebug&lkgb=8007224&lkbb=8008168&fkbb=8007902 >, bug b/210979001
Reverted Changes:
I0e7aa077a:Add VpnServiceBuilderShim for VpnService.Builder
Ib12f5ab39:Suppress NewApi warnings for @SystemApi -> public ...
I59b9185cf:Unhide RouteInfo#getType and related fields
Ie5b62b2b2:Unhide IpPrefix(InetAddress, int)
I993a32d40:Add CTS tests for exclude VPN routes APIs
Ib24b2d3fb:Suppress NewApi warnings for @SystemApi -> public ...
Ic3b10464a:Add APIs that allow to exclude routes from VPN

Change-Id: Id0c373fb042a98c1c68807acf7fcfe456520ebe2
BUG: 210979001

Ayush Sharma   commited 2021-12-16 14:40:13 +00:00
758ead6dd3
Revert "Unhide RouteInfo#getType and related fields"
Revert "Add APIs that allow to exclude routes from VPN"

Revert "Suppress NewApi warnings for @SystemApi -> public APIs"

Revert "Add VpnServiceBuilderShim for VpnService.Builder"

Revert submission 1551943-vpn-impl

Reason for revert: <DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=mainline_modules_x86_64-userdebug&lkgb=8007224&lkbb=8008168&fkbb=8007902 >, bug b/210979001
Reverted Changes:
I0e7aa077a:Add VpnServiceBuilderShim for VpnService.Builder
Ib12f5ab39:Suppress NewApi warnings for @SystemApi -> public ...
I59b9185cf:Unhide RouteInfo#getType and related fields
Ie5b62b2b2:Unhide IpPrefix(InetAddress, int)
I993a32d40:Add CTS tests for exclude VPN routes APIs
Ib24b2d3fb:Suppress NewApi warnings for @SystemApi -> public ...
Ic3b10464a:Add APIs that allow to exclude routes from VPN

Change-Id: I98d3b998e4702f56e9d5e17944238b283b29f2b2
BUG: 210979001

Ayush Sharma   commited 2021-12-16 14:40:13 +00:00
6d1ea2bb16
Genericize NC#hasSameUids
This will be used by another set of UIDs in a future patch

Test: FrameworksNetTests
Change-Id: I2c5d18ef93e73b702723814592ef3f3baf5dfbc4

Chalard Jean   commited 2021-12-16 23:03:42 +09:00
f4802fa4c2
Remove NetworkCapabilities#combine*
This is no longer used outside of tests, and can be safely
removed.

Also this family of methods is fairly confusing, as while
it's well defined for some members, many later additions
had to be written so as to dissallow some combinations when
the workings of this family of methods didn't match the
semantics of some members, making them possibly dangerous
to use and at least exhibit difficult to understand semantics.

Test: FrameworksNetTests
      m
Change-Id: Ia69c20afa16c2153839891f6e33331caa9da33ff

Chalard Jean   commited 2021-12-13 21:15:34 +09:00
bdf4f2987d
Unhide IpPrefix(InetAddress, int)
Unhide IpPrefix constructor to allow its usage with the new
VpnService.Builder#excludeRoute(IpPrefix) method.

Bug: 186082280
Test: atest IpPrefixTest
Change-Id: Ie5b62b2b206def1be53a41219681b4a8bc06c1d2

Taras Antoshchuk   commited 2021-12-13 11:11:00 +01:00
a5a1b80222
Unhide RouteInfo#getType and related fields
Bug: 186082280
Test: atest RouteInfoTest
Change-Id: I59b9185cf4f8f2afd691b49cf6b4659fe36e6bf8

Taras Antoshchuk   commited 2021-12-13 11:11:00 +01:00
62065db8d1
Fix NetworkCapabilitiesTest on S
Mark NetworkCapabilitiesTest as ConnectivityModuleTest so that it is
only run in MTS with the Connectivity module installed, and fix
parceling tests to use the right number of fields in that case.

NetworkCapabilitiesTest is only useful to test the Connectivity module,
and not other modules like NetworkStack, as it is a unit test of a class
in the Connectivity module.

Bug: 205901761
Test: atest NetworkCapabilitiesTest
Change-Id: I10ba0f866bc7a39b2c90bdde12a79feefea2d5ee

Remi NGUYEN VAN   commited 2021-11-11 12:30:07 +09:00
daa03defee
Add new APIs in NetworkCapabilities to set and get underlying networks
Previously, the caller can only know about the transport type of
the underlying network. The information might not be enough if
the device support WiFi STA+STA.
Thus, provide an API for the caller to get the correct underlying
network.

Bug: 191918368
Test: atest FrameworksNetTests:NetworkCapabilitiesTest
Change-Id: I7752b2356770f4572f6ca4cbaecaa45c09d6d72f

lucaslin   commited 2021-10-15 18:07:12 +08:00
8b2dfa7c02
Merge "Separate test into reasonable multiple tests" am: 26a7e61417
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1793478

Change-Id: I9193477c6744c6f9a1f7e7e14e0c98e4348b262d

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-09-07 03:01:39 +00:00
33076dddff
Merge "Merge sc-dev-plus-aosp-without-vendor@7634622" into stage-aosp-master
Xin Li   authored and   Android (Google) Code Review   commited 2021-08-17 18:15:09 +00:00
e534ce4c55
Separate test into reasonable multiple tests
The test actually verifies multiple behaviors and mutates the
networkCapabilities. Thus, refactor the method to keep the
tests easier to follow up.

Bug: 191918212
Test: atest android.net.NetworkCapabilitiesTest
Change-Id: Ibad1a0569d26d92f94153bee323cef5a1c30d8d4

Chiachang Wang   commited 2021-08-17 16:02:09 +08:00
d525a64ead
Fix NetworkCapabilities MTS on S, CTS on S+module
restrictCapabilitiesForTestNetwork was renamed after S release to be
included in a mainline release, but this causes the MTS test to fail on
S if the Connectivity module is not updated, and CTS to fail if the
connectivity module is updated.

Mark the test as @ConnectivityModuleTest so it can be skipped on
non-connectivity module MTS tests (such as NetworkStack tests), and add
back the previous method name to keep CTS passing.

Bug: 196755836
Test: atest NetworkCapabilitiesTest
Change-Id: Ibd6c2e62e5949ec6d93e9f6e4fc05129c29b94f8

Remi NGUYEN VAN   commited 2021-08-16 18:03:37 +09:00
5b8e2e9935
Merge sc-dev-plus-aosp-without-vendor@7634622
Merged-In: I5a33f959c8ae5a34584f57508f392038e44062e7
Change-Id: Ib4e5e75ee8bbe19806bdc2f69590d164fb75774b

Xin Li   commited 2021-08-14 06:31:05 +00:00
3ec4468fb7
The net cap value should be bit shifted before &ing
The check intends to do the bit & operation. The net cap value
should be shifted against the original capabilities.

Also fix the typo in the method name.

Bug: 191918212
Test: atest FrameworksNetTests
Change-Id: I98396b2538f36fe8b29d27a544a2dfb3060bc9c5

Chiachang Wang   commited 2021-08-11 14:55:00 +08:00
c07315aa08
Temporarily disable the test since prebuilt module is not updated am: c42a54f2a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15328937

Change-Id: I46fb4cad43fee89a6d4453c84db867cfc6374493

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-07-21 03:04:50 +00:00
d92c090c61
Temporarily disable the test since prebuilt module is not updated
This CL is subject to be reverted in a few days when the prebuilt
Connectivity module is updated.

Ignore-AOSP-First: This is for sc-dev and its downstreams only
Test: android.net.NetworkProviderTest
Bug: 189074532
Change-Id: I512552400960668c0ba91a8d997d1e2747209538

Junyu Lai   commited 2021-07-20 05:58:08 +00:00
c42a54f2a7
Consider NetworkOffer is unneeded if it cannot satisfy the request
Currently, to prevent from network connect-teardown-loops that
caused by inaccurate reports, e.g. the provider always provides
a better network than the offer, the NetworkOffer is considered
needed if its provider is currently serving the request. This
is because there is no accurate way to know whether the offer is
corresponding to the network that is currently serving the
request.

However, if the offer cannot even satisfies the request, consider
the offer is needed does not make any sense. Since it can
never be the one that currently serving the request, nor be
the one that might beat current satisfier.

Test: android.net.NetworkProviderTest
Bug: 189074532
Original-Change: https://android-review.googlesource.com/1731452
Merged-In: Ie3ea59f980c3767782b8e6b03e401c02f664f9bd
Change-Id: Ie3ea59f980c3767782b8e6b03e401c02f664f9bd

Junyu Lai   commited 2021-07-20 05:43:44 +00:00
135f50679f
Merge "Use TRANSPORT_USB from the SDK" am: ca688d62d3 am: 048ef34b88
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1764734

Change-Id: I7ff0480df0d7997ea68422d1fe315fa94c5a0556

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-07-15 09:02:04 +00:00
1e79e9322b
Use TRANSPORT_USB from the SDK
Stop using the stopgap TRANSPORT_USB from NetworkCapabilitiesUtil, which
is being removed.

Bug: 184158327
Test: atest NetworkCapabilitiesTest
Change-Id: I6bbb35d39ff67d6f53b389689dc9f1067e64f962

Remi NGUYEN VAN   commited 2021-07-14 16:35:11 +09:00
732584bcb8
Ignore checking TRANSPORT_USB when Android version is older than S
There is a new transport type - TRANSPORT_USB(8) in Android S,
so when the test tries to add this new transport type in older
Android version, it cannot pass the transport type validation and
make test fail.

(clean cherry-pick of change in downstream branch history)
Original change ID before project move:
I38816173b04ea198d99f64f45e9271ac2641e4ac

Bug: 184158327
Test: run CtsNetTestCasesLatestSdk on Android R & Q
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Change-Id: Ib0368241771d287c09c0e4463f91122533f85a27

lucaslin   authored and   Remi NGUYEN VAN   commited 2021-07-14 16:28:58 +09:00
eadb0add66
Merge "Consider NetworkOffer is unneeded if it cannot satisfy the request" am: b028fc7cf1 am: ce077a3ad0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731452

Change-Id: Iaff7fca5582c454e651e1ca8042d28968a0148c1

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-07-05 09:27:16 +00:00
8b1a98ff38
Merge "Consider NetworkOffer is unneeded if it cannot satisfy the request"
Junyu Lai   authored and   Gerrit Code Review   commited 2021-07-05 08:57:07 +00:00
b028fc7cf1
Apply jarjar rules on coverage tests
Apply their respective jarjar rules on tethering and general
connectivity tests, then merge both into the coverage tests suite.
This is necessary to ensure that classes covered by tests have names
matching classes used in code.

Also fix IpConnectivityLogTest to use the module utility instead of the
hidden BitUtils, as the test would fail after internal utils are
jarjared.

Bug: 187935317
Test: atest ConnectivityCoverageTests TetheringCoverageTests
Original-Change: https://android-review.googlesource.com/1749680
Merged-In: Ib95b58dab93f7adebc445b662a6d15db1ce0e7c2
Change-Id: Ib95b58dab93f7adebc445b662a6d15db1ce0e7c2

Remi NGUYEN VAN   commited 2021-07-05 05:02:05 +00:00
0b3f20a64d
Merge "Apply jarjar rules on coverage tests" am: d590b30f72 am: 073f6e299a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1749680

Change-Id: I80209723541bdfb8f5b08cd5e9cf0e76afa3593e

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-07-01 01:08:32 +00:00
4a980eebf5
Apply jarjar rules on coverage tests
Apply their respective jarjar rules on tethering and general
connectivity tests, then merge both into the coverage tests suite.
This is necessary to ensure that classes covered by tests have names
matching classes used in code.

Also fix IpConnectivityLogTest to use the module utility instead of the
hidden BitUtils, as the test would fail after internal utils are
jarjared.

Bug: 187935317
Test: atest ConnectivityCoverageTests TetheringCoverageTests
Change-Id: Ib95b58dab93f7adebc445b662a6d15db1ce0e7c2

Remi NGUYEN VAN   commited 2021-06-30 16:00:26 +09:00
8ea5ee6d33
Consider NetworkOffer is unneeded if it cannot satisfy the request
Currently, to prevent from network connect-teardown-loops that
caused by inaccurate reports, e.g. the provider always provides
a better network than the offer, the NetworkOffer is considered
needed if its provider is currently serving the request. This
is because there is no accurate way to know whether the offer is
corresponding to the network that is currently serving the
request.

However, if the offer cannot even satisfies the request, consider
the offer is needed does not make any sense. Since it can
never be the one that currently serving the request, nor be
the one that might beat current satisfier.

Test: android.net.NetworkProviderTest
Bug: 189074532
Change-Id: Ie3ea59f980c3767782b8e6b03e401c02f664f9bd

Junyu Lai   commited 2021-06-28 12:44:31 +00:00
dc3a7a39d4
Merge "Add ConnectivitySettingsManagerTest" into sc-dev
Paul Hu   authored and   Android (Google) Code Review   commited 2021-06-23 16:29:20 +00:00
a244f13f21
Add ConnectivitySettingsManagerTest
- Add tests for ConnectivitySettingsManager.
- Also address leftover javadoc comments.

Bug: 182538166
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases
Original-Change: https://android-review.googlesource.com/1738353
Merged-In: I8161c1bca84b41964578d59ee5d6ab07b2380707
Change-Id: I8161c1bca84b41964578d59ee5d6ab07b2380707

paulhu   commited 2021-06-23 20:02:27 +08:00
0903f73e1f
Add basic tests for InvalidPacketException
The test simply verify the constructor. They only apply on S+ as
InvalidPacketException is not updatable before S.

Bug: 187935317
Test: atest InvalidPacketExceptionTest
Original-Change: https://android-review.googlesource.com/1742076
Merged-In: I33f1ee1702672204a46063e6e75c3880d5e7600b
Change-Id: I33f1ee1702672204a46063e6e75c3880d5e7600b

Remi NGUYEN VAN   commited 2021-06-23 09:16:59 +00:00
bdd448e641
Move ConnectivityDiagnosticsManagerTest to common
The tests are also useful in CTS to ensure that the
ConnectivityDiagnosticsManager class API is implemented properly
(including behavior of the DataStallReport class for example).

Bug: 187935317
Test: atest ConnectivityDiagnosticsManagerTest
Original-Change: https://android-review.googlesource.com/1742075
Merged-In: I86f39238054f43403f9a1e383dd2a935de84f06f
Change-Id: I86f39238054f43403f9a1e383dd2a935de84f06f

Remi NGUYEN VAN   commited 2021-06-23 09:16:53 +00:00
b5f0819d35
Merge "Add basic tests for InvalidPacketException" am: eb0a4b41f8 am: b1eee18493
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1742076

Change-Id: Ia8e3933f3abe69565e1b3e91fa38fff6ce0d36c5

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-06-23 06:30:05 +00:00
2370c7cdf4
Merge "Add basic tests for InvalidPacketException"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-06-23 05:32:52 +00:00
eb0a4b41f8
Merge "Move ConnectivityDiagnosticsManagerTest to common" am: ef21082033 am: cb88733c59
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1742075

Change-Id: I5a0959b0dacbed1662a7852ad8d191cfa57c57e4

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-06-23 03:11:12 +00:00
5b20059b56
Add basic tests for InvalidPacketException
The test simply verify the constructor. They only apply on S+ as
InvalidPacketException is not updatable before S.

Bug: 187935317
Test: atest InvalidPacketExceptionTest
Change-Id: I33f1ee1702672204a46063e6e75c3880d5e7600b

Remi NGUYEN VAN   commited 2021-06-23 11:33:10 +09:00
bf44f6200e
Merge "Move ConnectivityDiagnosticsManagerTest to common"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-06-23 02:31:03 +00:00
ef21082033
Merge "Add ConnectivitySettingsManagerTest" am: 6160d60b2e am: f37dd31334
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1738353

Change-Id: I239c14543f6948cb729424008054317b28bb9647

Paul Hu   authored and   Automerger Merge Worker   commited 2021-06-23 02:08:49 +00:00
977a013d10
Add ConnectivitySettingsManagerTest
- Add tests for ConnectivitySettingsManager.
- Also address leftover javadoc comments.

Bug: 182538166
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases
Change-Id: I8161c1bca84b41964578d59ee5d6ab07b2380707

paulhu   commited 2021-06-22 03:00:51 +00:00
236a992cd0
Add CTS for registerNetworkOffer
Test: android.net.NetworkProviderTest on R/S device
Bug: 189074532

Original-Change: https://android-review.googlesource.com/1731451
Merged-In: Ic3ab3c487d8a9b5a9508b59f83ae35672307b933
Change-Id: Ic3ab3c487d8a9b5a9508b59f83ae35672307b933

Junyu Lai   commited 2021-06-21 14:18:34 +00:00
cdb727ed50
Merge "Add CTS for registerNetworkOffer" am: f92979bd5b am: 26bb0a84a6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731451

Change-Id: I07371bcb29bd2646d9b72396a92e5c397e4a1f16

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-06-21 13:57:37 +00:00
11ccd1531f
Move ConnectivityDiagnosticsManagerTest to common
The tests are also useful in CTS to ensure that the
ConnectivityDiagnosticsManager class API is implemented properly
(including behavior of the DataStallReport class for example).

Bug: 187935317
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: I86f39238054f43403f9a1e383dd2a935de84f06f

Remi NGUYEN VAN   commited 2021-06-21 19:33:28 +09:00
7e23f18158
Add CTS test for API setLegacyExtraInfo
Adding in-depth test in NetworkAgentTest
Bug: 187040803
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkAgentConfigTest
      atest CtsNetTestCases:android.net.NetworkAgentConfigTest
Original-Change: https://android-review.googlesource.com/1719131
Merged-In: Ief14f6de0cb6913da944414f0b134eb04346425f
Change-Id: Ief14f6de0cb6913da944414f0b134eb04346425f

Frank Li   commited 2021-06-17 13:00:57 +00:00
b7eebde98a
Fix expectCallback does not fail when no callback received
This hides 3 bugs where,
  1. In Android S, onNetworkRequested is no longer broadcasted
     by ConnectivityService in any condition. However, the test
     still passes since assertion does not fail when no callback
     received. Ignore the test on S+ devices since the behavior
     changed on S or later devices.
  2. Test network agent is not registered, but the test still
     passes.
  3. Test network agent does not fulfill the request that kept
     the network up, so the test fails since the test network
     is not needed and be torn down.

Test: android.net.NetworkProviderTest on R/S device
Bug: 189074532
Merged-In: I627dcd0f57b6ef4197d16e6c1ec0c53e675ab055
Change-Id: I627dcd0f57b6ef4197d16e6c1ec0c53e675ab055
  (cherry-picked from aosp/1731450)

Junyu Lai   commited 2021-06-17 09:03:11 +00:00
52e3fa127a
Merge changes I627dcd0f,I81abc174,Id7948d21 am: 75090fb64e am: 93b8b38683
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731450

Change-Id: I5588db4e540440e08f62c90d7369fb308a02b2f6

Junyu Lai   authored and   Automerger Merge Worker   commited 2021-06-16 12:14:22 +00:00
8aa17e2a6a
Add CTS for registerNetworkOffer
Test: android.net.NetworkProviderTest on R/S device
Bug: 189074532

Change-Id: Ic3ab3c487d8a9b5a9508b59f83ae35672307b933

Junyu Lai   commited 2021-06-15 08:17:32 +00:00
f20360649f