Commit graph android_packages_modules_Co.../Tethering/tests
Message SHA1
[BOT.3] Add unit test for polling network stats in the coordinator am: 7997d691fe am: 5fd9fcce13
Original change: undetermined

Change-Id: Ib9ad6e1ab139295ef603e7c8ec86d689ea9801af

Hungming Chen   authored and   Automerger Merge Worker   commited 2020-06-02 00:13:40 +00:00
a3c8a7503c
[BOT.2] Create a coordinator and stats provider to provide tether stats am: 68f1c2a63f am: eba638f4a9
Original change: undetermined

Change-Id: Ic7fe1a8c0d16c8b435269a1973687655a9c7412b

Hungming Chen   authored and   Automerger Merge Worker   commited 2020-06-02 00:13:26 +00:00
8bebb8eaa5
[BOT.3] Add unit test for polling network stats in the coordinator am: 7997d691fe
Original change: undetermined

Change-Id: Ic3b56365d7f1dbde23e0d1b902a21a3de3ad7327

Hungming Chen   authored and   Automerger Merge Worker   commited 2020-06-01 23:52:56 +00:00
5fd9fcce13
[BOT.2] Create a coordinator and stats provider to provide tether stats am: 68f1c2a63f
Original change: undetermined

Change-Id: I21fe5385b8cdfe2ce2ff982884d72a398183bde3

Hungming Chen   authored and   Automerger Merge Worker   commited 2020-06-01 23:52:53 +00:00
eba638f4a9
Merge "Use Class#getSimpleName instead of KClass#getSimpleName"
Paul Hu   authored and   Gerrit Code Review   commited 2020-06-01 06:43:13 +00:00
aac3b2ead0
Merge "Tethering: ensure downstream prefix do not conflict with upstream" am: 7bf51619d8 am: 3cefc6e048
Change-Id: Ib70a471603d850069aae029dea7fc09a9b28f4bc

Mark Chien   authored and   Automerger Merge Worker   commited 2020-05-29 22:07:37 +00:00
0e1a1f4c68
[BOT.3] Add unit test for polling network stats in the coordinator
Verify that the coordinator could fetch tether stats from BPF maps and
report the network stats to the service.

Bug: 150736748
Test: atest BpfCoordinatorTest
Change-Id: Ib1756159a2047c5db7d31359b0f288f840bd1bb1

Hungming Chen   commited 2020-05-29 20:23:31 +08:00
7997d691fe
[BOT.2] Create a coordinator and stats provider to provide tether stats
Make BPF tethering offload coordinator, BpfCoordinator,
registers a network stats provider, BpfTetherStatsProvider, and
provide the tethering stats from the BPF map.

Bug: 150736748
Test: new test BpfCoordinatorTest

Change-Id: I22e71f87b67668f7e733e4f215d93bf5b2c9380d

Hungming Chen   commited 2020-05-29 20:23:22 +08:00
68f1c2a63f
Merge "Use Class#getSimpleName instead of KClass#getSimpleName" into rvc-dev am: 88c69840cd
Change-Id: Ice90dba6408eca9c031592fd4933a107fdbbec2f

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-05-29 09:24:53 +00:00
601193a68e
Merge "Use Class#getSimpleName instead of KClass#getSimpleName" into rvc-dev
Chalard Jean   authored and   Android (Google) Code Review   commited 2020-05-29 09:16:28 +00:00
88c69840cd
Merge "Extend timeout for requesting tethered interface" into rvc-dev
Mark Chien   authored and   Android (Google) Code Review   commited 2020-05-29 06:11:12 +00:00
40a9eb779b
Merge "Tethering: ensure downstream prefix do not conflict with upstream"
Mark Chien   authored and   Gerrit Code Review   commited 2020-05-29 03:34:45 +00:00
7bf51619d8
Use Class#getSimpleName instead of KClass#getSimpleName
KClass#getSimpleName need refer to kotlin-reflect.jar which need
include it in Andorid.bp. However, it's not necessary to use
KClass#getSimpleName but use Class#getSimpleName instead.

Test: atest TetheringTests
Bug: 157527499
Change-Id: I49bc336a276d30152402eba926cc583bc81e8e5c
Merged-In: I49bc336a276d30152402eba926cc583bc81e8e5c

