android_packages_modules_Co.../tests/cts/net
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Aaron Huang a3debae1eb Move battery unplug command to the beginning of the test
The test failed because the test generated traffic
before the unplug command really done.

The unplug command will eventually have onBattery changed
to true. If the traffic is generated before onBattery changed
to true, then the cellular stats won't be updated. And then,
when BatteryStatsService schedules a sync task to update the
stats which will get no delta because the stats on cellular
has already added to mLastModemNetworkStats. Thus, the test
will finally get failed.

Currently, the battery unplug command is executed after connecting
to cellular network and making sure wifi is disconnected which may
trigger battery stats service schedules sync tasks. If there are
too many tasks need to run, then change onBattery to true would
be later. Thus, move the unplug command to the beginning of the
test and add "dumpsys batterystats --write" which will wait for the
worker to finish the task before continuing. Thus, it can make sure
the batterystats are synced.

Also, the stats will be reset when the devices are unplugging after
the battery was last full or the level is 100, or have gone through
a significant charge. So, enable no-auto-reset to avoid the stats
getting reset during the test.

Bug: 192808200
Test: atest CtsNetTestCases:BatteryStatsManagerTest
Change-Id: I08b38d9955c8cbb2d680e268c29368a4c0a7d144
2021-07-21 02:14:03 +08:00
..
api23Test Deflake test to ensure system default network as expected 2021-07-19 18:38:31 +08:00
appForApi23 [LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity 2021-02-16 04:09:58 -08:00
assets CtsWifiTests: Move wifi assets over to wifi test suite 2020-03-30 12:03:48 -07:00
jni Set the SDK version to 29 for networking native tests included in MTS 2021-05-24 19:33:48 +00:00
native remove obsolete/no-op NativeQtaguidTest 2021-07-06 22:15:44 +00:00
src/android/net Move battery unplug command to the beginning of the test 2021-07-21 02:14:03 +08:00
util Merge "Deflake test to ensure system default network as expected" 2021-07-20 01:20:07 +00:00
Android.bp Verify kernel implementation of AES-XCBC 2021-06-11 11:35:12 -07:00
AndroidManifest.xml Fix testKeepaliveWifiUnsupported failure 2021-04-22 21:35:34 +09:00
AndroidTestTemplate.xml Add com.google.android.resolv.apex and com.google.android.tethering.apex 2020-10-23 13:10:56 +08:00
jarjar-rules-shared.txt Add net-utils-framework-common to cts-net 2020-06-24 11:39:56 +00:00
OWNERS Set noparent in connectivity CTS owners 2020-12-03 08:07:32 +00:00