Commit Graph

2858 Commits

Author SHA1 Message Date
Sudheer Shanka
a20e2702dd Merge "Recheck if the network state in expedited job is unexpected." into sc-dev am: 1ec983c471
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15191249

Change-Id: I02fb4442949afbe1b6ba4330f4986f7369f97851
2021-07-07 18:35:55 +00:00
Sudheer Shanka
1ec983c471 Merge "Recheck if the network state in expedited job is unexpected." into sc-dev 2021-07-07 18:20:02 +00:00
Sudheer Shanka
ce96fa05a7 Recheck if the network state in expedited job is unexpected.
Unfortunately, this could happen if there is a delay in updating the
network rules for the app hosting the job.

Bug: 179319857
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I60cfd5c5946a4cd0ef5ebf0c1e56b0667cc3164d
Ignore-AOSP-First: Expedited jobs are not available in AOSP yet
2021-07-07 18:19:50 +00:00
Paul Hu
f534ef200d Merge "Remove exclusivity restriction of multiple preferences" into sc-dev am: fd301c05c5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14731887

Change-Id: I99af87f0106609da19f93306a8c06b79d4634fed
2021-07-07 14:47:31 +00:00
Paul Hu
fd301c05c5 Merge "Remove exclusivity restriction of multiple preferences" into sc-dev 2021-07-07 14:36:22 +00:00
paulhu
de5efb90cb Remove exclusivity restriction of multiple preferences
- Each network preference has been assigned a priority value so
  that netd can know which uid range rule has higher priority. So
  remove the restriction that all network preferences are
  exclusive.
- Add priority check when getting request for uid.

Bug: 171872461
Test: atest FrameworksNetTests
Ignore-AOSP-First: Needs cherry-picks
Change-Id: I6912db753c8b4a194aa7af92b01ca6dcfec10d8b
2021-07-07 12:38:16 +08:00
Treehugger Robot
9cf3d2a8e6 add test for /system/etc/bpf/{netd,clatd}.o using correct struct sizes am: cba9f66098
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15217930

Change-Id: If33f5d605a5bc6fea760e5c42de74f91a4a21375
2021-07-07 02:17:34 +00:00
Treehugger Robot
cba9f66098 add test for /system/etc/bpf/{netd,clatd}.o using correct struct sizes
This test is required to ensure that the system is compatible
with future updates of the tethering mainline module, which
updates BPF .o files on device.

This test must already be passing on OEM devices because otherwise
the offload.o program in the Tethering mainline module would bootloop
the device.

Bug: 190519702
Test: atest CtsNativeNetTestCases, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Original-Change: https://android-review.googlesource.com/1756440
Merged-In: Ibaedb8fcb28591ffba1506514f2305d55712a26b
Change-Id: Ibaedb8fcb28591ffba1506514f2305d55712a26b
2021-07-06 21:13:24 +00:00
Remi NGUYEN VAN
f1dfc9cd6a Merge changes from topic "am-cc17cb7d48ea4bd7adc9183dc0c381e3-sc-dev" into sc-dev am: 0f956db686
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15165007

Change-Id: I498d487fbf36f16f9757f6ba42e3c44c68b205a5
2021-07-06 03:04:28 +00:00
Remi NGUYEN VAN
e6fa71092c Re-skip connectivity unit tests before S am: fda49a5f17
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15165006

Change-Id: I97b4ed4f8ec54a75396dbbebe964568054809786
2021-07-06 03:04:25 +00:00
Treehugger Robot
04352ea573 Move ConnectivityCoverageTests to general-tests am: bd01bbaa92
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15165005

Change-Id: I76cdbf70a8cc38c1e1d59dabce20c1df129fe341
2021-07-06 03:04:23 +00:00
Remi NGUYEN VAN
0e586ad73a Fix ConnectivityManagerTest initialization on Q am: a6c016a65d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15165004

Change-Id: I4c208ed755696483fed3797d25aa3536a8d49ec5
2021-07-06 03:04:21 +00:00
Treehugger Robot
e32bc089be Move test_mainline_modules to AndroidTest.xml am: fb34c5861a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15165003

Change-Id: I8c39006cbe24964a277f7c45eed861836fcaf9b2
2021-07-06 03:04:18 +00:00
Remi NGUYEN VAN
4f4bf8d05b Add ConnectivityCoverageTests to postsubmit am: 1c45a8a623
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15165002

Change-Id: Ic58bad518f0239e3cbfcfaac4e51048a86c5d3cd
2021-07-06 03:04:15 +00:00
Remi NGUYEN VAN
a620f9ef6e Add connectivity coverage tests am: 168b3d19f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14873769