paulhu   commited 2020-05-29 00:29:22 +08:00
086f24626c
Switch framework-tethering to use java_sdk_library
The names of the individual modules do not quite follow the pattern
that java_sdk_library uses so this temporarily sets the following:
    naming_scheme: "frameworks-modules"

That causes java_sdk_library to use a naming scheme that matches the
one used by the individual modules of this. It will be cleaned up
later.

Part of the purpose of the java_sdk_library is to hide the
implementation code and force users of the library to depend on stubs
for a well defined API. Ideally, it would allow access to the
implementation in those cases where it is safe, e.g. from within the
same APEX, or from tests for the implementation. Unfortunately, due to
limitations in the build it does not yet have enough information to
make that decision correctly which means that any code that needs to
compile against the implementation is broken which would prevent us
from converting the module to java_sdk_library.

However, the only way to provide the additional information to allow
the implementation to be correctly exposed is to convert the modules
to java_sdk_library; a cycle.

In order to break that cycle the java_sdk_library creates a special
<module>.impl target which is used directly by tests and any other code
that needs it. Once all the modules have been converted to a
java_sdk_library then we can resolve the limitations in the build and
remove the direct references to <module>.impl.

Test: m update-api
Bug: 155164730
Merged-In: If5c115f482751f9f4b5f047e9e401a18e36799ef
Merged-In: Id1c2e848430c49a2da7402244814cd084f5da77c
Change-Id: Id1c2e848430c49a2da7402244814cd084f5da77c

Paul Duffin   commited 2020-05-28 13:14:52 +00:00
2dae272903
Merge "Switch framework-tethering to use java_sdk_library" into rvc-dev am: 5e988a656f
Change-Id: Icf8a3b8eed7e85065d54f2f48d8cb6f05974de00

Paul Duffin   authored and   Automerger Merge Worker   commited 2020-05-28 13:09:48 +00:00
6216a6904e
Switch framework-tethering to use java_sdk_library
The names of the individual modules do not quite follow the pattern
that java_sdk_library uses so this temporarily sets the following:
    naming_scheme: "frameworks-modules"

That causes java_sdk_library to use a naming scheme that matches the
one used by the individual modules of this. It will be cleaned up
later.

Part of the purpose of the java_sdk_library is to hide the
implementation code and force users of the library to depend on stubs
for a well defined API. Ideally, it would allow access to the
implementation in those cases where it is safe, e.g. from within the
same APEX, or from tests for the implementation. Unfortunately, due to
limitations in the build it does not yet have enough information to
make that decision correctly which means that any code that needs to
compile against the implementation is broken which would prevent us
from converting the module to java_sdk_library.

However, the only way to provide the additional information to allow
the implementation to be correctly exposed is to convert the modules
to java_sdk_library; a cycle.

In order to break that cycle the java_sdk_library creates a special
<module>.impl target which is used directly by tests and any other code
that needs it. Once all the modules have been converted to a
java_sdk_library then we can resolve the limitations in the build and
remove the direct references to <module>.impl.

Test: m Tethering InProcessTethering checkapi
Bug: 155164730
Merged-In: If5c115f482751f9f4b5f047e9e401a18e36799ef
Change-Id: Id1c2e848430c49a2da7402244814cd084f5da77c

Paul Duffin   commited 2020-05-28 12:50:04 +01:00
cbac8e0b63
Use Class#getSimpleName instead of KClass#getSimpleName
KClass#getSimpleName need refer to kotlin-reflect.jar which need
include it in Andorid.bp. However, it's not necessary to use
KClass#getSimpleName but use Class#getSimpleName instead.

Test: atest TetheringTests
Bug: 157527499
Change-Id: I49bc336a276d30152402eba926cc583bc81e8e5c

paulhu   commited 2020-05-28 19:17:45 +08:00
6c633de59e
Extend timeout for requesting tethered interface
Extend the timeout to lower the EthernetTetheringTest flaky.

Besides, also explicitly exempt entitlement check in
EtetherntTetheringTest because it do not test tethering upstream
currently. Thus, the tests would not be interrupted by entitlement
check if test SIM is entitlement required.

