We are checking for network access in onResume(), which
wouldn't be called until the screen is on. So, there
shouldn't be a need for the extra sleep after turning
on the screen.
Also, remove redundant waits after the last try when
doing verifications as the test is anyway to going to
fail at this point.
Bug: 231440256
Test: atest tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java
Change-Id: I28429c929142a95c19b1f8a5b7d28b9c8c4a45b9
Merged-In: I28429c929142a95c19b1f8a5b7d28b9c8c4a45b9
Added SPDX-license-identifier-Apache-2.0 to:
tests/cts/hostside/app3/Android.bp
Bug: 68860345
Bug: 151177513
Bug: 151953481
Test: m all
Change-Id: I0f594c539640b9815040bf5082677592574b022d
Add CTS tests for LinkProperties#EXCLUDED_ROUTES gated change.
These tests check LinkProperties#getRoutes and
LinkProperties#getAllRoutes behavior depending on whether the gated
change is enabled.
Bug: 186082280
Test: atest HostsideLinkPropertiesGatingTests
Change-Id: Id353714331a19d09022d20f186c8f71343686da7
We already have tests that verify this but these new tests
launch the activity repeatedly a few times and verify the
network access as there are multiple race conditions
involving AMS, NPMS and the app that could result in an
inconsistent network rules state.
Bug: 226299593
Test: atest atest tests/cts/hostside/src/com/android/cts/net/HostsideConnOnActivityStartTest
Change-Id: I6372820fd2b21ebd759a3c44c7280c6699726bde
We wait for a few seconds before verifying the
test app didn't receive a broadcast because it
is possible the broadcast was just delayed but
we don't necessarily have to wait for too long.
Bug: 201580811
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: Ie5550742c506753fc994209d4db760c1ee73a2cb
Some services will write to the error stream if there is
an issue with handling the shell command but these error
messages are ignored currently as we are only looking at
output stream. So, update it to also consider messages
in the error stream and if the content in error stream
is not empty, then throw an exception.
Bug: 228117528
Test: atest com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: I935a74b4a689825de414226a2108f6a836b212ab
This test need other apks for running the test, but those dependencies
actually defined in suite level of cts but never defined in module level
actually which may lead to test failure due to lack of apks. This CL use
target_required attribute to define the missing test dependencies.
Bug: 227777774
Test: m clean ; atest -c HostsideRestrictBackgroundNetworkTests
Change-Id: I34476d3e261c1d2392405ceeb1459d2f135bbcaf
Previously, we were running only HostsideRestrictBackgroundNetworkTests
in presubmit. Updating it to run all the tests in this module.
Test: treehugger
Change-Id: I560fed71ab52457fe079d5340b5d294e16c68f93
It is possible there is a delay in app getting to
the background state and then initiating network
activity. We need the app to stay in the
temp allowlist until then.
Fixes: 227418169
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I6a98cc17a40cfb54bf3e12f51b5584159e69be0c
WearOs should not be treated as supporting Data Saver mode. Users
can not enable or disable the mode.
Data Saver is used on WearOs for battery improvements with LTE enabled
devices but should not block WiFi or Bluetooth PROXY networks.
Bug: 222086830
Test: run cts CtsHostsideNetworkTests
Change-Id: I8e76f7f9574c1ef2c1bd04ff0be652a74cd241f9
(cherry picked from commit cf709bbae312ad7cd0ffdf64af0a8ce23d8b1610)
Some TV's do not resume the previous activity coming back from sleep.
Add a case to restart activity.
Derived from
https://android-review.googlesource.com/c/platform/cts/+/1358002
(Bug: 148812676)
Test: Verified existing passing tests continue to pass on TCL Beyond TV
(Pie)
Change-Id: I86fe80c5326065ac349585d1ab95736132ddfb5a
Benjamin Cooleycommited 2022-02-18 16:44:37 +00:00
VpnTest#checkTrafficOnVpn tests whether IP address is on VPN by
sending udp packet, ping and tcp packet to the address.
In aosp/1941233 the order of checks was changed from udp, ping, tcp
to udp, tcp, ping, which caused flaky behavior of the method.
This CL restores the order of checks as it was prior to aosp/1941233.
Bug: 214558556
Bug: 215903863
Bug: 214398658
Test: atest HostsideVpnTests --iterations 50
Change-Id: I5dc3c217b78746d5e8c13b80e5295eb6ffe5b778
One of VpnTest#startVpn overloads didn't propagate "excludedRoutes"
param, due to mistake during conflict resolution in aosp/1941233.
Bug: 214398350
Test: atest HostsideVpnTests --iterations
Change-Id: Icbbe7394f1ff1f676cc671a1fa1c4449f4d585e3
In order to follow the new dynamic receiver paradigm introduced in T, receivers will have to be specifically marked as exported or not exported when registering dynamically. Since this is in a test only, and the test says that it needs the broadcast to be in a different process, mark as exported.
Bug: 161145287
Change-Id: I112d56962e3a6c3043240f8dfab058dc5a728ba9
Test: atest HostsideRestrictBackgroundNetworkTests#testAppIdle_toast
Jacob Hobbieauthored and Michael Groovercommited 2022-02-07 15:40:49 -08:00
Correct the SDK for those tests are expected running in T+
device. Check @IgnoreUpTo(S) may be incorrect after receiving
patches before T release.
Refer to temporary constant definition in DevSdkIgnoreRule until
the SDK constant being pushed into AOSP and synced with branch
used for mainline.
BUg: 215294242
Test: atest CtsNetTestCases CtsNetTestCasesLatestSdk
Change-Id: Ide6a241f7944dd1e75bc33b21aa29471a5df94c6
Add a test to check if onCapabilitiesChanged will be called when
the underlying networks are changed.
Bug: 191918368
Test: atest CtsHostsideNetworkTests:HostsideVpnTests
Change-Id: I8dfb16e01199d41b1b65f69e129ec40e37f9ab0f
Revert "Add APIs that allow to exclude routes from VPN"
Revert "Suppress NewApi warnings for @SystemApi -> public APIs"
Revert "Add VpnServiceBuilderShim for VpnService.Builder"
Revert submission 1551943-vpn-impl
Reason for revert: <DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=mainline_modules_x86_64-userdebug&lkgb=8007224&lkbb=8008168&fkbb=8007902 >, bug b/210979001
Reverted Changes:
I0e7aa077a:Add VpnServiceBuilderShim for VpnService.Builder
Ib12f5ab39:Suppress NewApi warnings for @SystemApi -> public ...
I59b9185cf:Unhide RouteInfo#getType and related fields
Ie5b62b2b2:Unhide IpPrefix(InetAddress, int)
I993a32d40:Add CTS tests for exclude VPN routes APIs
Ib24b2d3fb:Suppress NewApi warnings for @SystemApi -> public ...
Ic3b10464a:Add APIs that allow to exclude routes from VPN
Change-Id: Ic4f86f405c395f1356de1a6f8cf9e92692d953ce
BUG: 210979001
Add HostsideVpnTests test cases for different combinations of
included/excluded routes in VPN configuration.
Bug: 186082280
Test: atest HostsideVpnTests
Change-Id: I993a32d4066a851eb0c455aff2f599569e958ba7
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
This fixes the missing apk errors when running this module as
part of sts.
Ignore-AOSP-First: Platform changes related to this are not in AOSP yet.
Test: run sts-engbuild-no-spl-lock -m CtsHostsideNetworkTests
Bug: 195961795
Change-Id: I9a9a2d20ce637663790df42e22b0c8023cf7bc3e
We currently skip these tests because when a VPN comes up, all
TCP sockets for UIDs subject to the VPN are closed. This used to
break ADB over TCP, but that was fixed in r.android.com/1554977
by ensuring that netd never kills adb sockets.
Bug: 119382723
Bug: 161861298
Test: test-only change
Change-Id: I54b833a4d1fb51476a22cd7c793ec59b101023f1
Lorenzo Colitticommited 2021-08-17 15:48:04 +00:00
Bug: 177931370
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Ignore-AOSP-First: Platform changes related to this are not in AOSP yet.
Change-Id: I6d525c4d88ba01838d51a873251593281b628898
In China, "https://www.google.com" will redirect to url
"http://www.google.cn" but cleartext traffic is default disabled
for an app. So the testDownloadWithDownloadManagerDisallowed
would failed by cleartext traffic is not permitted. Thus, change
the url in the test which is reachable in China.
Bug: 192978910
Test: atest HostsideVpnTests#testDownloadWithDownloadManagerDisallowed
Original-Change: https://android-review.googlesource.com/1771008
Merged-In: I992c3240f0e133f5b00468cbe85d1545bcf786b0
Change-Id: I992c3240f0e133f5b00468cbe85d1545bcf786b0
In China, "https://www.google.com" will redirect to url
"http://www.google.cn" but cleartext traffic is default disabled
for an app. So the testDownloadWithDownloadManagerDisallowed
would failed by cleartext traffic is not permitted. Thus, change
the url in the test which is reachable in China.
Bug: 192978910
Test: atest HostsideVpnTests#testDownloadWithDownloadManagerDisallowed
Change-Id: I992c3240f0e133f5b00468cbe85d1545bcf786b0