Commit graph android_packages_modules_Co.../Tethering/tests
Message SHA1
Also update connected clients for local only tethering
mForwardedDownstreams is the set of downstreams who wanted upstream.
In other word, it don't contains localOnly tethering(e.g. local only
hotspot, wifi p2p tethering). Changing the list from mForwardedDownstreams
to mNotifyList make both tethered and localOnly tethering have connected
clients callback.

Bug: 172290164
Test: atest TetheringTests
Change-Id: I58fdb28efc616b00d63a1c237ea93aee4d8f2dcd

markchien   commited 2020-12-22 23:23:09 +08:00
f50f05ebcb
Fix tethering doesn't turn off issue
When user restriction turns on, all tethering functions should
be disabled. But tethering functions still work after
restrication is on. Because tethering request would be removed
from mActiveTetheringRequests after starting tethering that
will result in Tethering#isTetheringActive() always returns
false. Thus, update the design to check tethered interface to
ensure that any of tethering function is working.

Bug: 169596583
Test: atest TetheringTests
Test: Manually test that tethering function would be disabled
      and notification would show to user after restriction
      was on.
Change-Id: Icb9649a5ecdec2d029ac763b5b9b80042ad50eb9

paulhu   commited 2020-11-10 16:47:52 +08:00
862c8a1ea0
Merge "Fix null DadProxy failure in R Tethering unit test"
Mark Chien   authored and   Gerrit Code Review   commited 2020-11-06 11:00:19 +00:00
220e7854bd
Fix null DadProxy failure in R Tethering unit test
Tethering unit test would verify the interfaction between DadProxy and
IpServer. Since DadProxy only available in S+, the test would fail if it
build with R sdk.

Bug: 171936270
Test: atest TetheringTests in both R and S
Change-Id: Ia73d4aa59d01400d1ccfd3fdc1b721e269cae952

markchien   commited 2020-11-05 15:28:56 +08:00
290e7c452b
Adjust visibility for tests
BUG: 167962976
Test: TH
Merged-In: Ic89c084604788b4d41cf854e5015c8ce7791c64d
Change-Id: I12e326167c6fb61a59a919cdd0198ac8f8c84772

Baligh Uddin   commited 2020-11-04 05:06:58 +00:00
ebff93159e
Add visibility rules for packages/modules/Connectivity/Tethering
BUG: 167962976
Test: TH
Change-Id: Id28881b35cf24fc9517fa11af6d8e539ab244fa6

Baligh Uddin   commited 2020-10-29 02:11:55 +00:00
f814b9b1ce
Add shared jarjar rule for tethering tests
Also jarjar com.android.net.module.util* to
com.android.networkstack.tethering.util*.

Bug: 171670016
Test: atest TetheringCoverageTests
Change-Id: I3bde9ad3c41adf36da99bd944303d88ce992201c

markchien   commited 2020-10-26 18:20:25 +08:00
e3126480ba
Add the flag and default enable selectAllPrefixRange
Also add MtsTetheringTest which only run if tethering mainline
module is installed.

Bug: 166057846
Bug: 170265597
Test: atest TetheringTests
Change-Id: I434dda81eb5fab700d873a8ff3429b4222f0c7e6

markchien   commited 2020-10-19 16:50:29 +08:00
4607c5535b
Merge "Fix miss tracking downstream problem in PrivateAddressCoordinator"
Mark Chien   authored and   Gerrit Code Review   commited 2020-10-15 12:07:19 +00:00
8565b0244a
Fix miss tracking downstream problem in PrivateAddressCoordinator
The downstream do not be tracked if PrivateAddressCoordinator just
return cached address. Then, PrivateAddressCoordinator would not notify
that downstream if conflict happen.

Also remove the null check in getDownstreamPrefix because:
- An IpServer is only added to mDownstreams by requestDownstreamAddress.
- That method will only add the IpServer to mDownstreams if it has an
IPv4 address.
- As soon as that method returns, the IpServer sets mIpv4Address to the
address that was returned.
- When an IpServer is torn down, mIpv4Address is set to null after
releaseDownstream is called.

So it should never be possible for this to return null.

Bug: 168169687
Test: atest CtsTetheringTest
      atest TetheringTests
Change-Id: Ide5206b013acdc499344e1c839a830c5b245af41

