Commit Graph

42554 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
013e9789b7 Merge changes I99ce72bd,I5a11a802 am: 527ffb6f0c am: 3499d73016
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1756971

Change-Id: Ic26bab1331de18f8b362849e275f986d0b7fa97e
2021-07-07 03:32:44 +00:00
Paul Hu
7a6f3364c9 [automerger skipped] Merge "Use Netd new added/removed uid range methods" am: 51bfbbfb1b am: cef78638b5 -s ours
am skip reason: Merged-In I08bbdbcb8450b08e6208fa730137348550f9e3d2 with SHA-1 de2a23958d is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1755053

Change-Id: Ifa99945cc5b761eb2f1a45c21838b5db078d584b
2021-07-07 03:32:37 +00:00
Remi NGUYEN VAN
3499d73016 Merge changes I99ce72bd,I5a11a802 am: 527ffb6f0c
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1756971

Change-Id: Icb435dbe7be5eb125b88336263fd3519139501db
2021-07-07 03:21:57 +00:00
Paul Hu
cef78638b5 Merge "Use Netd new added/removed uid range methods" am: 51bfbbfb1b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1755053

Change-Id: I1ab928e64501c47adbb1416555640084098cf72f
2021-07-07 03:21:51 +00:00
Remi NGUYEN VAN
527ffb6f0c Merge changes I99ce72bd,I5a11a802
* changes:
  Add retries for WifiManager#connect
  Use WifiManager.connect to reconnect wifi
2021-07-07 03:07:21 +00:00
Paul Hu
51bfbbfb1b Merge "Use Netd new added/removed uid range methods" 2021-07-07 03:07:10 +00:00
paulhu
0e79d95332 Use Netd new added/removed uid range methods
Replace network[Add|Remove]UidRanges to
network[Add|Remove]UidRangesParcel. The new methods are passing
NativeUidRangeConfig which contains priority value for each uid
range rules.

Bug: 171872461
Test: atest FrameworksNetTests
Test: atest HostsideVpnTests
(cherry-pick from ag/14911836)
Merged-In: I08bbdbcb8450b08e6208fa730137348550f9e3d2

Change-Id: I08bbdbcb8450b08e6208fa730137348550f9e3d2
2021-07-07 03:06:32 +00:00
Maciej Żenczykowski
aa6e564726 remove obsolete/no-op NativeQtaguidTest am: 2aabf4138e am: 4f8727b8a7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1757412

Change-Id: Ifcfbc5d49ebffaf177ab0e5e3e500f933fd068ce
2021-07-07 02:17:15 +00:00
Treehugger Robot
2001d44cde [automerger skipped] add test for /system/etc/bpf/{netd,clatd}.o using correct struct sizes am: cba9f66098 -s ours
am skip reason: Merged-In Ibaedb8fcb28591ffba1506514f2305d55712a26b with SHA-1 bbc4ea32bc is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15217930

Change-Id: Ie39372d2403e42bfa874000533e7eabae0e0ec05
2021-07-07 02:16:35 +00:00
Maciej Żenczykowski
4f8727b8a7 remove obsolete/no-op NativeQtaguidTest am: 2aabf4138e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1757412

Change-Id: I43c6fa74b4fbd45cd047b6169316e656debae855
2021-07-07 02:07:54 +00:00
Maciej Żenczykowski
2aabf4138e remove obsolete/no-op NativeQtaguidTest
qtaguid is long dead - test is thus a no-op

New test logs:
  Running Tests...

  x86 CtsNativeNetTestCases
  -------------------------
  CtsNativeNetTestCases (1 Test)
  [1/1] BpfTest#bpfStructSizeTest: PASSED (0ms)

  Summary
  -------
  x86 CtsNativeNetTestCases: Passed: 1, Failed: 0, Ignored: 0, Assumption Failed: 0,

  All tests passed!

Test: atest CtsNativeNetTestCases, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9ff784dbfda0ce981904d53eacb7bc831cbe81da
2021-07-06 22:15:44 +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
Treehugger Robot
58a4324397 Merge "add test for /system/etc/bpf/{netd,clatd}.o using correct struct sizes" am: 464d0b2bdd am: b2817e8e31
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1756440

Change-Id: I4b57219491ad0fef352ea0d834f402fb429b67a2
2021-07-06 21:12:19 +00:00
Treehugger Robot
b2817e8e31 Merge "add test for /system/etc/bpf/{netd,clatd}.o using correct struct sizes" am: 464d0b2bdd
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1756440

Change-Id: I8414a4ab963e8754978c781635a66de52be39813
2021-07-06 20:58:42 +00:00
Treehugger Robot
464d0b2bdd Merge "add test for /system/etc/bpf/{netd,clatd}.o using correct struct sizes" 2021-07-06 20:44:57 +00:00
Maciej Żenczykowski
bbc4ea32bc 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>
Change-Id: Ibaedb8fcb28591ffba1506514f2305d55712a26b
2021-07-06 02:50:47 -07:00
Remi NGUYEN VAN
00407b0c1b Add retries for WifiManager#connect
Connect can error with BUSY if the framework is busy when connect is
called. Add retries so that if this happens, the connection can succeed
after the framework stops being busy.

