summaryrefslogtreecommitdiff
path: root/tests/unit/java/android
Commit message (Collapse)AuthorAgeFilesLines
* Verify converting to Vpnprofile with IkeTunnelConnectionParams setchiachangwang2022-09-201-0/+36
| | | | | | | | | | | | | Add test to verify converting Ikev2VpnProfile to Vpnprofile with IkeTunnelConnectionParams set. Some fields like server should not be set since the information should contain in the assigned IkeTunnelConnectionParams. Bug: 243718982 Test: atest FrameworksNetTests Change-Id: Ie019ea98932a6d079f213e3bff45f21b44d3fa4e (cherry picked from commit 4e953f63dd419fa7793d07857bcb281a499654f6) Merged-In: Ie019ea98932a6d079f213e3bff45f21b44d3fa4e
* Add test to verify null ProxyInfo in Ikev2VpnProfilechiachangwang2022-09-061-0/+17
| | | | | | | | Bug: 244281603 Test: atest FrameworksNetTests Change-Id: Ice195b60a0f62ae541ede9277c6e36f9c72b2dbb (cherry picked from commit 715dc5b4475fb023afd2567c482107f8ab34f1b4) Merged-In: Ice195b60a0f62ae541ede9277c6e36f9c72b2dbb
* Revert "Disable NetworkStatsRecorder Test"Aaron Huang2022-06-221-2/+0
| | | | | | | | | This reverts commit befadfe3d124b7e6484cdc8693013513c7afb1fc. Reason for revert: Prebuilts are updated and tests should pass now Change-Id: Iccbce39fccc1d47deac8beec4de7c3815c086f86 Merged-In: I47fb59334d00ae7fee91c5694548b3cf89b09b2d
* Disable NetworkStatsRecorder TestAaron Huang2022-06-171-0/+2
| | | | | | | | | | | | | | Disable test since it won't pass until prebuilt module updated. Ignore-AOSP-First: urgent fix and will cherry-pick immediately after. Bug: 233828210 Bug: 234099453 Test: FrameworksNetTests (merged-in tag is pointed to an unrelated CL that only exists on aosp and its downstreams, to make this CL doesn't get merged in aosp downstreams) Change-Id: I81b43e6a1410e7cf241487ef213acf0cbcfd019d Merged-In: I47fb59334d00ae7fee91c5694548b3cf89b09b2d
* Add wipeOnError flag to NetworkStatsRecorderAaron Huang2022-06-171-0/+88
| | | | | | | | | | | | | | | If reading data happens exception while doing data migration, the file will be deleted by legacy recorders. This would cause legacy persistent data being lost and cannot be retrieved by any method. To avoid the files being deleted, add a wipeOnError flag to recorder which indicates this recorder will wipe on error or not . If the flag is set to true then deletes all files when it throws, otherwise keeps all files. Ignore-AOSP-First: urgent fix and will cherry-pick immediately after. Bug: 233828210 Test: FrameworksNetTests:NetworkStatsRecorderTest Change-Id: Id7a3d8bebf8a00d814f9e84bf4c10d927e6ff749
* 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/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Don't clobber existing history entries.Lorenzo Colitti2022-05-181-8/+0
| | | | | | | | | | | | | | | | | | Currently, adding a history to a NetworkStatsCollection.Builder will overwrite any history that was previously passed in with the same key. This breaks the importer (which is the primary/only caller of this code), because the importer re-uses the same NetworkStatsCollection object to import multiple files. Instead, simply add any passed-in entries after the ones that were already there. Require the caller to pass in entries in order, because NetworkStatsHistory internally assumes that entris are always sorted. Ignore-AOSP-First: in a topic with internal-only changes Bug: 230289468 Test: manually verified this unbreaks the importer Change-Id: Ic8647ff28fca78d579d5f759f96a864877f8158b
* [MS81] Support remove history before cutoff timestampJunyu Lai2022-05-162-9/+94
| | | | | | | | | | | This is needed to ensure corrupted data can be clean up if the data migration process dones't go well. Test: NetworkStatsCollectionTest Bug: 197717846 Change-Id: Ic76ad6f3e96f03791b48988fb2622c9c647ffc7c (cherry picked from commit 306a00316cac03a0c61f995316c9c5682bec2a19) Merged-In: Ic76ad6f3e96f03791b48988fb2622c9c647ffc7c
* Merge "Test Ikev2VpnProfile provisioned with IkeTunnelConnectionParams" am: ↵Chiachang Wang2022-04-251-4/+4
|\ | | | | | | | | | | | | | | | | | | 2e670756ac am: 9942af20c0 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2063922 Change-Id: I966e6dac28759075313774966039097ff033d686 Ignore-AOSP-First: this is an automerge Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * Merge "Test Ikev2VpnProfile provisioned with IkeTunnelConnectionParams"Chiachang Wang2022-04-251-4/+4
| |\
| | * Test Ikev2VpnProfile provisioned with IkeTunnelConnectionParamschiachangwang2022-04-211-4/+4
| | | | | | | | | | | | | | | | | | Bug: 223841137 Test: atest CtsNetTestCases FrameworksNetTests Change-Id: I683f6242e4ed4a469893e3a17fe7b479a7a768e5
* | | Merge "Fix NullPointerException happens in dumpCheckin" am: 6b7e457988 am: ↵Aaron Huang2022-04-201-0/+66
|\| | | | | | | | | | | | | | | | | | | | | | | | | | 44a02af11a am: a4d60dd2ad Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2059628 Change-Id: If9933b6aad05abf79e85f9172ba6eb6f8492d648 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * | Fix NullPointerException happens in dumpCheckinAaron Huang2022-04-191-0/+66
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently dumpCheckin passes a null object to create the contructor of NetworkStatsCollection.Key but the constructor requires non-null object. Thus, it caused the NPE in dumpCheckin. To fix this exception, create an NetworkIdentitySet() object instead of using an null object. Bug: 225131008 Bug: 226539404 Test: dumpsys netstats --checkin is fine FrameworksNetTests Change-Id: I7f2dadf0647b3f42e0f667d96291d2ae37e23faf
* | Merge "Update test for new IkeTunnelConnectionParams field" am: 5850372963 ↵Chiachang Wang2022-04-071-0/+31
|\| | | | | | | | | | | | | | | | | am: 73242c8a0e Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1976972 Change-Id: I25cd0a8614b8b1c400026f655b34b67fd5116e3e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| * Update test for new IkeTunnelConnectionParams fieldChiachang Wang2022-03-311-0/+31
| | | | | | | | | | | | Bug: 184750836 Test: atest FrameworksNetTests Change-Id: Iab55eba74b94f295a358c6e8474ebf9230c9b019
* | Merge changes from topic "nullable-ipconfig" am: 1b13af010a am: 3a74a64079Patrick Rohr2022-03-171-3/+16
|\| | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2026565 Change-Id: Idd172582e5d1f0d401b999b7eb8f1a5e5311ee5d
| * Add test for nullable IpConfigurationPatrick Rohr2022-03-161-0/+13
| | | | | | | | | | Test: atest EthernetNetworkUpdateRequestTest Change-Id: Ibf565d46cfac0d44976ee6187db7234bb082da41
| * Replace assertParcelSane with assertParcelingIsLosslessPatrick Rohr2022-03-161-3/+3
| | | | | | | | | | | | | | Per review comment on aosp/2012897. Test: atest EthernetNetworkUpdateRequestTest Change-Id: Ie2f21d821709cc82af9294d70826f153506fda4f
* | Merge "Add test for EthernetNetworkUpdateRequest" am: 6758a5dfff am: 396091b4b1Patrick Rohr2022-03-091-0/+54
|\| | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2012897 Change-Id: I3caea7ea56c7b020c3a13ecfe5e8978960b37a88
| * Add test for EthernetNetworkUpdateRequestPatrick Rohr2022-03-081-0/+54
| | | | | | | | | | Test: atest EthernetNetworkUpdateRequest Change-Id: I2aeacca81f07cf2d73814d20fc9e63e9f1a65843
| * [SUBID01-1]Grow NetworkIdentity to include a new mSubId fieldlifr2022-03-013-11/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the previous design of NSS and NPMS, those only had IMSI to identify the cell network. Now the telephony has created the "subId" handle, which is the preferred mechanism for identifying subscribers. This commit adds NetworkStats support for subscriberId as a part of the network identity key Bug: 80526261 Test: atest NetworkTemplateTest NetworkStatsCollectionTest NetworkStatsServiceTest NetworkIdentityTest Ignore-AOSP-First: merge conflict resolutions (cherry-picked from ag/16826535) Change-Id: I8549b11d0fcfc5a9426724d6b90de27b707cb77c Merged-In: I8549b11d0fcfc5a9426724d6b90de27b707cb77c
* | Merge "Refer to SDK constant defined in DevSdkIgnoreRule" am: 5be94579d4 am: ↵Treehugger Robot2022-02-111-2/+4
|\| | | | | | | | | | | | | | | 6973f87392 Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1981649 Change-Id: Ia75e4ba89e54d72e24a4ce1f416ccfc2f3521d13
| * Refer to SDK constant defined in DevSdkIgnoreRuleChiachang Wang2022-02-111-2/+4
| | | | | | | | | | | | | | | | | | | | Refer to the same constant definition as other tests instead of hard coding locally, so that it won't be missed as changing to Build.VERSION_CODES.SC_V2. Bug: 184750836 Test: atest FrameworksNetTests Change-Id: I3c17c414d830af03e2719c5dab1a664c55f6df2a
* | Merge "[SUBID01-1]Grow NetworkIdentity to include a new mSubId field"Frank Li2022-02-113-11/+45
|\ \
| * | [SUBID01-1]Grow NetworkIdentity to include a new mSubId fieldlifr2022-02-103-11/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the previous design of NSS and NPMS, those only had IMSI to identify the cell network. Now the telephony has created the "subId" handle, which is the preferred mechanism for identifying subscribers. This commit adds NetworkStats support for subscriberId as a part of the network identity key Bug: 80526261 Test: atest NetworkTemplateTest NetworkStatsCollectionTest NetworkStatsServiceTest NetworkIdentityTest Ignore-AOSP-First: merge conflict resolutions Change-Id: I8549b11d0fcfc5a9426724d6b90de27b707cb77c
* | | Merge "Change naming of excludeLocalRoutes" am: 84ad04f768 am: c1ae7a1047Chiachang Wang2022-02-101-2/+2
|\ \ \ | | |/ | |/| | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1976348 Change-Id: If7d654a347b562859389a171c1d36b82580f2038
| * | Change naming of excludeLocalRoutesChiachang Wang2022-02-091-2/+2
| |/ | | | | | | | | | | | | | | | | Address API review feedback to change naming of setExcludedLocalRoutesVpn and getter. Bug: 217742354 Test: atest FrameworksNetTests Change-Id: I57bbf55c7aba1c86ec8687d2431a50b37e63c6d0
* | Merge changes Ie000244a,I3a55bc74Aaron Huang2022-02-091-143/+0
|\ \ | | | | | | | | | | | | | | | * changes: Add test for NetworkTemplate.Builder#setRoaming(int) Add NetworkTemplateTest to common test for cts coverage
| * | Add NetworkTemplateTest to common test for cts coverageAaron Huang2022-02-091-143/+0
| |/ | | | | | | | | | | | | | | | | Test for NetworkTemplate.Builder Ignore-AOSP-First: Required API is not in downstream yet Bug: 215435701 Test: CtsNetTestCases Change-Id: I3a55bc74388fa34a142abec308b67b185641c460
* / [MS83] Add Cts for NetworkStatsCollection/History buildersjunyulai2022-02-092-84/+0
|/ | | | | | | | | Test: 1. atest CtsNetTestCases:android.net.netstats.NetworkStatsHistoryTest 2. atest CtsNetTestCases:android.net.netstats.NetworkStatsCollectionTest 3. atest FrameworksNetTests Ignore-AOSP-First: Required API is not in downstream yet Bug: 218441356 Change-Id: If3d45325623cad987aab35f89c55f84042271adf
* Add APIs for discover/resolve on specific networksRemi NGUYEN VAN2022-02-031-0/+3
| | | | | | | | | | | 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
* Merge "[MS59.2] Add unit test for NetworkStatsDataMigrationUtils"Junyu Lai2022-01-271-0/+112
|\
| * [MS59.2] Add unit test for NetworkStatsDataMigrationUtilsjunyulai2022-01-261-0/+112
| | | | | | | | | | | | Test: atest NetworkStatsDataMigrationUtilsTest Bug: 204830222 Change-Id: Ia6e8aec9a828072a2a1e63bec600c2e20d3699b3
* | Change NETWORK_TYPE_5G_NSA reference packageAaron Huang2022-01-262-3/+4
| | | | | | | | | | | | | | | | NETWORK_TYPE_5G_NSA is moved to NetworkStatsManager Bug: 210073043 Test: builds, FrameworksNetTests Change-Id: I9226119ee4f67688a1b4ffdab7e5a86ec0b8e974
* | [MS78.2] Fix NetworkIdentity#Builder crashing on 5G NSA networksJunyu Lai2022-01-261-3/+4
|/ | | | | | Test: atest NetworkIdentityTest Fix: 216193400 Change-Id: I00abc97a98dfdf17d5f0c2e6b45d28be9899c5c3
* [DU09-1]Adding the NetworkStatsCollection BuilderFrank2022-01-251-0/+57
| | | | | | | | | The purpose is provide NetworkStatsCollection.Builder as public API for adding the stats {@link NetworkStatsHistory} Bug: 215862801 Test: atest NetworkStatsCollectionTest Change-Id: Id83c6fa67880ba361b8e0e15c4d86b90e44ac879
* [MS56.2] Add unit test for NetworkStatsHistory#BuilderJunyu Lai2022-01-231-0/+35
| | | | | | Test: atest NetworkStatsHistoryTest#testBuilder Bug: 204830222 Change-Id: Id876340bcab7290d5e191dbdfcce7fb4d8ecf96c
* [MS65.4] Address comments at aosp/1954383Junyu Lai2022-01-231-1/+93
| | | | | | Test: atest NetworkIdentityTest#testBuilder Bug: 204830222 Change-Id: I3d0f8175ee782c76839cbbdb5eb8a1219a61d874
* wifi data usage: Update calling API nameLes Lee2022-01-231-1/+1
| | | | | | | | | | Bug: 213387087 Test: atest -c NetworkTemplateTest Test: atest -c NetworkStatsServiceTest Test: atest -c FrameworksWifiApiTests Test: atest -c NetworkPolicyManagerServiceTest Change-Id: I6f65af5e2ff121a2fe5b2429d3eead01e434f8be Merged-In: I6f65af5e2ff121a2fe5b2429d3eead01e434f8be
* Merge "[MS65.2] Add unit test of NetworkIdentity#Builder"Junyu Lai2022-01-211-4/+32
|\
| * [MS65.2] Add unit test of NetworkIdentity#BuilderJunyu Lai2022-01-201-4/+32
| | | | | | | | | | | | Test: atest NetworkIdentityTest#testBuilder Bug: 204830222 Change-Id: Ie0d56821608c881c3bffe224cfe240fa900c6f39
* | Merge "Update the SDK for the tests with intended target in T+"Chiachang Wang2022-01-213-6/+8
|\ \ | |/ |/|
| * Update the SDK for the tests with intended target in T+Chiachang Wang2022-01-203-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct the SDK for those tests are expected running in T+ device. Check @IgnoreUpTo(S) may be incorrect after receiving patches before T release. Refer to temporary constant definition in DevSdkIgnoreRule until the SDK constant being pushed into AOSP and synced with branch used for mainline. BUg: 215294242 Test: atest CtsNetTestCases CtsNetTestCasesLatestSdk Change-Id: Ide6a241f7944dd1e75bc33b21aa29471a5df94c6
* | [MS57.2] Prepare APIs for data migration utilityJunyu Lai2022-01-202-5/+5
| | | | | | | | | | | | Test: atest NetworkStatsHistoryTest#testBuilder Bug: 204830222 Change-Id: I938c3ed50eea0f2349ea92c3824c637eaa77d328
* | [MS41.2] Add unit test for query history APIsJunyu Lai2022-01-201-0/+21
| | | | | | | | | | | | | | Test: atest NetworkStatsServiceTest NetworkStatsManagerTest Bug: 204830222 Bug: 200768422 Change-Id: I1dce7d671c5524496e0451665f62447ef6e454ae
* | Add unit test for NetworkStats iteratorAaron Huang2022-01-191-0/+26
| | | | | | | | | | | | Bug: 210073043 Test: this Change-Id: I2bcd80627c31e94ac040dbb4e7d38561d8f4c229
* | Add missing DevSdkIgnoreRule rule variableChiachang Wang2022-01-181-0/+4
|/ | | | | | | | | | | DevSdkIgnoreRule.IgnoreUpTo() will not work as expected without the rule defined. Bug: 184750836 Test: atest android.net.Ikev2VpnProfileTest#\ testBuildExcludeLocalRoutesSet works as expected with ignore rule Change-Id: I03a5b28963cd6feebe4358d57c070d941cd114e5
* Merge "Use getter methods to verify the fields of Entry"Aaron Huang2022-01-171-12/+12
|\