Bug: 156713866
Test: TetheringCoverageTests, CtsTehteringTest

Merged-In: I45e8e8d737486def9d0de8943ec7f09ca0942a0b
Change-Id: I45e8e8d737486def9d0de8943ec7f09ca0942a0b

Treehugger Robot   authored and   Mark Chien   commited 2020-05-28 09:17:28 +00:00
9c9c600c16
Merge "Extend timeout for requesting tethered interface" am: 95386f9ebd am: 0c71ef1a6f
Change-Id: I577127f79391a4859dc7324b8cc47729a807a165

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-05-28 08:50:08 +00:00
99466515f8
Merge "Extend timeout for requesting tethered interface"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-05-28 08:19:10 +00:00
95386f9ebd
Extend timeout for requesting tethered interface
Extend the timeout to lower the EthernetTetheringTest flaky.

Besides, also explicitly exempt entitlement check in
EtetherntTetheringTest because it do not test tethering upstream
currently. Thus, the tests would not be interrupted by entitlement
check if test SIM is entitlement required.

Bug: 156713866
Test: TetheringCoverageTests, CtsTehteringTest

Change-Id: I45e8e8d737486def9d0de8943ec7f09ca0942a0b

markchien   commited 2020-05-28 12:13:14 +08:00
908518d8e2
Tethering: ensure downstream prefix do not conflict with upstream
- Add New class PrivateAddressCoordinator to coordinate the private
  address conflict problem.
- Downstream prefix would be random in 192.168.0.0/24 ~
  192.168.255.0/24.
- If new upstream prefix is conflict with existing downstream prefix,
  downstream would be kicked out and it would request a new one.
- The last conflict upstream prefixes would be blacklist. Avoid to
select downstream prefix which is conflict with prefixes in blacklist.

Bug: 130879722
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ib45b87bcd9eeb5da03fb7ec90b1af9ca53998cf5

markchien   commited 2020-05-27 21:36:01 +08:00
c9daba32f7
Remove platform cert from Tethering tests
Bug: 156866746
Test: atest TetheringTests, TetheringCoverageTests
Merged-In: I7c539f1f4a447b5913164b222601c6113c6fe645
Change-Id: I7c539f1f4a447b5913164b222601c6113c6fe645

Treehugger Robot   authored and   Mark Chien   commited 2020-05-27 09:27:27 +00:00
369fd25f79
Merge "Remove platform cert from Tethering tests" am: a5e8d3f73d am: e88c5146da
Change-Id: I51317f3769d60393a21ced8a194f253f97ef9ffd

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-05-27 04:17:44 +00:00
b4d272b13e
Remove platform cert from Tethering tests
Bug: 156866746
Test: atest TetheringTests, TetheringCoverageTests
Change-Id: I7c539f1f4a447b5913164b222601c6113c6fe645

markchien   commited 2020-05-26 09:31:16 +08:00
e79e02e5c4
Adjust TTL for ipv6 tethering
If upstream is cellular, set the TTL in Router Advertisements to
"network-set TTL - 1" for carrier requirement. For other non-cellular
upstream, set TTL as "network-set TTL + 1" to preventing arbitrary
distinction between tethered and untethered traffic.

Bug: 154776299
Test: atest TetheringTests

Merged-In: I7f2696a642f96c6aafb5613b980bf5bcdd08bbda
Change-Id: I7f2696a642f96c6aafb5613b980bf5bcdd08bbda

Mark Chien   commited 2020-05-25 13:27:35 +00:00
cd309138ce
Merge "TetheringServiceTest: test caller permission" into rvc-dev
Mark Chien   authored and   Android (Google) Code Review   commited 2020-05-25 10:40:03 +00:00
5026370372
TetheringServiceTest: test caller permission
Bug: 154869719
Test: atest TetheringTests
Original-Change: https://android-review.googlesource.com/1288503

Fix TetheringServiceTest test WRITE_SETTINGS permission failure

AdoptShellPermissionIdentity can not pass permission check by
Settings#checkAndNoteWriteSettingsOperation. It would compare the caller
uid and its package name. See error below:
1. java.lang.SecurityException:
Specified package com.android.shell under uid 10239 but it is really 2000
2. java.lang.SecurityException:
uid 10245 does not have android.permission.UPDATE_APP_OPS_STATS.

Override the method and test if caller hold WRITE_SETTINGS directly.

Bug: 154869719
Test: TetheringTests, TetheringCoverageTests, NetworkStackNextTests,
NetworkStackCoverageTests
Original-Change: https://android-review.googlesource.com/1313806

Change-Id: I7beea3f011d930e433443ed62d772a3f8cce5d78
Merged-In: I7beea3f011d930e433443ed62d772a3f8cce5d78

markchien   commited 2020-05-25 12:07:06 +08:00
5232658de2
Merge "Adjust TTL for ipv6 tethering" am: 6d0a178a6b am: 23450e1fd1
Change-Id: I73c02d9ad80080a76e8d04d1d61467b434a68732

Mark Chien   authored and   Automerger Merge Worker   commited 2020-05-25 02:04:59 +00:00
916f0d9420
Merge "Adjust TTL for ipv6 tethering"
Mark Chien   authored and   Gerrit Code Review   commited 2020-05-25 01:42:36 +00:00
6d0a178a6b
Adjust TTL for ipv6 tethering
If upstream is cellular, set the TTL in Router Advertisements to
"network-set TTL - 1" for carrier requirement. For other non-cellular
upstream, set TTL as "network-set TTL + 1" to preventing arbitrary
distinction between tethered and untethered traffic.

Bug: 154776299
Test: atest TetheringTests

Change-Id: I7f2696a642f96c6aafb5613b980bf5bcdd08bbda

markchien   commited 2020-05-24 22:52:44 +08:00
d63c4f35de
Merge "Fix TetheringServiceTest test WRITE_SETTINGS permission failure" am: 7e8b14abee am: b46dcf8317
Change-Id: I82825eeded51f779325291cc1142cb1d6111915b

Mark Chien   authored and   Automerger Merge Worker   commited 2020-05-21 08:31:37 +00:00
0454f82509
Fix TetheringServiceTest test WRITE_SETTINGS permission failure
AdoptShellPermissionIdentity can not pass permission check by
Settings#checkAndNoteWriteSettingsOperation. It would compare the caller
uid and its package name. See error below:
1. java.lang.SecurityException:
Specified package com.android.shell under uid 10239 but it is really 2000
2. java.lang.SecurityException:
uid 10245 does not have android.permission.UPDATE_APP_OPS_STATS.

Override the method and test if caller hold WRITE_SETTINGS directly.

Bug: 154869719
Test: TetheringTests, TetheringCoverageTests, NetworkStackNextTests,
NetworkStackCoverageTests

Change-Id: I2a60c4d66ef30028f9663159f85464ea815248e2

markchien   commited 2020-05-20 16:56:33 +08:00
f4394e83f8
Merge "TetheringServiceTest: test caller permission" am: 366eae572d am: e46a70cbfe
Change-Id: Ia1c0ec986750a04290d3125882d00c18f4213ae7

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-05-19 03:21:42 +00:00
8592480922
Merge "TetheringServiceTest: test caller permission"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-05-19 02:40:03 +00:00
366eae572d
TetheringServiceTest: test caller permission
Bug: 154869719
Test: atest TetheringTests
Change-Id: I7beea3f011d930e433443ed62d772a3f8cce5d78

markchien   commited 2020-05-19 09:04:43 +08:00
2a1656d3f8
Support MirrorLink DHCPDECLINE.
Add the specific implementation of onNewPrefixRequest callback
on IpServer side, also refactor some common code.

Bug: 130741856
Test: atest TetheringTests
Merged-In: If2871bf899cb5890bbfee18063a194c92b6f474e
Change-Id: If2871bf899cb5890bbfee18063a194c92b6f474e

Xiao Ma   commited 2020-05-18 14:23:13 +00:00
654013479b
Fix READ_DEVICE_CONFIG permission denied problem in TetheringTests
Bug: 156557122
Test: atest TetheringTests

Merged-In: Id9c0397306f3872fc23520d1354f338035a96dc9
Change-Id: Id9c0397306f3872fc23520d1354f338035a96dc9