Also log the level of scan results when several configurations are
available, and clarify the legacy broadcast assert.

Bug: 188077861
Test: atest CtsNetTestCases
Change-Id: I99ce72bd2604489cb419ea9984643b6985728461
2021-07-06 17:53:48 +09:00
Lorenzo Colitti
f6137b334f [automerger skipped] Load ncm regexs config to tetherableUsbRegexs if isUsingNcm=true am: 1d934442ff -s ours
am skip reason: Merged-In I0c542560bd04e8c0a6a78d632da5a00a34d9a3fa with SHA-1 b28740ec89 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15211236

Change-Id: Ie6c9771352f2e153c9fc97c482fc65aaeb28fe4c
2021-07-06 06:06:44 +00:00
Lorenzo Colitti
1874d956e1 [automerger skipped] Enable and disable usb IpServer according to ACTION_USB_STATE am: 0450443f37 -s ours
am skip reason: Merged-In I8375e3f998d677dc658370b2553facaec0d5ff7c with SHA-1 b41a00e778 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15211231

Change-Id: If99a75e5e2ec3f20a753013f764669daf5dd5173
2021-07-06 06:06:41 +00:00
Lorenzo Colitti
1d934442ff Load ncm regexs config to tetherableUsbRegexs if isUsingNcm=true
If config_tether_ncm_regexs is configured, load it to
tetherableUsbRegexs if ncm is used for TETHERING_USB. Load it to
tetherableNcmRegexs if ncm is used for TETHERING_NCM.

Bug: 185649441
Test: atest TetheringTests
Original-Change: https://android-review.googlesource.com/1755176
Merged-In: I0c542560bd04e8c0a6a78d632da5a00a34d9a3fa
Change-Id: I0c542560bd04e8c0a6a78d632da5a00a34d9a3fa
2021-07-06 04:32:35 +00:00
Lorenzo Colitti
0450443f37 Enable and disable usb IpServer according to ACTION_USB_STATE
Before this change, usb IpServer would be created if corresponding
interface is available even there is no enable tethering attempt. And
usb IpServer only be disabled when interface is removed. Usb tethering
could not be stopped if interface is always avaialbe.
After this change, usb IpServer would be enabled and disabled according
to ACTION_USB_STATE.

Bug: 185649441
Test: atest TetheringCoverageTests
      atest MtsTetheringTestLatestSdk
      atest CtsTetheringTest
Original-Change: https://android-review.googlesource.com/1731453
Merged-In: I8375e3f998d677dc658370b2553facaec0d5ff7c
Change-Id: I8375e3f998d677dc658370b2553facaec0d5ff7c
2021-07-06 04:22:21 +00:00
Lorenzo Colitti
25423d4f5e Merge "Load ncm regexs config to tetherableUsbRegexs if isUsingNcm=true" am: 844ca1290e am: 51f5f61742
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1755176

Change-Id: Iceb3d25f31da76f4f12115a7ceabd68a81faebfa
2021-07-06 04:04:42 +00:00
Lorenzo Colitti
86d7e6bbb4 Merge "Enable and disable usb IpServer according to ACTION_USB_STATE" am: d479e694f0 am: 736df2cb2f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731453

Change-Id: I334710d0bbbe18a769a79fb58d10a558dd8f7b37
2021-07-06 04:04:36 +00:00
Lorenzo Colitti
51f5f61742 Merge "Load ncm regexs config to tetherableUsbRegexs if isUsingNcm=true" am: 844ca1290e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1755176

Change-Id: I5c7cb78792108b89b366da9528ffae424331aba9
2021-07-06 03:51:26 +00:00
Lorenzo Colitti
736df2cb2f Merge "Enable and disable usb IpServer according to ACTION_USB_STATE" am: d479e694f0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731453

Change-Id: Ic250214e5e731aa2505620703e53dfa2083bffa6
2021-07-06 03:51:19 +00:00
Lorenzo Colitti
844ca1290e Merge "Load ncm regexs config to tetherableUsbRegexs if isUsingNcm=true" 2021-07-06 03:39:31 +00:00
Lorenzo Colitti
d479e694f0 Merge "Enable and disable usb IpServer according to ACTION_USB_STATE" 2021-07-06 03:39:15 +00:00
Remi NGUYEN VAN
231f777b02 [automerger skipped] Merge changes from topic "am-cc17cb7d48ea4bd7adc9183dc0c381e3-sc-dev" into sc-dev am: 0f956db686 -s ours
am skip reason: Merged-In Ib95b58dab93f7adebc445b662a6d15db1ce0e7c2 with SHA-1 8ea5ee6d33 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15165007

