summaryrefslogtreecommitdiff
path: root/tests/net/java/com/android/server/NetworkManagementServiceTest.java
Commit message (Collapse)AuthorAgeFilesLines
* Move net unit tests to packages/ConnectivityRemi NGUYEN VAN2021-05-131-315/+0
| | | | | | | | | | | | | | 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 Ignore-AOSP-First: needs per-branch move for merge conflicts Change-Id: I254ffd1c08ec058d594b4ea55cbae5505f8497cc
* Merge "[IT4.2] Update argument type of interfaceClassDataActivityChanged"Chiachang Wang2020-12-281-3/+3
|\
| * [IT4.2] Update argument type of interfaceClassDataActivityChangedChiachang Wang2020-12-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | The argument type of interfaceClassDataActivityChanged takes a string for the network type. It requires both the receivers and NMS to do type transformation. The transformation is a redundant work. Update it to take integer directly and rename to understandable naming. Bug: 170598012 Test: atest FrameworksNetTests Change-Id: Ibe9fa7a1b71af2dab916b5d615742e77e4174c39
* | Merge "Update usage of allowlist/denylist in some method names/comments."Sudheer Shanka2020-12-241-4/+4
|\ \ | |/ |/|
| * Update usage of allowlist/denylist in some method names/comments.Sudheer Shanka2020-12-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | In a previous change (https://r.android.com/1394342), we did a mass update of whitelist->allowlist and blacklist->denylist in network policy related code. Updating some usages of those (like allowlisted to allowed) to make them sound natural. Test: atest services/tests/servicestests/src/com/android/server/net/NetworkPolicyManagerServiceTest.java Test: atest services/tests/servicestests/src/com/android/server/NetworkManagementInternalTest.java Test: atest hostsidetests/net/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java Change-Id: I6d34b0bd3cdb64d5872874fd9378bfc962a24f8d
* | [IT04] Add uid as parameter of interfaceClassDataActivityChangedChiachang Wang2020-12-221-9/+8
|/ | | | | | | | | | | | Add uid into interfaceClassDataActivityChanged in INetworkManagementEventObserver. This helps the listeners to use BaseNetworkObserver to listen for target evnets instead of using whole INetdUnsolicitedEventListener with no-op in other event that listeners do not care about. Bug: 170598012 Test: m ; atest FrameworksNetTests Change-Id: I2a42a522c2ff9b1e0be88261a8574bb7f5292fa6
* Add Restricted Mode Firewall ChainPatrick Rohr2020-11-301-1/+8
| | | | | | | | | | Adding new allowlist firewall chain to support restricted networking mode. See go/restricted-networking-mode. Bug: b/157505406 Bug: b/170323408 Test: atest NetworkManagementServiceTest Change-Id: I8e39b3d7b129ad74224d0c1311135b7b48f6514f
* Clean Up NetworkManagementService TestsPatrick Rohr2020-11-301-5/+119
| | | | | | | | | | Cleaning up tests, so I can easily add more for restricted networking mode. I merged the NetworkManagementInternalTests with the NetworkManagementServiceTests. Test: atest NetworkManagementServiceTest Change-Id: If8c3cc1883cfb2524eeb78e23165fc868130f0e7
* Cleanup NetworkManagementService for Netd commnads binder migrartionLuke Huang2019-03-201-97/+33
| | | | | | | | remove dead code used for netd UNIX sokcet Bug: 65862741 Test: atest NetworkManagementServiceTest FrameworksNetTests Change-Id: I5db61cb86325b71ac8a8fce7b15dbf569abc5935
* Migrate frameworks/base/tests/net/ to androidx.testBrett Chabot2019-03-051-5/+6
| | | | | Test: atest FrameworksNetTests Change-Id: Iaa59d606f5e1678cc5aaca9ed37e184fad894e5d
* Prevent crash in NetworkManagementServiceTest#shutdown()Hugo Benichi2018-01-291-2/+6
| | | | | | | | | | | | | | | | | | | | The shutdown method in NetworkManagementServiceTest was trying to close the local socket on the test side, causing the NativeDaemonConnector internal to NetworkManagementService to sometime crash due to the output stream on NetworkManagementService side to throw on pending reads. The correct fix would be to shutdown the NativeDaemonConnector inside NetworkManagementService and implement NetworkManagementService's shutdown method, however there is no way to cleanly close a NativeDaemonConnector. Instead, this patch doesn't do any cleanup of the listening socket, the test local socket, and its output stream. These objects' resources get eventually collected by the system when the test process exits. Test: runtest frameworks-net Change-Id: I72c9aa43403754b55e9d23bf4f3ba8b7b4a3e10a
* Make NetworkManagementServiceTest pass again.Lorenzo Colitti2017-08-231-0/+254
1. Mock the service manager so that NMS can fetch mock versions of INetd and IBatteryStats. 2. Call LocalServices.removeServiceForTest to avoid a duplicate service registration error. // check this 3. Change the timeout from 100ms to 200ms, as otherwise the tests that check for IfaceClass fail. 4. Convert NetworkManagementServiceTest to JUnit 4. 5. Move NetworkManagementServiceTest to tests/net Bug: 29337859 Bug: 32163131 Bug: 32561414 Bug: 62918393 Test: runtest frameworks-net Change-Id: Ic7371b427b35809ccd446addf35c9d8ae99ccfd3