Treehugger Robot   authored and   Mark Chien   commited 2020-05-14 17:16:39 +00:00
91b2bda682
Merge "Fix READ_DEVICE_CONFIG permission denied problem in TetheringTests" am: fb2caff580 am: 61aba704a9
Change-Id: I246e4f0d90e95418cbf55db5b802997faf4eae66

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-05-14 16:33:30 +00:00
dd8e64609a
Merge "Fix READ_DEVICE_CONFIG permission denied problem in TetheringTests"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-05-14 16:00:27 +00:00
fb2caff580
Fix READ_DEVICE_CONFIG permission denied problem in TetheringTests
Bug: 156557122
Test: atest TetheringTests

Change-Id: Id9c0397306f3872fc23520d1354f338035a96dc9

markchien   commited 2020-05-14 16:42:22 +08:00
74174690d1
Merge "Support MirrorLink DHCPDECLINE." am: cc755bf9fc am: b80b1e09bc
Change-Id: I415ba816492a329d5632e49025284d700b3c14da

Xiao Ma   authored and   Automerger Merge Worker   commited 2020-05-14 06:52:59 +00:00
cad22f9192
Merge "Support MirrorLink DHCPDECLINE."
Xiao Ma   authored and   Gerrit Code Review   commited 2020-05-14 06:27:16 +00:00
cc755bf9fc
Merge "Make members final in TetheringService" into rvc-dev
Mark Chien   authored and   Android (Google) Code Review   commited 2020-05-14 05:48:24 +00:00
73260a5564
Merge "Make members final in TetheringService"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-05-13 16:04:58 +00:00
7e2180f019
Make members final in TetheringService
1. Move isTetheringSupport logic from TetheringService to Tethering.
2. Small readability improvement in TetheringTest. Also change
config_tether_upstream_automatic from false to true in TetheringTest.
So TetheringTests would default run automatic select upstream flow
instead of selecting by legacy perferred network type list.

Bug: 153609486
Test: atest TetheringTest
Change-Id: I5a82a6347f62d3a7031db5c56e8e0c8530dafd8f
Merged-In: I5a82a6347f62d3a7031db5c56e8e0c8530dafd8f
(cherry picked from commit 569870320a)

markchien   authored and   Mark Chien   commited 2020-05-13 15:07:00 +00:00
bd2cbe6c73
Support MirrorLink DHCPDECLINE.
Add the specific implementation of onNewPrefixRequest callback
on IpServer side, also refactor some common code.

Bug: 130741856
Test: atest TetheringTests
Change-Id: If2871bf899cb5890bbfee18063a194c92b6f474e

Xiao Ma   commited 2020-05-13 23:29:49 +09:00
4455d6b1bd
Make members final in TetheringService
1. Move isTetheringSupport logic from TetheringService to Tethering.
2. Small readability improvement in TetheringTest. Also change
config_tether_upstream_automatic from false to true in TetheringTest.
So TetheringTests would default run automatic select upstream flow
instead of selecting by legacy perferred network type list.

Bug: 153609486
Test: atest TetheringTest
Change-Id: I5a82a6347f62d3a7031db5c56e8e0c8530dafd8f
Merged-In: I5a82a6347f62d3a7031db5c56e8e0c8530dafd8f

markchien   commited 2020-05-13 22:12:15 +08:00
c96e106d68
Make members final in TetheringService
1. Move isTetheringSupport logic from TetheringService to Tethering.
2. Small readability improvement in TetheringTest. Also change
config_tether_upstream_automatic from false to true in TetheringTest.
So TetheringTests would default run automatic select upstream flow
instead of selecting by legacy perferred network type list.

Bug: 153609486
Test: atest TetheringTest
Change-Id: I5a82a6347f62d3a7031db5c56e8e0c8530dafd8f
Merged-In: I5a82a6347f62d3a7031db5c56e8e0c8530dafd8f

markchien   authored and   Mark Chien   commited 2020-05-13 12:25:15 +00:00
1da5f7d499
Add test for OffloadHardwareInterface
Bug: 145490751
Test: atest TetheringTests

Merged-In: Ia402a6caaa0dfaa05d25a02101c515bbd884d33f
Change-Id: Ia402a6caaa0dfaa05d25a02101c515bbd884d33f

Mark Chien   commited 2020-05-13 10:06:26 +00:00
7c23d31127