Change-Id: I27e4004d35491d99f4fe53de5edacaea47954aa7
2021-07-06 03:04:13 +00:00
Remi NGUYEN VAN
ce711c422e Make tests compatible with mockito-extended am: ad8f23fef4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15165000

Change-Id: I8e5ea50c0ff34a069681d878c3f8668d92cfae2b
2021-07-06 03:04:11 +00:00
Remi NGUYEN VAN
c97783e308 Fix KeepalivePacketDataUtilTest crash on eng build am: 8f260383f7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15164999

Change-Id: I64c9bd2da7cbfd6d6c254287309e0738201c336f
2021-07-06 03:04:09 +00:00
Remi NGUYEN VAN
0f956db686 Merge changes from topic "am-cc17cb7d48ea4bd7adc9183dc0c381e3-sc-dev" into sc-dev
* changes:
  Apply jarjar rules on coverage tests
  Re-skip connectivity unit tests before S
  Move ConnectivityCoverageTests to general-tests
  Fix ConnectivityManagerTest initialization on Q
  Move test_mainline_modules to AndroidTest.xml
  Add ConnectivityCoverageTests to postsubmit
  Add connectivity coverage tests
  Make tests compatible with mockito-extended
  Fix KeepalivePacketDataUtilTest crash on eng build
  Update connectivity TEST_MAPPING
2021-07-06 02:42:51 +00:00
Remi NGUYEN VAN
0b3f20a64d 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
2021-07-05 05:02:05 +00:00
Remi NGUYEN VAN
fda49a5f17 Re-skip connectivity unit tests before S
The tests are packaged together with other tests in a common coverage
suite, so need to be individually annotated so that they are skipped
before S.

They do not need to pass on platforms older than S, because such
platforms will not updated with the code that is tested.

This applies a previous change, this time using DevSdkIgnoreRunner,
as SdkSuppress does not work as expected in branches that have a
codename 2 versions above the SDK version, as is the case in AOSP.

Bug: 187935317
Test: atest ConnectivityCoverageTests on R
      atest FrameworksNetTests on S
Original-Change: https://android-review.googlesource.com/1749684
Merged-In: I5808d34459a4c19238baf8873afa7cf942828460
Change-Id: I5808d34459a4c19238baf8873afa7cf942828460
2021-07-05 05:01:54 +00:00
Treehugger Robot
bd01bbaa92 Move ConnectivityCoverageTests to general-tests
The test suite is not signed with any particular key so
can be in general-tests. This is also required for TEST_MAPPING.

Bug: 187935317
Original-Change: https://android-review.googlesource.com/1749025
Merged-In: I9dbf98eaa28172a172e707091ea75ffdddd4971b
Change-Id: I9dbf98eaa28172a172e707091ea75ffdddd4971b
Test: TH for test mapping
2021-07-05 05:01:42 +00:00
Remi NGUYEN VAN
a6c016a65d Fix ConnectivityManagerTest initialization on Q
The test can't have TetheringManager as an argument to methods or a
field, otherwise the test runner will crash when scanning the class for
tests because TetheringManager did not exist in Q. Although
testFactoryReset is already skipped on Q, the test runner would fail
at initialization time, before starting the run.

Use CtsTetheringUtils instead. This ensures that TetheringManager does
not have method signatures or members that reference classes that do not
exist on Q, so the test runner can scan the class successfully before
starting the run.

Bug: 188851796
Test: atest ConnectivityManagerTest on Q
Original-Change: https://android-review.googlesource.com/1740779
Merged-In: I87488d0f23628a1ef2d7af0242513fcc5401d598
Change-Id: I87488d0f23628a1ef2d7af0242513fcc5401d598
2021-07-05 05:01:28 +00:00
Treehugger Robot
fb34c5861a Move test_mainline_modules to AndroidTest.xml
When an AndroidTest.xml is used, configuration needs to be in the
AndroidTest.xml file, not in the Android.bp.

This currently causes tests not to be run in TEST_MAPPING as they should
be.

Test: TH needs to test
Bug: 187935317
Original-Change: https://android-review.googlesource.com/1748157
Merged-In: Ie0aca0c64646825175769cd375bcecf65de4b4c8
Change-Id: Ie0aca0c64646825175769cd375bcecf65de4b4c8
2021-07-05 05:01:16 +00:00
Remi NGUYEN VAN
1c45a8a623 Add ConnectivityCoverageTests to postsubmit
Add the tests to both postsubmit and mainline-postsubmit.

This should allow moving the tests to presubmit in the near future,
after they have been verified to pass in postsubmit.