markchien   commited 2020-10-15 16:21:12 +08:00
634f0a8ec1
Merge "Test conflict notification work when using cached address"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-10-14 13:18:58 +00:00
32456142c0
Test conflict notification work when using cached address
This test catch the regression introduced in r.android.com/1432958.

Bug: 1432958
Test: atest TetheringTest

Change-Id: Id0c1afb5563954ffee1f598a3a5de6a245d77a0e

markchien   commited 2020-10-14 17:02:29 +08:00
ccf07b1dd6
Merge "Allow tethering pick prefix from all of private address range"
Mark Chien   authored and   Gerrit Code Review   commited 2020-10-13 13:12:58 +00:00
8c9a2645d8
Allow tethering pick prefix from all of private address range
Currently tethering only pick prefix from 192.168.0.0/16. There is no
aviable tethering address if the upstream address is 192.168.x.y/16.
This change allow tethering to pick prefix from any private address
rnages. Now it still pick from 192.168.0.0/16 only to avoid behavior
change. Will have follow up commit to change the configuration.

Bug: 166057846
Bug: 170265597
Test: atest TetheringTests
      atest CtsTetheringTest

Change-Id: Ib6304eb8b4788e9196d0af48e72f00a6bda73a5f

markchien   commited 2020-10-13 16:45:09 +08:00
d9acdccbd3
Use IpUtils, NetworkStackConstants in DadProxyTest
The test had TODOs to address to use IpUtils and NetworkStackConstants
classes once they were moved to frameworks/libs/net. This is now done,
so using the new classes.

Bug: 158042941
Test: atest TetheringPrivilegedTests
Change-Id: I536b4506dbc3b42547ba9cb4e7c3c7a3e9459dd1

Remi NGUYEN VAN   commited 2020-10-13 11:30:03 +09:00
71b9e93a83
Merge "Move IpUtils to frameworks/libs/net"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-10-09 00:13:40 +00:00
4cb4ef8333
Make the IP subnet persistent till reboot
Make the IP subnet persistent if it do not conflict with upstream.
It allow client to reuse its IP that usually reduce DHCP procedure.

Bug: 168169687
Test: atest TetheringTests
Change-Id: Iddc5304730dce7b11c5d124b7eddce057d752bbd

markchien   commited 2020-10-06 20:25:19 +08:00
a2ffad84c7
Move IpUtils to frameworks/libs/net
The utility classes are useful for mainline modules and their tests, for
example IpClientIntegrationTest.

Bug: 168868607
Test: m && atest NetworkStaticLibTests
Change-Id: If2b1613aa18a7990391e2d31cc2951ca93f1cf3c

Remi NGUYEN VAN   commited 2020-10-05 14:38:19 +09:00
2494a06bb3
Merge "Make PrivateAddressCoordinator ignore vpn network"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-10-05 04:10:48 +00:00
0b1e7d8956
Fix OffloadHardwareInterfaceTest.
r.android.com/1424920 changed the code but forgot to update the
unit test.

Also fix some lint errors.

Bug: 149109043
Test: atest TetheringTests TetheringPrivilegedTests
Change-Id: I53ca4b9877dcb4a759dee6ec63133653315d826f

Lorenzo Colitti   commited 2020-09-30 17:04:19 +09:00
c99ef48090
tethering: offload: Netlink Req NfGen
Add the netfilter generic message header to
the netlink req. This is needed so the kernel
won't ignore the request for invalid params.

Bug: 149109043
Test: ConntrackSocketTest
Change-Id: I1757fdeb11a0cac5821021a22323cbd74fe22bdc

Tyler Wear   authored and   Lorenzo Colitti   commited 2020-09-30 15:07:47 +09:00
7f70074abc
Make PrivateAddressCoordinator ignore vpn network
If vpn app make its netmask as 0, PrivateAddressCoordinator
would not able to find suitable address for tethering downstream.
Since tethering do not support vpn as upstream, just ignore vpn
in PrivateAddressCoordinator.

Bug: 166365863
Test: atest TetheringTests
      atest CtsTetheringTest
Change-Id: Iabe265467044fea9fa437674ca29ffc7bcdefe3b

markchien   commited 2020-09-28 17:22:19 +08:00
1a2163b972
Merge "Remove double check interface by NetworkInterface"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-09-28 04:21:28 +00:00
f5096cc1e3
Remove double check interface by NetworkInterface
NetworkInterface#getByName can not get the interface without IP addresses.
When setIncludeTestInterfaces(true) is called, the interface will be
placed in client mode, which will delete the link-local address. So calling
NetworkInterface#getByName to get test interface may not work before
switching to server mode.

