This patch changes the way of mocking samples in the tests, and
enabling use bpf stats flag, testing through the code path
that is not running in the production code does not make any
sense.
This change also copied methods from NetworkStatsFactory
as we want to continue parsing the golden files to test the
464xlat adjustment which historically has been prone to errors.
And deleting tests that does not execrise NetworkStatsFactory
code or rely on monotonic accumulative readings from native
layer, which is not happening today.
Bug: 234315786
Test: atest FrameworksNetTests CtsNetTestCases \
ConnectivityCoverageTests
Change-Id: I5cab2b78651f1da628705c191e42857c8b59d826
Following CLs will switch previous codepath (JNI) and new codepath
(Java) for bpf map operations based on this flag.
Bug: 217624062
Test: atest BpfNetMapsTest
Change-Id: I74f10d5c97390993acea110f6528ef8980bb2aa4
Changing multiple instances where the assert order for an assert.equals
was (actual, expected) to the more widely (and suggested) ordering of
(expected, actual).
Bug: 235605892
Test: atest FrameworksNetTests
:com.android.server.ethernet.EthernetNetworkFactoryTest
Change-Id: I6e9459d34d6cc7f43a2bfe346d2c2ca9551d46da
Use new Builder API which was introduced in Android T.
Bug: 238843364
Test: FrameworksNetTests
dumpsys netstats --checkin and check the output
Change-Id: Ieb0a2ee04056a1cedb71274ea710ff5153e2d68c
Tag socket as uid AID_CLAT to avoid duplicated data usage counting by
bpf program.
Bug: 237369591
Test: ClatCoordinatorTest
Change-Id: Ic18521b63b3feadd53d77d7f4f0b44ab983e5fbf
Fix so callbacks are sent when changing the interface link state for an
ethernet interface from down -> up.
Bug: 235605892
Test: atest FrameworksNetTests
:com.android.server.ethernet.EthernetNetworkFactoryTest
Change-Id: If13254d4882aa2f0021f6443f31ef173b3867727
This is a no-op and test only change. Test the scenarios below:
- Registration service successful and failed.
- Discovery service failed.
- Resolution service failed.
- Getting an address failed.
Bug: 236788977
Test: atest FrameworksNetTests
Change-Id: I533d0be2abfa5c1832a060b4b2d4d1dd382c5b71
Use Builder API which was provided in Android T to
build a template.
Bug: 238843364
Test: build, FrameworksNetTests:NetworkStatsManagerTest
Change-Id: Ibf1ac16541d6f3ddaf9b241e2f47ae04acbedf93
unregisterNetworkOffer() does not execute synchronously, so it is
possible that NetworkOffer callbacks are received after the offer was
unregistered.
Test: atest EthernetManagerTest && atest EthernetNetworkFactoryTest
Bug: 171872016
Change-Id: I2c50b01176e4968c31f83148f1831b55f8b06908
This is a no-op and test only change. Some parameters use many
times, so add common parameters to reduce duplicated code.
Bug: 236788977
Test: atest FrameworksNetTests
Change-Id: I94370817ea87d1da5c30ea2ed467c1746edecba3
This commit is a preparation for replacing JNI codes that modify
UidOwnerMap by Java.
Bug: 217624062
Test: atest BpfNetMapsTest HostsideRestrictBackgroundNetworkTests
android.net.cts.ConnectivityManagerTest#testFirewallBlocking
Change-Id: Ie595cf1f77a3ed86addbcdaea1a1be972e0265b3
Use mock intent receiver to handle intent related events instead
of exposing the private methods even for testing only.
The visibility for onPackageAdded, onPackageRemoved and
onUserStarted were exposed for testing only in former commit.
The test coverage for intent receiver part may be missed.
The other intent related methods will be verified in the
follow up commits. This refactor will also help to not to
expose further private methods.
Bug: 230548427
Test: atest VpnManagerServiceTest
Change-Id: If2aa88d8d5c1643e8bd4937673aa792186047fd8
Verify reconnect using startVpnProfile with the same package with
always-on package should work without exception.
Bug: 235322391
Test: atest FrameworksNetTests
Change-Id: I9a780d970208032e2468e9c5b3334373627c6a20
Update the string according to the change in Vpn.java
Bug: 237345836
Test: atest FrameworksNetTests
Change-Id: I9bfe0a1fad29ba1435eeb8b8b2cffa9d385b1cb5
Add tests to verify that calling getProvisionedVpnProfileState works
normally from the same package but gets a security exception from a
differnet package.
Bug: 230548427
Test: atest FrameworksNetTests
Change-Id: I0132c42dce1b8269859fca8d0143304142162838
Address review comments from aosp/2131752 and aosp/2117045
sConfigurationMap must have a entry for UID_RULES_CONFIGURATION_KEY
because this bpf map is an array
Bug: 217624062
Test: atest BpfNetMapsTest
Change-Id: Ic52623e11c1f53e363416d57c0d8705d5510ef04
Decouple security exception check test from ConnectivityServiceTest
to VpnManagerServiceTest.
These security exception tests landed in ConnectivityServiceTest
because of no VpnManagerServiceTest. Move the tests to the
VpnManagerServiceTest where is better place to put the VPN related
tests to reduce the size of ConnectivityServiceTest.
Bug: 230548427
Test: atest FrameworksNetTests
Change-Id: I94b691c4d1f63bd5226e3296e6d0160dcb03107c