The test failed since the API is not available on R device.
Add conditions to ignore it.
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideVpnTests
on R device
Bug: None
Change-Id: I05a1f63adec72e89382cb095db714bccbdff0058
We already run these tests when platform code affecting these tests
change. Now enabling these too to also run when these tests are being
changed.
Fixes: 154344933
Test: atest --test-mapping packages/modules/Connectivity/tests/cts/hostside
Change-Id: Ie3ea67670ccd028815936d30189146c25ba87e28
SubscriptionManager.setSubscriptionOverrideUnmetered() has been updated
to add NET_CAPABILITY_TEMPORARILY_NOT_METERED instead of
NET_CAPABILITY_NOT_METERED. So, we can't rely on that for changing the
meteredness.
Bug: 179664982
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideNetworkCallbackTests.java
Change-Id: I4163b2f9c6f80b4e639d9977ef7e2b444ab12e81
Merged-In: I4163b2f9c6f80b4e639d9977ef7e2b444ab12e81
On R and below, when an app that is not the active VPN app calls
getConnectionOwnerUid, a SecurityException is thrown. On S and
above, the method just returns INVALID_UID, which is what would
happen if the app was the active VPN app but was not authorized
to find that particular socket.
Accept both behaviours.
Bug: 173331190
Test: atest HostsideVpnTests#testGetConnectionOwnerUidSecurity passes on R and S
Change-Id: Ie6de2ef505b0d7bc253c55215a698aeaa210785c
This would allow us to run both metered and unmetered networkpolicy
related tests when the device is on a cellular network.
Bug: 165343126
Test: atest CtsHostsideNetworkTests:HostsideRestrictBackgroundNetworkTests
Test: atest CtsHostsideNetworkTests:HostsideNetworkCallbackTests
Change-Id: Id70856dffc920e74bda28583dba4dd851a832397
Merged-In: Id70856dffc920e74bda28583dba4dd851a832397
Also reorganize the files to have one toplevel CTS owners file, and only
additional owners in subdirectories.
Change-Id: I28ce193896e1ade2034589327805870774a4d608
Test: m
If DownloadManager doesn't have
CONNECTIVITY_USE_RESTRICTED_NETWORKS permission, it can't bind
socket to VPN when it is in VPN disallowed list but requested
downloading app is in VPN allowed list. Add a new CTS test to
verify that DownloadManager can do the download successfully via
VPN network.
Bug: 165774987
Test: atest HostsideVpnTests
Change-Id: Iba9e2f26ad325d0fdb34ab9a06faaaf9cb623166
Whitelisting the app resets forced idle state of an app, so
forcing idle state again.
Bug: 161477606
Test: atest ./hostsidetests/net/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: Ib57202a68071cc02d6071e0dc2c4780f026ad90b
This is a host-side tests that receives its network callbacks
through a custom AIDL that proxies them to this host-side
process. As this runs of the real callbacks from a real network,
this test receives unrelated callbacks – in particular calls to
onCapabilitiesUpdated to warn the process of updates of the
signal strength.
This skips these callbacks across the board by only matching
the expected callback. This will fix flakiness in the test.
Also, as a drive-by fix, this also checks the network in
the onBlockedStatusChanged callback. If the network object
is not the expected one, the test should not pass.
Bug: 160270536
Test: NetworkCallbackTests
Original-Change: https://android-review.googlesource.com/1318219
Merged-In: I67c685ebfb2c5e2ee6f7615196eedea8292ca3ff
Change-Id: I67c685ebfb2c5e2ee6f7615196eedea8292ca3ff
This is a host-side tests that receives its network callbacks
through a custom AIDL that proxies them to this host-side
process. As this runs of the real callbacks from a real network,
this test receives unrelated callbacks – in particular calls to
onCapabilitiesUpdated to warn the process of updates of the
signal strength.
This skips these callbacks across the board by only matching
the expected callback. This will fix flakiness in the test.
Also, as a drive-by fix, this also checks the network in
the onBlockedStatusChanged callback. If the network object
is not the expected one, the test should not pass.
Bug: 160270536
Test: NetworkCallbackTests
Change-Id: I67c685ebfb2c5e2ee6f7615196eedea8292ca3ff
This test (added in R) failed to take the adb-over-network
case into account like most other tests in the same file. As
such it erroneously fails when tested over such a test setup.
This patch exempts the shell from being subject to the VPN,
like other similar tests do, to avoid the adb connections
being killed.
Test: VpnTest
Bug: 159761399
Original-Change: https://android-review.googlesource.com/1349862
Merged-In: I0bc14d4d2cade7618c59b2cb88638bdf608d43d3
Change-Id: I0bc14d4d2cade7618c59b2cb88638bdf608d43d3
The .stubs library refer to the stub library of a java_sdk_library.
Since the name of the stub library is the implementation detail of the
build system, direct use of the name should be prohibited. Actually,
clients don't need to use the stub name directly because the build
system automatically redirects <name> to <name>.stubs.
Exempt-From-Owner-Approval: too many owners are involved. This is a
simple build script change.
Bug: 157007292
Test: m
Merged-In: I32502de3d87c5cfdbbcfe5545dd7db5e9bb551a7
(cherry picked from commit 89c4e06853f7ea4b5a62a3b02b4f5113617b2c60)
Change-Id: I32502de3d87c5cfdbbcfe5545dd7db5e9bb551a7
The .stubs library refer to the stub library of a java_sdk_library.
Since the name of the stub library is the implementation detail of the
build system, direct use of the name should be prohibited. Actually,
clients don't need to use the stub name directly because the build
system automatically redirects <name> to <name>.stubs.
Exempt-From-Owner-Approval: too many owners are involved. This is a
simple build script change.
Bug: 157007292
Test: m
Merged-In: I32502de3d87c5cfdbbcfe5545dd7db5e9bb551a7
(cherry picked from commit 4072d4d5d4)
Change-Id: I32502de3d87c5cfdbbcfe5545dd7db5e9bb551a7
This test (added in R) failed to take the adb-over-network
case into account like most other tests in the same file. As
such it erroneously fails when tested over such a test setup.
This patch exempts the shell from being subject to the VPN,
like other similar tests do, to avoid the adb connections
being killed.
Test: VpnTest
Bug: 159761399
Change-Id: I0bc14d4d2cade7618c59b2cb88638bdf608d43d3
Sometimes the device may take a long time to connect to the wifi,
try to enlarge the timeout to lower the fail rate of test.
Bug: 157391946
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Original-Change: https://android-review.googlesource.com/1324092
Merged-In: Ie89936ecc2d70ee22dd312067ccedd2523e81855
Change-Id: Ie89936ecc2d70ee22dd312067ccedd2523e81855
Sometimes the device may take a long time to connect to the wifi,
try to enlarge the timeout to lower the fail rate of test.
Bug: 157391946
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Change-Id: Ie89936ecc2d70ee22dd312067ccedd2523e81855
If the device is put into airplane mode before the network tests run,
the tests fail. This ensures that airplane mode is off before the tests
run.
Bug: 150788500
Test: atest CtsHostsideNetworkTests
Change-Id: I7a84be751e5e9efb534d48c6d8ff457875ebe716
In R, to avoid data overages due to apps not detecting a
meteredness change, when a wifi network changes from unmetered
to metered the network will go down and will be replaced with a
new network. It will make NetworkCallbackTest fail because the
original design is getting the active network in setUp(). So once
the wifi reconnects, the network which is got in setUp() will be
meaningless and make the test fail due to network mismatches.
The new changes are:
1. Moving some initial pre-configurations into setUp().
2. Override the onCapabilitiesChanged() to check if network has
changed to metered or not.
3. Add unregisterNetworkCallback() into iMyService.aidl so that
NetworkCallbackTest can call it to unregister the network
callback.
4. Enlarge the timeout of connecting network and receiving
callback to prevent network cannot reconnect in time or
callback cannot be received in a short time.
Bug: 153485744
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Change-Id: I1aa0e107cf6797b06dee4a15896c63321d822156
Merged-In: I1aa0e107cf6797b06dee4a15896c63321d822156
In R, to avoid data overages due to apps not detecting a
meteredness change, when a wifi network changes from unmetered
to metered the network will go down and will be replaced with a
new network. It will make NetworkCallbackTest fail because the
original design is getting the active network in setUp(). So once
the wifi reconnects, the network which is got in setUp() will be
meaningless and make the test fail due to network mismatches.
The new changes are:
1. Moving some initial pre-configurations into setUp().
2. Override the onCapabilitiesChanged() to check if network has
changed to metered or not.
3. Add unregisterNetworkCallback() into iMyService.aidl so that
NetworkCallbackTest can call it to unregister the network
callback.
4. Enlarge the timeout of connecting network and receiving
callback to prevent network cannot reconnect in time or
callback cannot be received in a short time.
Bug: 153485744
Test: atest CtsHostsideNetworkTests:com.android.cts.net.HostsideNetworkCallbackTests
Change-Id: I1aa0e107cf6797b06dee4a15896c63321d822156
This is a partial revert of the change that removed the parole
(Icd7b6eff8777f9b53a10eca521b73988f58f2d84).
Bug: 151802309
Test: atest --rerun-until-failure 10 com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: I65f5ff20cdd342905e1afd1f4897017aa60682d3
Fixed the error message when the expected number of broadcasts is exceeded.
Bug: 147139427
Test: atest hostsidetests/net/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I7e69dca81abdb29a9eb7d110266edbe483e17a01
Merged-In: I7e69dca81abdb29a9eb7d110266edbe483e17a01