Bug: 168215721
Test: atest CtsTethering
Change-Id: Ice8adcce1c4b2c86bd219c701b2afa9ba2339f24

markchien   commited 2020-09-27 17:11:20 +08:00
f609923b4b
Merge "Remove unused testutils lib from tethering tests"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-09-24 08:16:21 +00:00
a8e68bb723
Remove unused testutils lib from tethering tests
frameworks-base-testutils is unused in tethering integration tests, so
the dependency can be removed.
That test library also contains test classes, so removing the dependency
allows tethering tests to stop running the associated tests.

Also add jarjar rules to the unit tests to zap (remove) the test classes
from the output APK. Ideally the unit tests should stop depending on
that library too (TestableLooper can be used instead of TestLooper), or
the frameworks-base-testutils library should stop including test
classes.

Bug: 167968946
Test: m CtsTetheringTest TetheringTests
Change-Id: Ie950ce5b6181e388a7f71da430fd2dd8ada32e49

Remi NGUYEN VAN   commited 2020-09-23 17:10:42 +09:00
8f59ec090d
Merge "tethering: DAD Proxy Daemon"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2020-09-23 04:57:42 +00:00
72e81859f8
tethering: DAD Proxy Daemon
DAD proxy daemon responsible for forwarding NS/NA between
tethered iface and upstream iface.

Change-Id: I2e58e10e7fa7dba6a6f63ad03b000549f3afc37e

Tyler Wear   commited 2020-09-22 11:58:49 -07:00
90e4063fd2
Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2

Xin Li   commited 2020-08-31 21:21:38 -07:00
82a71b8f72
Rename Kotlin util files to not include the Kt suffix
Callers don't care what language the utilities are written in

Test: builds
Change-Id: Ie212144f36c50db223c05f3fcb6bad745842cb5e

Chalard Jean   commited 2020-08-12 10:02:50 +09:00
96924bf201
Merge "Verify pending intent flags"
Paul Hu   authored and   Gerrit Code Review   commited 2020-08-10 01:32:12 +00:00
346a361e93
Merge changes I33b70b0a,I1074eedb
* changes:
  Remove the services.net-module-wifi module target.
  Revert "Revert "Move Inet[4]AddressUtils to libs/net""

Chalard Jean   authored and   Gerrit Code Review   commited 2020-08-07 06:45:15 +00:00
8818498877
Revert "Revert "Move Inet[4]AddressUtils to libs/net""
This patch is still needed and should go in now that the
error is fixed.
The patch was submitted into rvc-dev and is already in
rvc-dev-plus-aosp (patch in in ag/11923559, revert
skipped in ag/12072199). A follow-up will remove the
unused services.net-module-wifi target.

Test: originally tested in aosp/1324109
Test: m; manual: flashed, wifi and telephony working
Test: atest NetworkStackCoverageTests
Change-Id: I1074eedb0b0f156a1135e11210ec102de15ea674
Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b

Chalard Jean   commited 2020-08-07 03:31:04 +00:00
78701646dd
Merge "Allow wifi p2p to use legacy dedicated address"
Mark Chien   authored and   Gerrit Code Review   commited 2020-08-05 06:01:37 +00:00
d2af4d9e2a
Allow wifi p2p to use legacy dedicated address
Some exsting applications may expect wifi p2p use legacy
"192.168.49.1/24" address. Have a configuration for wifi p2p to
decide whether to use legacy dedicated address or random address.

Bug: 161520826
Test: atest TetheringTests
Change-Id: If79973416a6780ee19ee785c65772b1a2dc1fbf7

markchien   commited 2020-08-05 11:03:46 +08:00
eb8fec2111
Verify pending intent flags
All PendingIntent included activity and broadcast should set
FLAG_IMMUTABLE flag.

Bug: 156353008
Test: atest TetheringTests
Change-Id: I4592e914b67ecb8865d7de47797423f27e9ff840

paulhu   commited 2020-08-04 11:24:33 +08:00
f603ed5fb8
Merge "Update language to comply with Android's inclusive language guidance"
Chiachang Wang   authored and   Gerrit Code Review   commited 2020-07-30 02:49:44 +00:00
e66098036f
Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code
for reference.

