summaryrefslogtreecommitdiff
path: root/tests/common/java/android/net/netstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Disable NetworkStatsHistory builder test in tm-dev"Junyu Lai2022-06-151-3/+0
| | | | | | | | | | | | | | This CL reverts ag/18615112 and ag/18660036 by pointing the merged-in tag to an unrelated CL that only exists on aosp and its downstreams, to make this CL doesn't get merged in aosp downstreams. Ignore-AOSP-First: tm-dev only change. Bug: 234099453 Test: atest android.net.netstats.NetworkStatsHistoryTest Change-Id: Iefe38f7a671900f45475d1daf2f7d1f781aed540 Merged-In: I47fb59334d00ae7fee91c5694548b3cf89b09b2d Reason: Prebuilt is merged.
* Disable NetworkStatsHistory builder test in tm-devJunyu Lai2022-05-261-0/+3
| | | | | | | | | | | | | | The test cannot be run in tm-dev because tm-dev use prebuilt mainline module, which does not include the solution in previous patch yet. Hence, disable the test temporarily. Ignore-AOSP-First: Base change not in AOSP, will cherry-pick immediately after Test: atest android.net.netstats.NetworkStatsHistoryTest Bug: 233825704 Change-Id: I770a10bfd1b3b2068b2e116207bd6cdbecf9face Merged-In: Ib2fbd3c7703e9ed606650643db6e1977f550d90d
* Return sorted NetworkStatsHistoryJunyu Lai2022-05-261-11/+25
| | | | | | | | | | | | | | | | | | NetworkStatsHistory internally assumes that bucketStart is sorted at all times. However, in the fields, we've found there are some buckets of NetworkStatsHistory do not preserve the order of timestamp, which is caught by the IAE when addEntry is called. In order to provide backward compatibility, return sorted items instead of throwing IAE when adding entry into NetworkStatsHistory instance. Ignore-AOSP-First: Base change not in AOSP, will cherry-pick immediately after Test: atest android.net.netstats.NetworkStatsHistoryTest#testBuilder Bug: 233825704 Change-Id: If3187384bd1e90770ca5873b8ec73e852fff543d
* Merge changes from topic "stats-migration" into tm-devJunyu Lai2022-05-191-2/+13
|\ | | | | | | | | | | | | | | | | * changes: Skip PersistentIntTest on S- device Don't clobber existing history entries. Ensure NetworkStats migrated snapshot is identical [MS82.1] Support network stats data migration process Add a PersistentInt class.
| * Don't clobber existing history entries.Lorenzo Colitti2022-05-181-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Remove NetworkIdentitySet usage in CTSRemi NGUYEN VAN2022-05-161-3/+3
|/ | | | | | | | | | | | | NetworkIdentitySet is hidden API and may change on subsequent module updates. Use the module_lib NetworkStatsCollection.Key constructor that uses a set of NetworkIdentity instead. Bug: 217129444 Test: atest NetworkStatsCollectionTest Change-Id: Icd1160ae920059306c3319f7298707f1e14cbb48 (cherry picked from commit 7b0c61d0bd906d88677a7f3c4d8b3f7e8a0cd4bc) Merged-In: Icd1160ae920059306c3319f7298707f1e14cbb48
* Merge changes Ie000244a,I3a55bc74Aaron Huang2022-02-091-0/+205
|\ | | | | | | | | | | * changes: Add test for NetworkTemplate.Builder#setRoaming(int) Add NetworkTemplateTest to common test for cts coverage
| * Add test for NetworkTemplate.Builder#setRoaming(int)Aaron Huang2022-02-091-0/+14
| | | | | | | | | | | | | | Ignore-AOSP-First: Required API is not in downstream yet Bug: 215435701 Test: CtsNetTestCases Change-Id: Ie000244a954585241304adef95b4156e64d33f41
| * Add NetworkTemplateTest to common test for cts coverageAaron Huang2022-02-091-0/+191
| | | | | | | | | | | | | | | | | | 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-0/+134
|/ | | | | | | | | 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
* Do not verify field count in tests used in CTSRemi NGUYEN VAN2022-01-181-2/+0
| | | | | | | | | | | | | | | | | Tests in tests/common and tests/cts are run as part of CtsNetTestCases. Many used assertFieldCountEquals in parceling/unparceling tests to ensure that unexpected fields were not added, or that they were not missed when testing parceling/unparceling. However with many of the classes updatable through module updates, the field count may change in the future, breaking CTS tests. Stop checking for the field count, as it would break on module releases, and its value is lower than the maintenance cost. Bug: 205901761 Test: atest CtsNetTestCases Change-Id: I79854741f7e834574d4825bb737ef507785310fe
* Move net unit tests to packages/ConnectivityRemi NGUYEN VAN2021-05-131-0/+209
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