summaryrefslogtreecommitdiff
path: root/Tethering/tests/integration/src
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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
* 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 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
* Add onSupportedTetheringType callbackmarkchien2022-04-201-4/+22
| | | | | | | | | | | | 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
* Fix EthernetTetheringTest testTestNetworkUpstream flakymarkchien2022-02-221-18/+45
| | | | | | | | | | | | | | The test assume the first tethering upstream would be test network. But if there are mutiple networks available, this is a wrong assumption because of race condtion. If tethering choose upstream while wifi or celluar is available but test network may not available for tethering yet (it depend on the NetworkCallback from ConnenectivityService), the first upstream may not be the test network. Bug: 215224286 Test: atest EthernetTetheringTest Change-Id: Idfa972008643f1fb5119179383b06e2c8f65c667
* Add test for IPv4 UDP forwarding rules in BPF mapHungming Chen2022-02-151-6/+145
| | | | | | | | | Parse the dumpsys output strings to check that the IPv4 UDP forwarding rule is added by the UDP conntrack event on the tethering interface. Test: atest EthernetTetheringTest Change-Id: I2f04af72e51ca6b7a37ba51daa4f5125cb11144c
* Add tethering IPv4 UDP forwarding testHungming Chen2022-01-032-7/+279
| | | | | | | | | This is a preparation for testing IPv4 BPF offload. - Add an ARP responder. - Add a basic UDP forwarding test. Test: atest EthernetTetheringTest Change-Id: I720a5a2c4b97493eb6a5570cecd73dfc1eabf5cd
* Support testing upload/download packetsmarkchien2021-11-291-13/+29
| | | | | | | | | This is a preparing CL to test the packets sent from clients and the packets replied from remote side. Bug: 183166581 Test: atest EthernetTetheringTest Change-Id: I898de024c0d9ecf13d81023035242c4abf856702
* Move runDhcp to TetheringTestermarkchien2021-09-302-80/+163
| | | | | | | | This is a no-op CL which add TetheringTester and move runDhcp related logic to it. Test: atest EthernetTetheringTest Change-Id: Ib1c5647b2bd5a1b27c976450d3aa265aff8f5b70
* Rename mTapPacketReader to mDowntreamReadermarkchien2021-09-301-10/+10
| | | | | Test: atest EthernetTetheringTest Change-Id: I2905aba449a2625caf6a82b27b9e43b06191da9f
* Support set test network to tethering upstreammarkchien2021-09-301-20/+94
| | | | | | Test: atest EthernetTetheringTest Change-Id: Ief2a92bc6c573a6bb75c72b7a0630e5c0accfa73
* Give EthernetTetheringTest the restricted networks permission.Lorenzo Colitti2021-08-241-2/+6
| | | | | | | | | This test fails on devices where physical Ethernet interfaces are available but marked restricted, like cuttlefish. Bug: 197462993 Test: test-only change Change-Id: I15c991b2e43e2d5e823dcdcfbd74adfd9b2f6f08
* Test tethered callback with TetheringInterfacemarkchien2021-06-011-5/+15
| | | | | | | | | | | | | | | The old callback only report interface list, new callback could provide the mapping of interface and type. Replace old callback usage in cts with new callback and check whether old callback could get the correct interface list by comparing the result between old and new callback. Bug: 162920185 Bug: 152203943 Test: atest CtsTetheringTest on S atest CtsTetheringTestLatestSdk on R atest MtsTetheringTestLatestSdk on S and R Merged-In: I2a0b8c43fb340c3eaed7f0f90464199222a24280 Change-Id: I2a0b8c43fb340c3eaed7f0f90464199222a24280
* Fix some TetheringCoverageTest failuremarkchien2021-05-121-1/+2
| | | | | | | | | | 1. Fix no ACCESS_NETWORK_STATE permission problem when accessing EthernetManager#getAvailableInterfaces API from S. 2. Fix some wrong jarjar rules. Bug: 187371740 Test: atest TetheringCoverageTest on R platform Change-Id: I203db6c4ea2e13d8fb5bc2db7ee877ccbb97b761
* Allow callers of startTethering to choose local-only mode.Lorenzo Colitti2021-04-191-7/+136
| | | | | | | | | | | This is useful for OEMs that want to use RNDIS or NCM as a local-only link that is directly connected to some other host. This can be used to implement USB tethering using NCM, which currently only supports local-only mode. Bug: 175090447 Test: TetheringIntegrationTests:EthernetTetheringTest#testLocalOnlyTethering Change-Id: I0ffaa46e4640e5b235340a15d25909106ceb0c07
* Remove double check interface by NetworkInterfacemarkchien2020-09-271-1/+0
| | | | | | | | | | | | 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
* Rename Kotlin util files to not include the Kt suffixChalard Jean2020-08-121-2/+2
| | | | | | | Callers don't care what language the utilities are written in Test: builds Change-Id: Ie212144f36c50db223c05f3fcb6bad745842cb5e
* Merge "Fix EthernetTetheringTest failure if tethering is not supported"Treehugger Robot2020-07-131-5/+9
|\
| * Fix EthernetTetheringTest failure if tethering is not supportedmarkchien2020-07-131-5/+9
| | | | | | | | | | | | | | | | | | | | | | 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
* | Skip testPhysicalEthernet if the test run adb over networkmarkchien2020-07-021-0/+11
|/ | | | | | | | | | | 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
* Gate exemptFromEentitlementCheck by Network_STACK permissionmarkchien2020-05-291-2/+2
| | | | | | | | | | Shell has TETHER_PRIVILEGED permission. To avoid any service to adopt shell identity by lunching service with Shell process, gate exemptFromEentitlementCheck by NETWORK_STACK. Bug: 157702014 Test: atest TetheringCoverageTests Change-Id: I6ddfda23d36ea9981e3e1eb5a87767f452a65852
* Extend timeout for requesting tethered interfacemarkchien2020-05-281-3/+5
| | | | | | | | | | | | | | 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
* Add TetheringCoverageTestspaulhu2020-04-151-1/+3
| | | | | | | | | | | Bug: 148636687 Test: atest TetheringCoverageTests atest TetheringTests atest TetheringIntegrationTests atest NetworkStackTests atest CtsTetheringTest Change-Id: I1f2a50f16894b05e988476520ba25baba0b60d88 Merged-In: I1f2a50f16894b05e988476520ba25baba0b60d88
* Fix TetheringIntegrationTests failurepaulhu2020-04-081-1/+1
| | | | | | Bug: 150644681 Test: atest TetheringIntegrationTests Change-Id: I5a537eca9b1aab3694a11a2dab147a31f289314c
* Add a test for static IPv4 address tethering configuration.Lorenzo Colitti2020-04-031-20/+109
| | | | | | Bug: 150644681 Test: test-only change Change-Id: I8f4a99da2351fdb5467f561a9732b14a8ebf674b
* Use CompletableFuture instead of a latch.Lorenzo Colitti2020-03-271-19/+18
| | | | | | | | Addresses review comments on aosp/1260100. Bug: 150644681 Test: test-only change Change-Id: Ia73ba8a121a3744a5e36795d2d2bff2f099c1394
* Add an Ethernet tethering test.Lorenzo Colitti2020-03-271-0/+460
This test uses EthernetManager's ability to use test network interfaces to test tethering. This provides a fairly realistic integration test for Tethering and its callbacks, IpServer and DhcpServer, and so on. It is in a new integration/ directory under Tethering because I didn't really know where to put it. It's fast enough to run in presubmit, but it didn't seem to be appropriate to call it a unit test, and in the future we could also use this test to do some limited testing of real Ethernet tethering as well. Bug: 150644681 Test: atest TetheringIntegrationTests:EthernetTetheringTest --rerun-until-failure 100 Change-Id: Ifcda70b73848b1fd4c26b031e53f0a6500cc93d4