Test: m ; atest TetheringTests
Bug: 161896447
Change-Id: Idc58697c72fb00896bee00185fefc50c1a24dd35

Chiachang Wang   commited 2020-07-29 12:05:04 +08:00
14aaefcb12
Always stop dhcp server even it is obsolete
If dhcp server is obsolete, explicitly stop it to shut down its thread.

Bug: 161418295
Test: atest CtsTetheringTest
Change-Id: Ic5b876bd23711ec8d832879a7baee0495246b218

markchien   commited 2020-07-29 09:55:29 +08:00
af2670f427
Merge "Add tethering privileged test" am: af9ec640c9 am: adda81e88f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1345361

Change-Id: Id673131e628856ea57475384160baeac5e10de1b

Mark Chien   authored and   Automerger Merge Worker   commited 2020-07-16 04:41:20 +00:00
c882e8c995
Merge "Add tethering privileged test"
Mark Chien   authored and   Gerrit Code Review   commited 2020-07-16 04:12:58 +00:00
af9ec640c9
Add tethering privileged test
Create TetheringPrivilegedTests which have MAINLINE_NETWORK_STACK
permission, the test can perform various network-related operations
which need CAP_NET_RAW and CAP_NET_ADMIN capabilities.

Bug: 145490751
Test: make TetheringPrivilegedTests
Change-Id: Ic205e5183e066766377c63336d9c5171d4875c6a

markchien   authored and   Mark Chien   commited 2020-07-16 04:12:01 +00:00
88f0428056
Merge "Fix EthernetTetheringTest failure if tethering is not supported" am: dace79b0ac am: 8b74fe1c8b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1352244

Change-Id: I6763589a3af8cd78efc53e0637ff4f9d6ebcef88

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-07-13 09:35:07 +00:00
218040ca26
Merge "Fix EthernetTetheringTest failure if tethering is not supported"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-07-13 09:05:00 +00:00
dace79b0ac
Fix EthernetTetheringTest failure if tethering is not supported
Do not run ethernet tethering tests if tethering is not supported
because Tethering APIs would fail. Also skip the test if
EthernetManager is not avaliable. EthernetManager would be null if
there are no FEATURE_ETHERNET and FEATURE_USB_HOST.

Bug: 159869957
Test: atest CtsTetheringTest
Change-Id: I2b9be6799c6edeefc8cd74897a8704dbe80dd061

markchien   commited 2020-07-13 15:24:45 +08:00
45fb1aae66
Merge "Skip testPhysicalEthernet if the test run adb over network" am: b68d322521 am: 10daa1daae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1354445

Change-Id: I5e91a05d90f5f05cdbe7e7b30945d80832759bd2

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-07-08 05:06:20 +00:00
c8f45d6350
Merge "Skip testPhysicalEthernet if the test run adb over network"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-07-08 04:41:34 +00:00
b68d322521
Revert "Move Inet[4]AddressUtils to libs/net"
This reverts commit cf86031c12.

Reason for revert: Breaks the build b/160390899

Merged-In: Icd141a992c46290c74929785e261a1cd57bc001b
Change-Id: Ie10e66f61393602f17fbb61bf17230b176bf1f44

Chalard Jean   authored and   Remi NGUYEN VAN   commited 2020-07-02 23:47:35 +00:00
6b66d70ba1
Skip testPhysicalEthernet if the test run adb over network
If the test run adb over network and ethernet is available, it is likely
that adb may run over ethernet. Then the test would fail because adb
would break when ethernet is switching from client mode to server mode.

Bug: 160389275
Test: atest CtsTetheringTest

Change-Id: I57d365d33316881c50c3bf7fd1c98926d10842d3

markchien   commited 2020-07-02 23:26:46 +08:00
37ad92e058
Move Inet[4]AddressUtils to libs/net
The classes should not be picked up from frameworks/base, as they are
part of several mainline modules.

Also refine comments in DhcpResults following feedback in previous
change.

(cherry-pick from internal branch skipping wifi classes; no other
conflict)

Bug: 151052811
Test: m; manual: flashed, wifi and telephony working
Test: atest NetworkStackCoverageTests
Merged-In: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f

Change-Id: I7074651c6a2a7a6b11bcf13cc4bb03833d7d655f

Remi NGUYEN VAN   commited 2020-07-02 10:52:31 +09:00
cf86031c12