Bug: 187935317
Test: treehugger needs to test
Original-Change: https://android-review.googlesource.com/1736506
Merged-In: I9a05d6a300c5f777497e867d0456bc59b06eee80
Change-Id: I9a05d6a300c5f777497e867d0456bc59b06eee80
2021-07-05 05:01:02 +00:00
Remi NGUYEN VAN
168b3d19f1 Add connectivity coverage tests
The coverage tests will allow measuring code coverage for all
Connectivity+Tethering code.

This is a combination of the current TetheringCoverageTests, and
FrameworksNetTests.

Adding min_sdk_version to the test prevents it from using deprecated
IoUtils utilities. Replace it with the non-deprecated alternative.

Bug: 187935317
Test: atest ConnectivityCoverageTests
Original-Change: https://android-review.googlesource.com/1731232
Merged-In: I5366e1cc9cd6ddb41f24718246381cc2b1cc1383
Change-Id: I5366e1cc9cd6ddb41f24718246381cc2b1cc1383
2021-07-05 05:00:36 +00:00
TreeHugger Robot
675f699927 Merge "Add tests for in-kernel VPN/VCN dataplane" into sc-dev am: f3c6c3e5b4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15191238

Change-Id: I90f31700dd49b958c3eb33a4d22e90998236d147
2021-07-03 02:15:41 +00:00
Benedict Wong
6dd0516b56 Add tests for in-kernel VPN/VCN dataplane
This change adds relevant tests for the migrateTun functionality in
NetworkStats.

Bug: 190620024
Test: atest NetworkStatsTest
Original-Change: https://android-review.googlesource.com/1749069
Merged-In: I33f14f2d0f71013a594fd4c8c3914a590d30ea06
Change-Id: I33f14f2d0f71013a594fd4c8c3914a590d30ea06
2021-07-02 19:29:06 +00:00
TreeHugger Robot
b8beb3d6d2 Merge "Allow non-VPNs to have underlying networks." into sc-dev am: 0868536de9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15182605

Change-Id: I6f9895eee27be8f6b179270f15a0bdf56baf47bd
2021-07-02 19:12:34 +00:00
TreeHugger Robot
0868536de9 Merge "Allow non-VPNs to have underlying networks." into sc-dev 2021-07-02 18:56:30 +00:00
Paul Hu
6f9ba0496e Merge "Listen EXTERNAL_APPLICATIONS_AVAILABLE intent" into sc-dev am: 790d3eb079
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14772860

Change-Id: I9b09ac787d1ec4580c724426a66abf8c1446217c
2021-07-02 14:32:26 +00:00
Paul Hu
790d3eb079 Merge "Listen EXTERNAL_APPLICATIONS_AVAILABLE intent" into sc-dev 2021-07-02 14:17:17 +00:00
Treehugger Robot
4703a8c392 Allow non-VPNs to have underlying networks.
Certain network types, like the VCN, have underlying
networks for the purpose of data usage, but do not want to
propagate the underlying network capabilities.

Allow these networks to set underlying networks, but continue
not to propagate the capabilities.

Bug: 190620024
Test: new unit test
Original-Change: https://android-review.googlesource.com/1753619
Merged-In: I53d6080f48707ff3c37fbfbef534284ba77a7432
Change-Id: I53d6080f48707ff3c37fbfbef534284ba77a7432
2021-07-02 13:56:28 +00:00
Paul Hu
3dc7387fdb Merge "Use Netd new added/removed uid range methods" into sc-dev am: 29194db12f
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14911836

Change-Id: I5639000ecd2669b677c98e359cb042ac17a69efc
2021-07-02 12:21:16 +00:00
Paul Hu
29194db12f Merge "Use Netd new added/removed uid range methods" into sc-dev 2021-07-02 12:08:35 +00:00
Paul Hu
75ca971c66 Merge "Force only system uid can set uids allowed on restricted networks" into sc-dev am: 77739d37b3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15172131

Change-Id: I0e35396ef80f046aa31931940714dee65a7b781c
2021-07-02 11:02:59 +00:00
Paul Hu
77739d37b3 Merge "Force only system uid can set uids allowed on restricted networks" into sc-dev 2021-07-02 10:46:19 +00:00
TreeHugger Robot
6018e38cad Merge "Change to REQUEST from LISTEN for mobile data preferred uids feature" into sc-dev am: f5f8e4e3a5
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15179351

Change-Id: I65363d10cf9ff08cbc9bde2423bcdeca107b94e7
2021-07-02 09:48:22 +00:00
TreeHugger Robot
f5f8e4e3a5 Merge "Change to REQUEST from LISTEN for mobile data preferred uids feature" into sc-dev 2021-07-02 09:27:38 +00:00
TreeHugger Robot
991b0ee82a Merge "Test Entitlement when telephony is present" into sc-dev am: 8d75184baf
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14947613

