Recently, new test methods were added to NetworkAgentTest which
fail in instant mode because they are not marked @AppModeFull.
Because instant apps can't use NetworkAgent (it's a system API,
and it needs the NETWORK_FACTORY permission which is signature
only), just mark the whole test @AppModeFull so this cannot
happen again.
Bug: 283897713
Test: test is skipped in instant mode
(cherry picked from https://android-review.googlesource.com/q/commit:f1a61ad83de462dcd149ca53f0d417486ca1aec0)
Merged-In: Ib6ff07d9fdc329d3421a077532b8a434323053f8
Change-Id: Ib6ff07d9fdc329d3421a077532b8a434323053f8
Skip all of NetworkAgentTest in instant mode.
Recently, new test methods were added to NetworkAgentTest which
fail in instant mode because they are not marked @AppModeFull.
Because instant apps can't use NetworkAgent (it's a system API,
and it needs the NETWORK_FACTORY permission which is signature
only), just mark the whole test @AppModeFull so this cannot
happen again.
Fix: 283897713
Test: test is skipped in instant mode
Change-Id: Ib6ff07d9fdc329d3421a077532b8a434323053f8
Recently, new test methods were added to NetworkAgentTest which
fail in instant mode because they are not marked @AppModeFull.
Because instant apps can't use NetworkAgent (it's a system API,
and it needs the NETWORK_FACTORY permission which is signature
only), just mark the whole test @AppModeFull so this cannot
happen again.
Bug: 283897713
Test: test is skipped in instant mode
Change-Id: Ib6ff07d9fdc329d3421a077532b8a434323053f8
Observed failure in manual run on aosp/master cuttlefish:
[759/913] android.net.cts.NetworkStatsManagerTest#testUidTagStateDetails: FAILED (710ms)
STACKTRACE:
java.lang.AssertionError: QueryResult(tag=TAG_NONE state=STATE_FOREGROUND total=256756): 256756 not within 10% of 231272
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.assertTrue(Assert.java:42)
at android.net.cts.NetworkStatsManagerTest.assertWithinPercentage(NetworkStatsManagerTest.java:743)
at android.net.cts.NetworkStatsManagerTest.testUidTagStateDetails(NetworkStatsManagerTest.java:802)
256756 / 231272 =~= 1.11019 --> just over 11% deviation.
Test: TreeHugger
Bug: 283166618
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie9af706e4f84065050188b1c9b697cccd8509c32
The addOrUpdateInterfaceAddress() should be called when RTM_NEWADDR
message is received and the address isPreferred. The
deleteInterfaceAddress() should be called when RTM_DELADDR is called.
Bug: 282592527
Test: atest MdnsSocketProviderTest
Change-Id: I06a5940f53d01552f117309b1cc09256a2a9fae7
Check that advertised subtypes can be found by matching discoveries and
discoveries for the base type, and that discoveries for different
subtypes do not find the service.
Bug: 266167702
Test: atest
Change-Id: I0a8249cca22c1d30baad12bb4e8351a65ce87cb1
Instead of the network specified in the MdnsSearchOptions, which is
often null to request searching on all networks, use the
MdnsServiceTypeClient Network to build the queries.
When MdnsSearchOptions.network is null, one MdnsServiceTypeClient is
created for each mDNS-compatible Network. Each MdnsServiceTypeClient
schedules queries with a Network selector. If the Network selector is
null, each MdnsServiceTypeClient will post its queries to all networks.
Instead, it should be the Network of the MdnsServiceTypeClient.
There is one remaining problem when a tethered interface is up: in that
case, there will be one MdnsServiceTypeClient for tethered interfaces
with a null network, which will still broadcast its queries to all
networks. This should be addressed in a follow-up by having
MdnsMultinetworkSocketClient only send queries to interfaces that have a
null network, when the network selector is null (and not all
interfaces).
Bug: 283708537
Test: atest
Change-Id: If571d7a59c5e55d809eeb1f3d1c4b58684612cdd
Address review comment on aosp/2490881
ConnectivityServiceDependencies was made public in aosp/2490881 to
verify destroyLiveTcpSockets call.
This CL reverts that change and updates tests to use mocked
DestroySocketsWrapper to verify destroy sockets call.
Bug: 270298713
Test: atest FrameworksNetTests
Change-Id: I101016399ea29bc5176b7559edf0447f0f7901ce
Wifi remembers the wifi enabled state under airplane mode in the
Settings.Secure.WIFI_APM_STATE setting for the airplane mode
enhancement. Wifi will not be disconnected if user enables
the wifi under airplane mode. This behavior breaks the
assumption in testSetAirplaneMode. The test expects to always
receive the WiFi network disconnect after turning airplane
mode on.
The wifi enhancement was done with hidden method which should not
be referred in the cts. The intention of testSetAirplaneMode was
to verify the permission required for setting ariplane mode.
This change should be no harm for original intention.
Bug: 282436851
Test: atest CtsNetTestCases
(cherry picked from https://android-review.googlesource.com/q/commit:c346fc8a0d8330aa7cf033a8554233a90e683164)
Merged-In: I3458679378f0c12c26051f3dac7fcf155c1f469c
Change-Id: I3458679378f0c12c26051f3dac7fcf155c1f469c
In change ID: Ia2279bd1023296e3c949fa05bd74e921bf17da79,
ConnectivityServiceTest dependencies on VpnManagerService were removed,
adding a more limited dependency on LockdownVpnTracker instead. This
updates the "keep" rules for services.core-vpn to reflect that.
services.core-vpn is a subset of services.core that only includes the
classes in the "keep" rules, and their dependencies. This is because
ConnectivityServiceTests still depends on internal VPN classes, but
other usage of hidden API should not be added to the tests.
Using VpnManagerService causes problems for calculating coverage, as it
has indirect dependencies on many classes that end up included in the
test and show as uncovered in the dashboards including
NetworkPolicyManagerService.
The dependency on NPMS was found by looking at coverage reports and
unzipping services.core-vpn.jar. The fact that it is included due to
indirect dependencies from VpnManagerService was discovered by running a
dependency analysis tool (https://depfind.sourceforge.io/) on
services.core-vpn.jar in the out/ directory, with:
$ bin/DependencyExtractor services.core-vpn.jar > /tmp/graph.xml
$ bin/c2c /tmp/graph.xml -show-inbounds > /tmp/inbounds.txt
And running a script on the /tmp/inbounds.txt graph to find the path
from VpnManagerService to NPMS.
Bug: 259632671
Test: m
Change-Id: Idc6c9e6e998dbf968fd97582f904cb7aed56b5b5
Network state is not changed to disconnected when a networkagent
is disconnected and network state is SUSPENDED.
So the function requiresClat return true. Clat is not stoped.
Bug: 277682237
Test: atest FrameworksNetTests
(cherry picked from https://android-review.googlesource.com/q/commit:fd5d3d90e1da7411104902ddfe859ebd0e4a02fb)
Merged-In: I5edfcf64aca5d2d34325d722dd29fab41bcf2600
Change-Id: I5edfcf64aca5d2d34325d722dd29fab41bcf2600
Currently, clatd is not stopped when suspended network is disconnected
and aosp/2583410 fixes this issue.
This CL adds test for current behavior, aosp/2583410 can update
testDisconnectSuspendedNetworkStopClatd to call verifyClatdStop instead
of verifyNeverClatdStop
Test: atest FrameworksNetTests
Bug: 277682237
(cherry picked from https://android-review.googlesource.com/q/commit:4a5b06559fc276a06f53134694a0a6548b36b026)
Merged-In: I345e097ce8e114800d77c5f44d38d7ae4938935c
Change-Id: I345e097ce8e114800d77c5f44d38d7ae4938935c
In rare cases, ACTION_CARRIER_CONFIG_CHANGED arrives right around the 5s
mark at which the test times out.
Bug: 275217887
Test: TH
Change-Id: I737bd40f0cddf6cdea9a4c5afbb50e13aad74af2