Change-Id: I0c0da3b4d3075e2da48ec136c4129379478aa75a
2021-07-06 02:57:52 +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
3676ffb9af Use WifiManager.connect to reconnect wifi
Address a TODO to use WifiManager#connect to reconnect wifi, instead of
WifiManager#reconnect. #connect also clears the BSSID denylist; that
list has caused flakyness due to tests that cause the network not to
validate such as captive portal or invalid private DNS behavior tests,
causing wifi to ignore the access point in reconnect attempts.

Bug: 188077861
Test: atest CtsNetTestCasesLatestSdk

Change-Id: I5a11a802db8a4881c161e6038c1c183d2ac23a05
2021-07-06 11:30:51 +09:00
markchien
b28740ec89 Load ncm regexs config to tetherableUsbRegexs if isUsingNcm=true
If config_tether_ncm_regexs is configured, load it to
tetherableUsbRegexs if ncm is used for TETHERING_USB. Load it to
tetherableNcmRegexs if ncm is used for TETHERING_NCM.

Bug: 185649441
Test: atest TetheringTests
Change-Id: I0c542560bd04e8c0a6a78d632da5a00a34d9a3fa
2021-07-05 23:11:50 +08:00
markchien
b41a00e778 Enable and disable usb IpServer according to ACTION_USB_STATE
Before this change, usb IpServer would be created if corresponding
interface is available even there is no enable tethering attempt. And
usb IpServer only be disabled when interface is removed. Usb tethering
could not be stopped if interface is always avaialbe.
After this change, usb IpServer would be enabled and disabled according
to ACTION_USB_STATE.

Bug: 185649441
Test: atest TetheringCoverageTests
      atest MtsTetheringTestLatestSdk
      atest CtsTetheringTest
Change-Id: I8375e3f998d677dc658370b2553facaec0d5ff7c
2021-07-05 22:53:07 +08:00
Junyu Lai
8b1a98ff38 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
2021-07-05 09:27:16 +00:00
Junyu Lai
ce077a3ad0 Merge "Consider NetworkOffer is unneeded if it cannot satisfy the request" am: b028fc7cf1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1731452

Change-Id: I9c7bb2e88ad6b6929bf7db3b7433b772c4f5d15a
2021-07-05 09:09:01 +00:00
Junyu Lai
b028fc7cf1 Merge "Consider NetworkOffer is unneeded if it cannot satisfy the request" 2021-07-05 08:57:07 +00:00
Remi NGUYEN VAN
5f01d1d538 Merge "Move BitUtils, RingBuffer test to coretests" am: 6be4ebcb0a am: b65aea1772
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1754897

Change-Id: Ic1a8f779daf2d36dd07b1ce0a84392c74e251263
2021-07-05 05:31:16 +00:00
Remi NGUYEN VAN
b65aea1772 Merge "Move BitUtils, RingBuffer test to coretests" am: 6be4ebcb0a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1754897

Change-Id: Ib30b1f12b17241d66a80130f772d2948e3cee358
2021-07-05 05:18:21 +00:00
Remi NGUYEN VAN
6be4ebcb0a Merge "Move BitUtils, RingBuffer test to coretests" 2021-07-05 05:05:34 +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
9efcdc4948 [automerger skipped] Merge "Add tests for in-kernel VPN/VCN dataplane" into sc-dev am: f3c6c3e5b4 -s ours
am skip reason: Merged-In I33f14f2d0f71013a594fd4c8c3914a590d30ea06 with SHA-1 1117e853f9 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15191238

Change-Id: I23169713305bb320dda331cfb37c97959c4cfb20
2021-07-03 02:12:25 +00:00
Maciej Żenczykowski
df9a5b82ce [automerger skipped] ipv4 tethering offload - decrement ttl during forwarding am: f416b8a1ff -s ours
am skip reason: Merged-In I88e5293a54b7867a8e7dd76f6fd8e2a52d31e51a with SHA-1 c29af79e26 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15192718

Change-Id: Ia1d90fa18054a072bc1ef7ee1d6ecf2ad12d195b
2021-07-03 02:12:04 +00:00
TreeHugger Robot
f3c6c3e5b4 Merge "Add tests for in-kernel VPN/VCN dataplane" into sc-dev 2021-07-03 02:01:54 +00:00
Maciej Żenczykowski
f416b8a1ff ipv4 tethering offload - decrement ttl during forwarding
Bug: 192635131
Test: atest, TreeHugger, flashed on phone, forwarded ipv4 traffic
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Original-Change: https://android-review.googlesource.com/1755049
Merged-In: I88e5293a54b7867a8e7dd76f6fd8e2a52d31e51a
Change-Id: I88e5293a54b7867a8e7dd76f6fd8e2a52d31e51a
2021-07-02 22:08:34 +00:00
Maciej Żenczykowski
212fa79a4b Merge "ipv4 tethering offload - decrement ttl during forwarding" am: f21f5357e7 am: f54ce8312b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1755049

Change-Id: Idb6f95c96fa7832f4482fb6fc0237bb242ca8794
2021-07-02 21:36:48 +00:00