Add unit tests to verify that bug has been fixed.
Re-enable testGetConnectionOwnerUid() unit tests in presubmit. These
were disabled due to test flakiness caused by expected failures passing
as a result of other sockets on the system. This is fixed by checking
that failures do not have the UID of the calling process instead of
INVALID_UID since previously some Qualcomm telephony sockets were
causing lookup successes.
Test: atest InetDiagSocketTest#testGetConnectionOwnerUid
Test: ls -1 /proc/<pid of system_server>/fd | wca
Test: atest --generate-new-metrics 200 InetDiagSocketTest#testGetConnectionOwnerUid
To verify flakes have been cleaned up.
Bug: 141603906
Bug: 141459241
Change-Id: Ib76674f10e4bd24952c557bac7b9c65fba42fdb2
The underlying issue here is that before aosp/986824 the call to
waitForIdle is the local ConnectivityServiceTest function, but
after that patch TestNetworkAgentWrapper has an identically
named member that only wait for its own handler.
Bug: 141341704
Test: ConnectivityServiceTest --generate-new-metrics 100
Change-Id: I38709cc69ec7a261c1c6e008abe03d2882e2083d
The current test we have for a package changing TrafficController
permissions (i.e., INTERNET or UPDATE_DEVICE_STATS permissions)
is not realistic.
This is because the test simulates the update by removing and
adding the package. But TrafficController permissions are not
driven by broadcasts, they are driven by PackageListObserver,
and when an app is updated, PackageListObserver does not see a
remove and and add, but a single change event.
Add a new test for this.
Bug: 137864893
Test: new unit test added
Change-Id: I691b928f57c79c19dfb6ddb01983d55ef305c472
Since these were combined into libhidlbase.
Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: I136e4d4459bb8c3c5abf3c0758dd5ae14d0ad2a2
This timing issue is happened when test case already verified
NetworkMonitor#setAcceptPartialConnectivity() before
NetworkAgent send the CONNECTED state to ConnectivityService.
This test case expects that the
NetworkMonitor#setAcceptPartialConnectivity() will be invoked
when network state is CONNECTED in
ConnectivityService#updateNetworkInfo().
NetworkAgent communicates with ConnectivityService by
AsyncChannel. Before they connect to each other, the thread of
NetworkAgent is keeping idle, so waitForIdle cannot handle this
kind of case. Although they have connected to each other, but
they don't communicate with each other, waitForIdle() still
cannot handle this case. It means waitForIdle() can only handle
the case that NetworkAgent already connected to
ConnectivityService and NetworkAgent is communicating with
ConnectivityService. So, that's why waitForIdle() sometimes
doesn't work in this case, and the most simplest and right way
to fix this case is to wait the available callback then verify
the method.
Bug: 140306320
Test: atest FrameworksNetTests: \
ConnectivityServiceTest#testPartialConnectivity \
--generate-new-metrics 500
Change-Id: I64bfecbfe3c5776bd5c347a821f9127e79539c48
Add a simple test to verify that IDs loop correctly, that they skip used
IDs correctly, and throw when there is no remaining ID.
Test: atest com.android.server.NetIdManagerTest
Change-Id: I4c9518c725156d743286e062fd2eec1423a0459e
This test exercises the Connectivity <-> NetworkMonitor integration.
This CL only contains a simple test (network validates), but more
generally it sets up a test package that contains both services.jar
classes and NetworkStack classes, and runs NetworkStack components in
another process (using TestNetworkStackService).
ConnectivityServiceIntegrationTest runs in the test process and binds to
TestNetworkStackService to obtain TestNetworkStackConnector and to
NetworkStackInstrumentationService to obtain
NetworkStackInstrumentationConnector. That last connector allows the
test to mock NetworkMonitor HTTP Requests.
Test: atest FrameworksNetIntegrationTests
Change-Id: Ieca18e273609044cf6b1870d2f0dba33ca7b38d3
If EVENT_NETWORK_INFO_CHANGED was handled after waitForIdle()
method done, this test will be failed due to
INetd#setTcpRWmemorySize() was not executed yet. Instead of
waiting for idle state, it's better to use NetworkCallback to
ensure events completely on ConnectivityService.
Bug: 140206578
Test: atest ConnectivityServiceTest#testTcpBufferReset\
--generate-new-metrics 500
Change-Id: Iad77415db38038603881d9ebe0e37586b549a45c
When turning on/off SoftAp with high frequency, sometime calling
WifiManager#updateInterfaceIpState with IFACE_IP_MODE_TETHERED
is performed after handling WIFI_AP_STATE_DISABLED event in
WifiServiceImpl while SoftAp is being terminated. This leads to
the issue that SoftAp is unable to start as startSoftAp always
returns "false". This is because mIfaceIpModes in WifiServiceImpl
keeps the mode WifiManager.IFACE_IP_MODE_TETHERED and the CL below
rejects SoftAp start request.
e257c5c9e79e3675375ca20731cfb74df02b1064 @ frameworks/opt/net/wifi
(WifiServiceImpl: Reject startSoftAp when already tethering)
This CL updates the interface ip state upon receiving ap disable
event from Tethering class to set proper state to mIfaceIpModes.
Bug: 134806980
Test: Ran script to turn on/off soft ap frequently
Signed-off-by: Daichi Ueura <daichi.ueura@sony.com>
Change-Id: I2f89214414d93f1aa942fb8a21264a9baae3452a
In case tethering donwstream is setup but don't ask EntitlementManager
to run provisioning. Cellular upstream should not be allowed if
EntilementManager don't have any donwstream record.
Bug: 134649258
Test: -build, flash, boot
-manual test with carrier SIM
Change-Id: I609722c79f0a45a1c2164d39721ef5883e436feb
The utilities help using ConnectivityService in tests, and will be used
to write integration tests for ConnectivityService.
Test: atest FrameworksNetTests
Change-Id: Ie895ad05139cd5768d3d8a9bd5589d72571f47e6
Tethering may use wrong sub id for entitlement when data
subscription is changed from preferred data sub id to CBRS
sub id. Fix by using the active data sub id for tethering.
Bug: 134994718
Test: -build, flash, boot
-FrameworkNetTests
-manual test with carrier SIMs
Change-Id: Icb3f5eeb2319e50b2dc98369ad152988c934da57
Merged-In: Icb3f5eeb2319e50b2dc98369ad152988c934da57
TestableNetworkCallback will become a standard tool. This patch
and its companion in packages/modules/NetworkStack mostly move
it out of ConnectivityServiceTest, but also applies a few
cleanups like reordering arguments for standard order, renaming
...Like to ...That to match Mockito namings, and introduces
stonger static typing on some callbacks, which allows to remove
some unchecked casts.
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I808a95ac33ec0c81a8829cad36a6917524297574
FrameworksNetTests-jni-defaults lib should only contain jni
dependencies. Remove static_libs/libs from it and update
FrameworksNetTests/FrameworksNetSmokeTests libs as well.
Bug: NA
Test: atest FrameworksNetSmokeTests FrameworksNetTests
Change-Id: I705e949e4c00035c9734b6a240529d1c2216eb6b
ag/7905088 added the ability to pass in acceptUnvalidated without
passing in explicitlySelected. Add unit tests for that code.
While I'm at it, convert a couple of "== 1"s to toBool(), and
update the comments in NetworkAgent.
Bug: 130766237
Test: atest FrameworksNetTests
Change-Id: I6b550bd621e3596975f83464c7b4b8a14269120b
NetworkStatsFactory is owned by NetworkStatsService, and any
accesses to NSF data should go through NSS.
Test: atest FrameworksNetTests
Change-Id: Idbd0dbbaeb11313f63474e7ec0e01f974349fc89