summaryrefslogtreecommitdiff
path: root/Tethering/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Test testTetherUdpV4AfterR only verify bpf in precise kernel range" ↵Nucca Chen2022-06-021-9/+31
|\ | | | | | | into tm-dev
| * Test testTetherUdpV4AfterR only verify bpf in precise kernel rangeHungming Chen2022-05-281-9/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use three-part kernel version numbers to check which device needs to verify BPF offload. Only check major and minor number is not enough. Ex: mixed build T + R may have an unsupported kernel version 4.19.160 (require 4.19.176+). Now check the subminor number as well. For UDPv4 support, kernel require 4.14.222+ 4.19.176+ 5.4.98+, 5.8.0+ Test: atest EthernetTetheringTest (raven @ internal master build) Test: cts test (bramble @ T + R mixed build) > run cts-on-gsi -m CtsTetheringTest -t android.net.EthernetTetheringTest#testTetherUdpV4AfterR Bug: 232332847 Change-Id: I466df73b0fa35b086a2c5e11f8624c84eb79c8fd (cherry picked from commit d7e713283d974f1c14ab974507671664834b4760) Merged-In: I466df73b0fa35b086a2c5e11f8624c84eb79c8fd
* | Bump tethering target sdk to 33Mark Chien2022-06-013-3/+3
|/ | | | | | | | | | | | | | | | | Note: to avoid missing some dependeices change only happen in T+, below testing verification is perform by internal branch. Test: atest TetheringTests atest TetheringIntegrationTests atest CtsTetheringTest atest MtsTetheringLatestSdk manually change entitlement check recheck period to 1 min and monitor schedule alarm works. Dogfood this change personally 7 days, major use hotspot sharing network to notebook to work. Bug: 232193147 Change-Id: I3cba98f42ac1a9c0c1db4b2ad036aff714a428f3 (cherry picked from commit d25a1e05ae4690a18f10fc9bc7d5caebe6364e52) Merged-In: I3cba98f42ac1a9c0c1db4b2ad036aff714a428f3
* fix BpfMapTestMaciej Żenczykowski2022-05-201-9/+0
| | | | | | | | | | | to account for close() becoming a no-op Bug: 230880517 Test: TreeHugger, atest com.android.networkstack.tethering.BpfMapTest Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I69f25ff168c1cf0f13434dd1d842ed81a6a03f2f (cherry picked from commit 4426a84111b0a7bc66aab995ceefb8036a5541fd) Merged-In: I69f25ff168c1cf0f13434dd1d842ed81a6a03f2f
* Prepare for refactoring wifi ipserver start/stopmarkchien2022-05-171-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparing change. 1) In enableWifiIpServing, replace ensureIpServerStarted(ifname) + changeInterfaceState(ifname, ipServingMode) with enableIpServing(TETHERING_WIFI, ifname, ipServingMode). And checking whether corresponding wifi or p2p feature is avaialble before enableWifiIpServing. Note: If the wifi or p2p feature wasn't supported before, it would still call changeInterfaceState without ipServer created but changeInterfaceState would be no-op because there is no corresponding ipServer for changing state. 2) Splitting enableWifiIpServing into enableWifiIpServing and enableWifiP2pIpServing. 3) No longer guess the interface name after T. WIFI_AP_STATE_CHANGED intent should always include ifname and it should be tracked by mTetherStates. If OEM have modification in wifi framework to send empty ifname, tethering no longer support this after T. 4) After T, tethering always trust the ifname which pass by wifi or p2p intent broadcast and treat it as TETHERING_WIFI or TETHERING_WIFI_P2P. This allow tethering to deprecate wifi/p2p regexs after T. Bug: 189410000 Bug: 178116595 Bug: 185451791 Bug: 190145323 Bug: 176048959 Test: atest TetheringTests Change-Id: Ia5f69ddf2d842536ce0df75eeae57866f56df571 (cherry picked from commit f2e9409f55a71846d5ec2dd120ba83e3b3773d09) Merged-In: Ia5f69ddf2d842536ce0df75eeae57866f56df571
* Catch new exceptions from BpfMapHungming Chen2022-05-121-2/+2
| | | | | | | | Bug: 230880517 Test: atest FrameworksNetTests Change-Id: I9eff2589f83ac109fb6e8b9906da05890daa9bd9 (cherry picked from commit 374107963a2716940feabae9b4b41b59d1c9a2ee) Merged-In: I9eff2589f83ac109fb6e8b9906da05890daa9bd9
* Ignore UDP offload test on kernel which is older than 4.14Hungming Chen2022-05-081-4/+20
| | | | | | | | | | | | | | | | | Kernel version which is older than 4.14 doesn't support UDP offload absolutely. Kernel version which is between 4.14 and 5.8 support UDP offload probably. Simply set kernel 4.14 to be threshold first and monitor on what devices tests fail for improving the offload support checking. Also fix a minor bug which UDP tethering without offload is not tested on R. Bug: 230359047 Test: atest EthernetTetheringTest Change-Id: Ieb181d1b5ed67b922e18ce77a9c96208b2984d10 (cherry picked from commit 08c48a3dff1ff913f882c562fcc3326dd39a4440) Merged-In: Ieb181d1b5ed67b922e18ce77a9c96208b2984d10
* Merge "[Tetheirng] Refactor carrier config to EntitlementManager" am: ↵Tom Hsu2022-04-212-29/+61
|\ | | | | | | | | | | | | | | | | 1135676150 am: 4ba3a8a6fb Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2033668 Change-Id: I3b84544de9942b14bc2e2eb6d80c7eddc7edb916 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * Merge "[Tetheirng] Refactor carrier config to EntitlementManager"Tom Hsu2022-04-212-29/+61
| |\
| | * [Tetheirng] Refactor carrier config to EntitlementManagertom hsu2022-04-212-29/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - To reduce CarrierConfigManager access times, move CarrierManager to TetheringConfiguration. Bug: 225900149 Test: atest EntitlementManagerTest pass Test: atest TetheringConfigurationTest pass Change-Id: I5b206e2bc012cbbca26fb1e5c72558383981f183
* | | Merge "Add bpf forwording packet count test" am: faaaffc8a0 am: fecd68796dTreehugger Robot2022-04-201-11/+62
|\| | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2055845 Change-Id: Icac6c356ac0b9adf95bd2aae12a49cfe4dd67832 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * | Add bpf forwording packet count testHungming Chen2022-04-201-11/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add dumpsys option to dump stats map in BpfCoordinator - Add stats test to check bpf forwording packet count in EthernetTetheringTest Bug: 227159997 Test: atest TetheringCoverageTests Change-Id: I177787ed0c28ebe137ff1431f40a23b1e4b22a19
* | | BpfCoordinator: Add an option to choose which raw bpf map to dump am: ↵Hungming Chen2022-04-201-14/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | e4a6b28938 am: 9f5ffc3304 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2054365 Change-Id: I721cefd5e275b39f34e0e20d9f979647140af8f1 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * | BpfCoordinator: Add an option to choose which raw bpf map to dumpHungming Chen2022-04-201-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make that tethering dumpsys can choose which map to dump. The related functions in BpfCoordinator and its test are refactored into template functions. This is used in the following commits which will dump stats map for testing. Bug: 227159997 Test: atest TetheringCoverageTests Change-Id: I23d747543d16a971773c132b60227eb3f42efe25
* | | Merge "Add onSupportedTetheringType callback" am: c4379c2440 am: fb8dc55f47Mark Chien2022-04-202-21/+81
|\| | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1940847 Change-Id: I824f6f485ce7411ef59a3fa3abbb645869e92f31 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * | Merge "Add onSupportedTetheringType callback"Mark Chien2022-04-202-21/+81
| |\ \
| | * | Add onSupportedTetheringType callbackmarkchien2022-04-202-21/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new callback could tell caller Tethering is supported for what tethering types. Bug: 184996041 Test: atest TetheringTests atest EthernetTetheringTest CTS-Coverage-Bug: 223340235 Change-Id: Ib80ed8d7f73f4a098b8965db186d24d8cf1884d3
* | | | Merge "Move TetherStatsKey and TetherStatsValue to common libs" am: ↵Treehugger Robot2022-04-192-2/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8315d1cf03 am: 00882a40a6 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2054166 Change-Id: Ia523e919734f96e23e543740942fedc00d0068e0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * | | Merge "Move TetherStatsKey and TetherStatsValue to common libs"Treehugger Robot2022-04-192-2/+4
| |\ \ \ | | |/ / | |/| |
| | * | Move TetherStatsKey and TetherStatsValue to common libsHungming Chen2022-04-042-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EthernetTetheringTest needs to parse BPF map content for bpf stats tests. Move the struct class files to common libs. Compare TetherStats{Key, Value}.java between frameworks/libs/net/common and packages/modules/Connectivity/Tethering. There is only the package name change as expected. $ diff packages/modules/Connectivity/Tethering/src/com/android/networkstack/tethering/TetherStatsKey.java frameworks/libs/net/common/device/com/android/net/module/util/bpf/TetherStatsKey.java 17c17 < package com.android.networkstack.tethering; Bug: 227159997 Test: atest TetheringCoverageTests Change-Id: I87193cb6409b4d19c72184011d7e99275800dab1
* | | | Merge "ConnectivityCoverageTests refactoring" am: 1ae9c4ad07 am: 3134ed2b19Remi NGUYEN VAN2022-04-074-107/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2052986 Change-Id: Ieaf0a7a1ff1639bf8924fbc96db4978fc89f7f19 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * | | Merge "ConnectivityCoverageTests refactoring"Remi NGUYEN VAN2022-04-074-107/+2
| |\ \ \
| | * | | ConnectivityCoverageTests refactoringmarkchien2022-04-064-107/+2
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ConnectivityCoverageTests is a combination of several test libs, which are jarjared differently. It causes duplicated classes not to be counted for coverage properly. Build the test suite directly and apply jarjar only once on top of everything. Bug: 227694415 Test: atest ConnectivityCoverageTests Change-Id: I4350ebdbf98030944ec3857e1ef67d76f26c3b16
* | | | Merge "Add config_p2p_leases_subnet_prefix_length configuration" am: ↵Mark Chien2022-04-062-0/+40
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 60f25d6c5b am: b88aea2c58 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1999082 Change-Id: I032d52ab96ee298ffca17e213a4d9ca21db72d80 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * | | Merge "Add config_p2p_leases_subnet_prefix_length configuration"Mark Chien2022-04-062-0/+40
| |\ \ \ | | |/ / | |/| |
| | * | Add config_p2p_leases_subnet_prefix_length configurationmarkchien2022-03-312-0/+40
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new rro configuration which can be used to make the p2p dhcp prefix length larger to reserve the address range outside of leases subnet prefix length for EAPOL-Key feature. This configuration only valid if its value larger than dhcp server address prefix length and config_tether_enable_legacy_wifi_p2p_dedicated_ip is true. E.g.:leaseSubnetPrefixLength = 25, p2p static address = 192.168.49.1/24 dhcp range: 192.168.49.0 ~ 192.168.49.127 (192.168.49.1/25), reserved 192.168.49.128 ~ 192.168.49.255 for EAPOL-Key feature. Bug: 170056953 Test: atest TetheringTests Change-Id: I1319efd871796da7234383a29ab64a1623101ae7
* | | Add test for tetherOffloadClient{Add, Remove, Clear} am: dad664748a am: ↵Hungming Chen2022-03-301-11/+90
|\| | | | | | | | | | | | | | | | | | | | | | | | | | 1dcbf69053 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1744606 Change-Id: I537255a5acff647a8111970a8eaa44d576dbf722 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * | Add test for tetherOffloadClient{Add, Remove, Clear}Hungming Chen2022-03-301-11/+90
| | | | | | | | | | | | | | | | | | | | | | | | also remove the redundant constructor definition in test key/value class builder. Test: atest TetheringCoverageTests Change-Id: Icf93d4f196846c82c3a1c2b2b8697f4a5156ea92
* | | Add test for tetherOffloadRule4Clear am: fa3942c7e7 am: 5b3fe8dc7cHungming Chen2022-03-301-0/+190
|\| | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1838894 Change-Id: Ia36b18bea58862498c571e9f7b3875d70e54f571 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * | Add test for tetherOffloadRule4ClearHungming Chen2022-03-301-0/+190
| |/ | | | | | | | | | | | | Test that clear IPv4 offload rules once tethering stopped Test: atest TetheringCoverageTests Change-Id: I107b15bef2a15f7c85236f2801c43288fe7d0f4d
* | Merge "[DU04-4]Appropriate changes to the NetworkPolicyManager API" am: ↵Frank Li2022-03-161-4/+11
|\| | | | | | | | | | | | | | | cd9fe9b220 am: 1f3f4b22cf Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2022895 Change-Id: I76b1412e6e6d2f82a92a8fc7f8de16682a548e72
| * Merge "[DU04-4]Appropriate changes to the NetworkPolicyManager API"Frank Li2022-03-161-4/+11
| |\
| | * [DU04-4]Appropriate changes to the NetworkPolicyManager APIFrank2022-03-161-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Divide the NetworkPolicyManager API notifyStatsProviderWarningOrLimitReached into the following two APIs: 1. notifyStatsProviderWarningReached() 2. notifyStatsProviderLimitReached() Bug: 216474563 Test: atest NetworkStatsServiceTest NetworkPolicyManagerTest NetworkPolicyManagerServiceTest OffloadControllerTest Change-Id: I473b8b677d492a7076e63f445b3a3be24d25e14d
* | | Merge "Add a carrier config to block tethering." am: 1c12d0790e am: b9331a8fd1Tom Hsu2022-03-161-11/+115
|\| | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1967167 Change-Id: I2d4726fb8a6a85a5ddf6646289e0ba308b3061a8
| * | Merge "Add a carrier config to block tethering."Tom Hsu2022-03-161-11/+115
| |\ \ | | |/ | |/|
| | * Add a carrier config to block tethering.Meng Wang2022-03-161-11/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When KEY_CARRIER_SUPPORTS_TETHERING_BOOL=false, it will behave as if entitlement check failed and a system notifcation shows up if user tries to turn on tethering from Settings UI. Bug: 161206517 Test: manual Change-Id: I78da390ecb0c8f4f68285ef16da80653f136c11e
* | | Merge changes I5af6ce96,Ibc1f6813 am: 3938102448 am: a7033ddecfNucca Chen2022-03-111-150/+326
|\| | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1941933 Change-Id: Idcd5873236e7483786482ee0e3e234071685e0de
| * | Merge changes I5af6ce96,Ibc1f6813Nucca Chen2022-03-111-150/+326
| |\ \ | | |/ | |/| | | | | | | | | | * changes: Refactor make{Tether4Key, Tether4Value ConntrackEvent} helper BpfCoordinatorTest: refactor upstream and downstream setup functions
| | * Refactor make{Tether4Key, Tether4Value ConntrackEvent} helperHungming Chen2022-02-221-95/+216
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Used for reducing the increasing amount of helper in the follow-up commits. Tether4Key, Tether4Value ConntrackEvent need many arguments to build a testing instance. Any new argument combination may require a new helper. It is hard to compare the difference while reading the code. Test: atest BpfCoordinatorTest Change-Id: I5af6ce9609b97d124227750cd1c5337796982c58
| | * BpfCoordinatorTest: refactor upstream and downstream setup functionsHungming Chen2022-02-221-65/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is preparation for tetherOffloadRule4Clear test. - Upstream interface can be set {null, cellular (rawip), wifi (ether)} - Allow that add up to two downstream interfaces which has one client on each of them. - Change mBpfDownstream4Map and mBpfUpstream4Map from mocked instance to TestBpfMap for further rule check. - Remove startPolling() from initBpfCoordinatorForRule4() because upstream information is updated by updateUpstreamNetworkState now. Test: atest TetheringCoverageTests Change-Id: Ibc1f68131410b7cec379ab4e310b90ad85f25d31
* | | Merge "Make isTetheringSupported respect all tethering downstreams" am: ↵Mark Chien2022-03-071-6/+56
|\| | | | | | | | | | | | | | | | | | | | | | | 8dcc3000fd am: ed061b1e09 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1938694 Change-Id: Idf9865302881522eb26c385acf0cb2a6198ef539
| * | Merge "Make isTetheringSupported respect all tethering downstreams"Mark Chien2022-03-071-6/+56
| |\ \
| | * | Make isTetheringSupported respect all tethering downstreamsmarkchien2022-03-071-6/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if wifi, usb and bluetooth tethering is not supported, isTetheringSupported would return false. Then ethernet, ncm tethering and wifi p2p would also not be supported anymore. Make isTetheringSupported respect all tethering downstreams after T. Also remove redundant code: 1. tethering always has upstream configuration, checking whether has upstream configuration for isTetheringSupported is useless. 2. Remove TetheringDependencies#isTetheringSupported because it don't have any caller. Test: atest TetheringTests Change-Id: I3db5ce410c064d37c9e9e704fce2a2b68705834e
| * | | Merge changes from topic "dedup-interfaceparams"Maciej Żenczykowski2022-03-055-5/+5
| |\ \ \ | | |/ / | |/| | | | | | | | | | | | | | * changes: Remove unused InterfaceParams jarjar rule Deduplicate InterfaceParams
* | | | Deduplicate InterfaceParams am: 9f371f024b am: c75bd90328Patrick Rohr2022-03-055-5/+5
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2006832 Change-Id: Idd68a0b18009b923b95cf661f2c49230ef349022
| * \ \ \ Deduplicate InterfaceParams am: 9f371f024bPatrick Rohr2022-03-055-5/+5
| |\ \ \ \ | | |/ / / | |/| / / | | |/ / | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2006832 Change-Id: I5d0139ca8c4a92b7e20c0e5d051ce78920f236a0
| | * | Deduplicate InterfaceParamsPatrick Rohr2022-03-045-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CS should use InterfaceParams from frameworks/libs/net. Test: builds Bug: 222448728 Change-Id: I1f45d3171b265461a8724b4be7b212c030b63fe9
* | | | Merge "Pass whole TetheringConfiguration to IpServer" am: 9edd999725 am: ↵Mark Chien2022-03-032-9/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f815abc7ac Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1999083 Change-Id: Ia6f4c5ca684ea8c42854af0756e391288c3873f6
| * | | Merge "Pass whole TetheringConfiguration to IpServer"Mark Chien2022-03-032-9/+10
| |\ \ \
| | * | | Pass whole TetheringConfiguration to IpServermarkchien2022-03-032-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a no-op CL that passing whole TetheringConfiguration to IpServer to reduce the number of IpServer constructor parameters. Bug: 170056953 Test: atest TetheringTests Change-Id: I4ec17f7ecaefd7f275139ad9c7f7551635b192c9