Right now, if there are any failures along with
the cases where we skip the test, we end up printing
failure exception and all AssumptionViolatedExceptions
which makes it hard to find the actual failures.
Bug: 181686645
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: Ib3f1622fc259ad4966789cfafdc54203c2559471
Tests just need a specifier to verify general NetworkSpecifier
functionality. They can use EthernetNetworkSpecifier the same way they
use StringNetworkSpecifier.
To keep the tests passing on Q and R, add a CompatUtil class that will
keep creating StringNetworkSpecifiers (now removed) instead.
Bug: 179329291
Test: atest CtsNetTestCases
Merged-In: Ic6bf611ba36b555e4e0bb1bd3fa0053fe29dc8cf
Change-Id: I38fa9eed5915264a53cc70e8f170c003eefe04e2
This is required for the code to be identical in AOSP and
mainline-prod.
Bug: 167645754
Test: atest CtsNetTestCases passes on AOSP device
Test: atest CtsNetTestCasesLatestSdk passes on AOSP device
Test: atest CtsNetTestCasesLatestSdk passes on R device
Change-Id: I094906e535d710a46a3fa833b6aa48cb007d6b63
This is required to build in mainline-prod, which does not have
access to in-progress S APIs.
Bug: 167645754
Test: m NetworkStack CtsNetTestCasesLatestSdk CtsHostsideNetworkTests CtsHostsideNetworkTestsApp
Change-Id: If40ebfadbf6d3ee86a58a55711fbc146a8599fdb
Merged-In: If40ebfadbf6d3ee86a58a55711fbc146a8599fdb
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
This causes failures in subsequent tests that expect
only one test network to be up.
Bug: 181033598
Test: this
Change-Id: I74444f4aff7750a5bbd2564e5e22714d73c72d8b
In AOSP master and downstream branches, this likely works via a
transitive dependency. In mainline-prod, this doesn't work. Add
the dependency explicitly, since it makes things build everywhere
and in general it's also good practice to "include what you use".
Bug: 167645754
Test: m CtsNetTestCasesLatestSdk in mainline-prod has fewer errors
Change-Id: Ie575372415a806deee9996aab7f920d2c15bff80
By the new feature introduced in next Android release.
Any PendingIntent needs to be specified about the mutability.
While ConnectivityService would put extra info such as
network or request id before broadcasting the inner intent.
The MUTABLE flag needs to be added accordingly.
Test: this
Fix: 178121691
Change-Id: I87d0efaf51a91556ef9f8e18db38803e4861cfd7
The test failed since the API is not available on R device.
Add conditions to ignore it.
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.ConnectivityManagerTest
Bug: None
Change-Id: I3cbc623a84f7313e1155fe83a44ebef042a04076
The asserted capabilities change callback event took 170ms
in average to fire on cuttlefish, which causes 35% of
flakiness since the event might delay up to 500ms in practice.
Extend to 30s timeout value which is the standard value
of waiting for network callback events in CTS.
This change also ignore the test up to Android R since the API
is not available for R devices or below.
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testRequestBackgroundNetwork \
--rerun-until-failure 500
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.ConnectivityManagerTest
on R device
Bug: 179694867
Change-Id: Ic5e11d4a4f326150848bc48038fa01cde39f7661
This is a re-upload that combines aosp/1550755 and aosp/1579872.
Test: atest NetworkRequestTest#testBypassingVcnForNonInternetRequest
Test: atest CtsNetTestCasesLatestSdk on R device
Bug: 175662146
Change-Id: I2fdc2418339bef30c9f816d63418bba218abf4a1
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
The test did not verify that mobile networks were validated before
starting, which could cause them to validate during the test and pick up
the test URLs. Verify that mobile data is validated before the test.
Also shorten test URL expiration, so in case of hard-interrupt of the
test (without calling tearDown) it does not affect other tests for a
long time.
Bug: 178630586
Test: atest CtsNetTestCases
Change-Id: I03f346bcc231f869f50ca9c7e84bfac319bcc871
Revert "[VCN07] Bypass VCN for non-internet app accessible cellu..."
Revert submission 1579872-vcn07
Reason for revert: Possible culprit for b/179768816, broken ConnectivityControllerTest
Reverted Changes:
Id09b19c13:Address comments on aosp/1550755
I245bd69e0:[VCN07.1] Add test for bypassing VCN for non-inter...
I9936894b9:[VCN07] Bypass VCN for non-internet app accessible...
Change-Id: I7902a221c8597427e48d3e32fa5668b9c1a47420
Revert "[VCN07] Bypass VCN for non-internet app accessible cellu..."
Revert submission 1579872-vcn07
Reason for revert: Possible culprit for b/179768816, broken ConnectivityControllerTest
Reverted Changes:
Id09b19c13:Address comments on aosp/1550755
I245bd69e0:[VCN07.1] Add test for bypassing VCN for non-inter...
I9936894b9:[VCN07] Bypass VCN for non-internet app accessible...
Change-Id: I3fded28691e05a3dbf25bb7361c72acaa61b29c7
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
This method does not behave correctly when wifi is connected but
the last CONNECTIVITY_ACTION broadcast was not for wifi. This
could happen due to another network connecting or disconnecting,
such as VPN.
Bug: 179774433
Test: test-only change
Change-Id: Ib2010b3871133c38b6d508bf508134dd9b814ce2
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 CL bypass adding NOT_VCN_MANAGED on R device. And add TODOs
for refactoring and adding test coverage.
Test: atest CtsNetTestCasesLatestSdk:NetworkRequestTest on R device
Bug: 175662146
Change-Id: Id09b19c13f9a74e25d45689d2211418172dfaec8
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
Tests fail on R because the INetworkAgentRegistry member of
FakeConnectivityService cannot be found, which crashes before the
existing ignore rule is evaluated.
Use DevSdkIgnoreRunner to ignore the class before it is initialized.
Bug: 177290955
Test: atest CtsNetTestCasesLatestSdk:NetworkAgentTest on R
Change-Id: I403ba523763f2d9993ee4068a35c6269eafb577f
NetworkAgent is not updatable on R-, so there is no need to run tests
compiled against S on older platforms. They are also incompatible
because NetworkAgent stopped using AsyncChannel in S.
This only affects MTS, and CTS used to test S+ devices. CTS for R-
devices is already cut in a branch that this change will not merge to.
Bug: 177290955
Change-Id: I85c137a1b5fd7ef701fba4623566df5a8fb707a3
Test: atest CtsNetTestCasesLatestSdk