summaryrefslogtreecommitdiff
path: root/tests/unit/java/com/android/server/NsdServiceTest.java
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Temporarily disable NsdService unit tests"Remi NGUYEN VAN2022-06-151-3/+1
| | | | | | | | | | | This reverts commit a3ce8f84382b678695a40416d35f6c35f9d52cc8. Reason for revert: Prebuilts should be newer now Change-Id: I717288c9a2e25fb9bc358a61beb8877144ed078c Merged-In: Ib1d180cc799dde94ada642ce752623b4b65f1e31 Merged-In: I44dda14cae265e600010c6f8efe1471ac481c6ea Merged-In: I702a75e91be0bb582f9cbd7b4a23e1286f8252cf
* Temporarily disable NsdService unit testsRemi NGUYEN VAN2022-06-021-1/+3
| | | | | | | | | | | | | | | | The unit tests cannot pass before a newer prebuilt of Tethering is used, as bootclasspath classes that it tests would be outdated. This change is not merged in downstreams that build from source (changes in the merged-in tags are not related changes, however). Bug: 234099453 Test: atest Merged-In: Ib1d180cc799dde94ada642ce752623b4b65f1e31 Merged-In: I44dda14cae265e600010c6f8efe1471ac481c6ea Merged-In: I702a75e91be0bb582f9cbd7b4a23e1286f8252cf Change-Id: I5b0cb131fcb5feb6b3cfd70e95ba7c5e54fa2294
* Fix service resolve on tethering downstreamsRemi NGUYEN VAN2022-06-011-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | Tethering downstreams do not have NetworkAgents, and although they have a netid of 99, Networks with netId 99 are not usable by apps for most connectivity APIs. Recent refactoring in NsdService adds the Network of a found service into its NsdServiceInfo, and uses that network to resolve the service. In that case the Network has netId 99 and resolving the service fails. Avoid that problem by: - Keeping the Network field null when a service is found on a tethering downstream; this avoids giving apps a confusing and unusable Network with netId 99 - Using the interface index found during discovery to resolve the service, if the app uses the NsdServiceInfo that was obtained from discovery to resolve. If not, all interfaces will be used to resolve, as per legacy APIs. Bug: 233979892 Test: atest NsdServiceTest Also manual test with 2 devices connected via hotspot Change-Id: Idd176153b67ccbd1d4f1b1fd66dafaa2f3a9e27a (cherry picked from commit 1a8ee102d3cc9829b669b09685b17ea92815b671) Merged-In: Idd176153b67ccbd1d4f1b1fd66dafaa2f3a9e27a
* Use MDns aidl on NsdServicepaulhu2022-04-041-72/+61
| | | | | | | | | | | - Use MDns aidl to communicate with mdns service and register event listener to receive callback. - Remove all NDC relevant code on NsdService. - Use MDns aidl on NsdServiceTest. Bug: 209894875 Test: atest FrameworksNetTests CtsNetTestCases Change-Id: I65929dee3838fef753396e86c665abd66b6fec81
* Add APIs for discover/resolve on specific networksRemi NGUYEN VAN2022-02-031-2/+2
| | | | | | | | | | | Test that NsdManager specifies the correct network when a service is discovered, and that services can be resolved on a specified network. Also test that service discovery can be started on a specific network. Bug: 190249673 Test: atest NsdManagerTest Change-Id: Ie8b551ce9e33e3adf35f75508f91bbd0df71f837
* Remove NsdSettings from testpaulhu2021-12-031-8/+1
| | | | | | | | | NsdSettings has been removed from NsdService, so the test needs to update accordingly. Bug: 206702844 Test: atest FrameworksNetTests CtsNetTestCases Change-Id: I23b6323b2d870746737370b9a3fc90e530e3d2ed
* Update NSD tests without AsyncChannelRemi NGUYEN VAN2021-11-181-24/+78
| | | | | | | | | Update the tests to use the newer NsdManager based on Binder interfaces instead of AsyncChannel. Bug: 190249673 Test: atest NsdManagerTest NsdServiceTest Change-Id: I0991b598331e335a0bc211f010da7f034fb2441b
* Modify Nsd{Service,Manager}Test to conform to its changeLuke Huang2021-09-131-5/+42
| | | | | | | | | (clean cherry-pick from downstream branch) Test: atest NsdManagerTest NsdServiceTest Bug: 191844585 Merged-In: I3cf658498bef5755dcb01127a94fff913b6e6298 Change-Id: I3cf658498bef5755dcb01127a94fff913b6e6298
* Re-skip connectivity unit tests before SRemi NGUYEN VAN2021-06-301-2/+5
| | | | | | | | | | | | | | | | | | 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 Change-Id: I5808d34459a4c19238baf8873afa7cf942828460
* Revert "Skip connectivity unit tests before S"Remi NGUYEN VAN2021-06-291-3/+0
| | | | | | | | | This reverts commit 05dd1ba54005b15d92daf6f26329acf91fb3debb. Reason for revert: Skips more tests than it should in AOSP Bug: 192302892 Change-Id: I7c5638d8c1cc626354d240a06af758e1cdd92e94
* Skip connectivity unit tests before SRemi NGUYEN VAN2021-06-251-0/+3
| | | | | | | | | | | | | 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. Bug: 187935317 Test: atest ConnectivityCoverageTests on R Change-Id: I10da45ae023e7f1e8cd11ec857b84346892a3fa8
* Fix the comments from aosp/1719018Luke Huang2021-06-211-18/+35
| | | | | | | | | 1. Test {start,stop}-service 2. Add waitForIdle Bug: 181810560 Test: atest NsdServiceTest Change-Id: I0953887d1d92a644a29a2e80521469c8cc2aa2fc
* Modify NsdServiceTest to conform to its new mechanismLuke Huang2021-06-081-8/+53
| | | | | | | | | Adapt NsdServiceTest to its new mechanism for starting/stopping daemons. Also, add a new test for the new self-cleanup mechanism. Bug: 181810560 Test: atest NsdServiceTest Change-Id: I4c485a5d8fb4d6f52d82633a579bce4feb5c6375
* Move net unit tests to packages/ConnectivityRemi NGUYEN VAN2021-05-131-0/+194
Move the tests together with packages/Connectivity code, so both can be moved to packages/modules/Connectivity together. Also reorganize unit tests in a unit/ directory, as other tests (integration/, common/ etc.) have been added in tests/net since they were created. This makes the directory structure consistent. Test: atest FrameworksNetTests Bug: 187814163 Merged-In: I254ffd1c08ec058d594b4ea55cbae5505f8497cc Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc