The interface IpSecServiceConfiguration is refactored to static
class Dependencies. Refine the tests to use Dependencies.
Bug: 204153604
Test: FrameworksNetTests
Change-Id: Ie2b79b1d948a19f64600ed9ea3b60b192dd92dfd
PermissionMonitor only saves netd network permissions by appId.
Then apply same permision to uids which are same appId. But
UIDS_ALLOWED_ON_RESTRICTED_NETWORKS can allow single uid has
restricted network permission. Thus, save the netd network
permissions by uid that can apply different permission to each
uid.
Bug: 192431153
Test: atest FrameworksNetTests
Change-Id: I942cbe0fa30758a7497c47a1b684ed70c4e3b09e
NetworkRequest is expecting transport type Ethernet or test. This
causes the test 'testApiCallbacks' to fail for devices that have a
non-test Ethernet network since that network is being chosen instead of
the expected test Ethernet network.
Remove network capability TRANSPORT_ETHERNET from CaptivePortalApiTest.
Bug: 204329523
Test: atest android.net.cts.CaptivePortalApiTest#testApiCallbacks
Signed-off-by: Davor Majdandzic <davor.majdandzic@aptiv.com>
Change-Id: Ie7b4d00c08f1497044e63462f1d899d1f3dea2df
The header file is referenced by the part going to be mainlined in Netd.
Note that some platform visibility is required with this commit, since
users of bpf_shared.h is currently located in platform. The visibility
can be removed when all users are moved out of platform.
Bug: 202086915
Test: m; flash; boot
Test: cd system/netd && atest
Test: cd packages/modules/Connectivity && atest
Test: atest FrameworksNetTests
Change-Id: I5c16511b6a2d4eb80dfd93157cbc98d5030bd5ac
Nothing uses StateMachine in service-connectivity, and
FrameworksNetTestsLib pulled a lot of unused dependencies with
services.core and services.net.
Remove unused dependencies. This helps measure code coverage more
accurately.
Bug: 207020032
Test: atest ConnectivityCoverageTests
Change-Id: I39857865594a3263c4b1deeda23312c8e4f86a77
Update the tests to use the newer NsdManager based on Binder interfaces
instead of AsyncChannel.
Bug: 190249673
Test: atest NsdManagerTest NsdServiceTest
Change-Id: I0991b598331e335a0bc211f010da7f034fb2441b
Apply NetworkStackNextEnableDefaults to CtsNetTestCases to disable it
in branches where NetworkStackNext and related targets should not be
built.
Test: presubmit
Change-Id: I850b4294aa4c3c01f8871760185ca7fedc0f8584
When NetworkInfo(null) or setDetailedState(null, any, any) are
called, S used to not crash but plant a null bomb for later
which may explode in some calls (notably, parceling) : see the
bug referenced below for details.
To help catching these errors earlier a patch was made to crash
as soon as one of these methods is called with a null argument,
but this will also crash incorrect use on existing code that
may never actually step on the mine, crashing code that used not
to crash. For safety, implement the new behavior only on T.
Bug: 145972387
Test: NetworkInfoTest
Change-Id: Ib710497d83b2d26439c2bd4d2f572310db97d6fd
Currently CS test uses a mock ProxyTracker object to verify that
the sendProxyBroadcast() is called. Also, if the network is a
default network then sendProxyBroadcast() will be indirectly
called in setDefaultProxy(). This only verifies that the method
is called but it doesn't verify that the broadcast is sent.
Instead of testing setDefaultProxy() is called, it is better to
verify that the broadcast is actually sent. Therefore, use a
real ProxyTracker in the test to verify the broadcast is sent.
Test: FrameworksNetTests:ConnectivityServiceTest
Change-Id: Id5c9e07e8326f24bd2665b4bb08f96d6d57d999c
1. There is a theoretical issue where the callback is not yet
registered when wifi is disabled, but there is no evidence
of it actually happening
2. 2 minutes timeout makes no sense for these tests that have a
total 1 minute timeout anyway
Bug: 196387278
Test: CtsNetTestCases
Change-Id: I120af9b312ca34431d0e62dd85233fcdaa1b09b9
Mark NetworkCapabilitiesTest as ConnectivityModuleTest so that it is
only run in MTS with the Connectivity module installed, and fix
parceling tests to use the right number of fields in that case.
NetworkCapabilitiesTest is only useful to test the Connectivity module,
and not other modules like NetworkStack, as it is a unit test of a class
in the Connectivity module.
Bug: 205901761
Test: atest NetworkCapabilitiesTest
Change-Id: I10ba0f866bc7a39b2c90bdde12a79feefea2d5ee
With the network selection rewrite in S, rematching a single request can
now easily be done; this can be used as an optimization in
handleRegisterNetworkRequests to avoid rematching all requests when
registering a new one.
This can be disabled by a flag that is unset by default,
REMATCH_ALL_REQUESTS_ON_REGISTER.
Test: atest ConnectivityServiceTest
Change-Id: If76f79b41ac88863974f7025624667134bea2570
Currently debugging IpSecManagerTest counter test failures is
difficult because the assertion message does not say how many
bytes/packets were expected.
Add this information to the assertion message.
Bug: 204860049
Test: test-only change
Change-Id: I4e12be9a58a688fcee3362dceb31d9f21e981d6c
Mockito's mocks are not thread-safe. The dependencies object
is used both on the test thread (to set it up) and in the CS
handler thread. This can't work with a mock.
Bug: 195626111
Test: ConnectivityServiceTest
Change-Id: Ia989dd71c3133513a90bc1d1957419fb1b74c300
TcpKeepaliveController is the only user of
KeepalivePacketDataUtil.fromStableParcelable. Because of
fromStableParcelable, networkstack-client needs to depend on
net-utils-framework-commonm, which pulls a lot of unnecessary classes.
This is particularly problematic considering that networkstack-client
may need to be redistributed as a prebuilt.
Move the method to TcpKeepaliveController, simplifying dependencies.
This also shows that fromStableParcelable could be removed altogether
(or moved to tests) if TcpKeepaliveController built a
TcpKeepalivePacketData class directly.
Test: atest ConnectivityCoverageTests
Change-Id: I554318f6bcd07c73d153598a0231e9fcaf912e90
The preparer does basic checks for device configuration before any test
is run, so that wrong device configuration can be identified at the
module level, rather than fail individual test cases.
If test devices are not properly configured with a wifi configuration
and data-enabled SIM cards, the run will fail before starting the test
module.
As the preparer uses much of CtsNetUtils code for connecting to wifi,
refactor that code out of CtsNetUtils.
Test: atest CtsNetCasesLatestSdk
Change-Id: I1214b6d6916e836bcd68d15c50486092c7fb9a6e
Replace SkipPresubmit with RequiresDevice on relevant tests, as
RequiresDevices is more standard and more specific.
This allows creating test configurations using virtual devices which are
not necessarily in presubmit.
Bug: 201014262
Test: TH needs to verify test mapping run with new annotation
Change-Id: I6758d2a41a9a987a5244e47e4795bc49889c4d61
NetworkTemplate.buildTemplateMobileWithRatType() supports
to build a template with metered filter, so a mobile network
is metered or non-metered should be tested.
This commit also rename buildMobile3gState to buildMobileState
because originally this method uses NetworkInfo to simulate the
network type. The NetworkInfo related codes were removed.
Currently, setMobileRatTypeAndWaitForIdle is used to simulate
the network type in test.
Ignore-AOSP-First: The parent of this change contains a CL will
conflict with internal tree so ignore AOSP first.
Bug: 183776809
Test: this
Change-Id: I8e54e2acb06db81fb0eaf330c4fd7cb391b01ff3
NetworkIdentity has adapted NET_CAPABILITY_TEMPORARILY_NOT_METERED
network capability so add a test case for it.
Ignore-AOSP-First: The parent of this change contains a CL will
conflict with internal tree so ignore AOSP first.
Bug: 183776809
Test: this
Change-Id: I2ca2a8b4db664b76a5a5ee82fcff451efd87c8ff
If VpnService set null as the underlying networks, then the
underlying networks will be set as system defeult network.
If VpnService set an empty array as the underlying networks, then
the underlying networks of VPN will not be set to any networks.
If VpnService set a network which is not null or an empty array,
then the underlying networks of VPN should be the same as this
one.
Bug: 191918368
Test: atest CtsHostsideNetworkTests:HostsideVpnTests
Change-Id: Ib2d54e53960e5f899cb8d4cfaa6705ca676354ca
This is to fix the error in errorprone target, the error message
is: [JUnit4ClassUsedInJUnit3] Assume cannot be used inside a
JUnit3 class. Convert your class to JUnit4 style.
The error method is: assumeTrue()
Bug: 191918368
Test: atest CtsHostsideNetworkTests:HostsideVpnTests
Change-Id: Ieb606d2ba31cc19510425114c76fd77417227f2c
Add a test for testing if [start|finish]Op will be called when
[start|stop]VpnProfile is called.
Also add a test to ensure that the startOp will not be called
again when seamless handover is happened.
Bug: 197135981
Test: atest FrameworksNetTests:VpnTest
Change-Id: I778ea4edf7c4a2d20b3b8e1877e7942feac5372a