Change-Id: I784138f5eef0b99a338fe28724f9002b5ae13bbb
2021-07-02 08:51:35 +00:00
TreeHugger Robot
8d75184baf Merge "Test Entitlement when telephony is present" into sc-dev 2021-07-02 08:29:15 +00:00
Remi NGUYEN VAN
48a0dbefbd Fix CtsNetTestCases in instant mode am: 21e5140ff4
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15179352

Change-Id: Iea06a9e9a3cbacecf9a5ada088ef3a25fc779e45
2021-07-02 07:32:20 +00:00
Remi NGUYEN VAN
21e5140ff4 Fix CtsNetTestCases in instant mode
Skip tests that cannot run in instant mode, as WifiManager is not
available, and the test cannot bind to sockets in instant mode.

Bug: 192284219
Test: atest CtsNetTestCases -- --enable-parameterized-modules \
        --abi arm64-v8a --module-parameter instant_app
Original-Change: https://android-review.googlesource.com/1753823
Merged-In: I7a7b0169a3a495bb359dc1f72e56937dcdc5b8a8
Change-Id: I7a7b0169a3a495bb359dc1f72e56937dcdc5b8a8
2021-07-02 06:04:35 +00:00
Treehugger Robot
0cc6f3b99d Test Entitlement when telephony is present
bug: 187331752
Test: atest android.tethering.test.TetheringManagerTest
Original-Change: https://android-review.googlesource.com/1735336
Merged-In: I9fbb7141691fbbf8685b46359c050e0385928805
Change-Id: I9fbb7141691fbbf8685b46359c050e0385928805
2021-07-02 05:48:23 +00:00
Lucas Lin
be95328ab1 Merge "Print the result of command when test is failed" into sc-dev am: 0def47421d
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15165009

Change-Id: I953b20df723ee06cbc415a5bfe90ea34298b09bd
2021-07-02 05:44:33 +00:00
Lucas Lin
0def47421d Merge "Print the result of command when test is failed" into sc-dev 2021-07-02 05:27:45 +00:00
Paul Hu
07950df234 Change to REQUEST from LISTEN for mobile data preferred uids feature
- If Mobile data always on is OFF, mobile data preferred uids
  feature does not work.
- We need to request mobile data when MDO list is not empty.

Bug: 171872461
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases

Signed-off-by: Ansik <ansik.shin@samsung.com>
Original-Change: https://android-review.googlesource.com/1751023
Merged-In: Ie9d6b3e39ef16813c4be3979900d226c8f3d656d
Change-Id: Ie9d6b3e39ef16813c4be3979900d226c8f3d656d
2021-07-02 03:03:07 +00:00
Remi NGUYEN VAN
ad8f23fef4 Make tests compatible with mockito-extended
This does not change the mockito library to use mockito-extended in
FrameworksNetTests, but changes the tests so that they would pass if
built against that library.

This is useful to run FrameworksNetTests in a common test suite with
other tests that use mockito-extended, for example a common connectivity
coverage test target.

The change includes increasing the test timeout in
ConnectivityServiceTest, as mockito-extended can have performance impact
(~3 times on hwasan builds). This change does not make tests run slower
in the current FrameworksNetTests suite though.

Bug: 187935317
Test: atest FrameworksNetTests
Original-Change: https://android-review.googlesource.com/1737400
Merged-In: I61fa371e8957037075a2617a014647ff062207c6
Change-Id: I61fa371e8957037075a2617a014647ff062207c6
2021-07-02 01:59:56 +00:00
Remi NGUYEN VAN
8f260383f7 Fix KeepalivePacketDataUtilTest crash on eng build
The test causes a Log.wtf to be logged, because it tests a method that
should not be used after R. Mock the terrible failure handler to avoid
crashes on eng builds.

Test: atest KeepalivePacketDataUtilTest
Bug: 187935317

Original-Change: https://android-review.googlesource.com/1736261
Merged-In: Ic06a0db7fefb4acf38b66feba9b47e21f9927b1c
Change-Id: Ic06a0db7fefb4acf38b66feba9b47e21f9927b1c
2021-07-02 01:59:40 +00:00
Sudheer Shanka
311b28c020 Merge "Skip NetworkPolicyManagerTest on unsupported devices." into sc-dev am: 0a224da8d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15167635

Change-Id: Ibcdf57e5dad03cea9e07cc18c1c3c5b6acdcb5f0
2021-07-01 23:40:25 +00:00
Sudheer Shanka
0a224da8d3 Merge "Skip NetworkPolicyManagerTest on unsupported devices." into sc-dev 2021-07-01 23:28:45 +00:00