Commit graph android_packages_modules_Co.../tests
Message SHA1
Check and skip certain operations if they are unsupported.
Fixes: 178334463
Test: com.android.cts.net.HostsideRestrictBackgroundNetworkTests#testMeteredNetworkAccess_expeditedJob
Change-Id: Ie68e17063454e7feeffc93b20b1b8fbb276e837f
Merged-In: Ie68e17063454e7feeffc93b20b1b8fbb276e837f

Sudheer Shanka   commited 2021-03-30 16:22:43 +00:00
b0f50c579b
Merge "Shorten the name for the dump file."
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-22 21:34:02 +00:00
a7542972b1
Try reconnecting to wifi if it doesn't automatically connect.
When meteredness of wifi changes during test, wifi disconnects.
Try reconnecting if it automatically connects after this.
Also, change the way we update metereness so that we can
use callback mechanism to wait for the state change instead of
polling for it regularly.

Bug: 181686645
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Merged-In: I31fb127ef333d39fe4697043876c7cef15d525e3
Change-Id: Icc0b37730201aebeab2713c6527a3195f6dcf97d

Sudheer Shanka   commited 2021-03-22 17:26:46 +00:00
8bb9eb1912
Shorten the name for the dump file.
The file name is getting truncated by tradefed and
we are missing the information to actually idenity
the test. So, instead shorten the filename to preserve
the test name.

Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Ignore-AOSP-First: Submitting internally first to avoid merge conflicts.
Merged-In: Ic0f87b97bb58e115fe81e2d688ce0e633397da42
Change-Id: I6ce3fc662782de82d8cad95414e24204b5f7f130

Sudheer Shanka   commited 2021-03-22 17:24:46 +00:00
8d92650da9
Mark most VpnServiceTest methods as @AppModeFull.
In S, instant apps can no longer access the system service that
backs the VPN APIs, so these tests started to fail in instant
mode.

Regardless of that change in S, though, instant apps cannot
create VPNs because they cannot access the package manager.

Previously, the tests were only passing because they did not
check that the VPN would actually work, they only checked that
the VPN API calls failed.

Fix: 181575083
Test: atest --instant CtsNetTestCases:VpnServiceTest
Change-Id: Idd35051bd1c908a8b85c02e8d0c54d3dea2dde38

Lorenzo Colitti   commited 2021-03-22 13:16:02 +00:00
60b26ee453
Merge "Revert^2 "Replace the usage of UidRange""
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-03-21 16:41:13 +00:00
bf0c19e52f
Move connectivity AIDLs to android.net
java_sdk_libraries and apexes need to contain bootclasspath classes
under predefined packages. Tethering currently uses android.net, so make
sure all the connectivity bootclasspath classes are under android.net.

This avoids maintaining two packages for the tethering APEX, where
com.android.connectivity.aidl is only used by internal AIDL files.

Bug: 182984842
Test: m
Change-Id: I23feb26c5de2fd7a4177797a3bc1d0dcbef4ade7
Merged-In: I23feb26c5de2fd7a4177797a3bc1d0dcbef4ade7

Remi NGUYEN VAN   authored and   Lorenzo Colitti   commited 2021-03-20 22:24:08 +09:00
cc305b2fa5
Revert^2 "Replace the usage of UidRange"
274c796731

The parameter of NetworkCapabilities.setUids() and
NetworkRequest.Builder.setUids() are updated to take a set of
integer Range instead of a set of UidRange because of refactor
work for the incoming connectivity mainline module.

The parameter change stops NetworkRequestTest to work in the
different API levels. Replace the usage with shims to work in
both current and stable APIs.

Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk

Change-Id: I7d18402f051051371f3054f6897b05b6da072105
Merged-In: I4bc0daf5ad9e4b4043f4a897ddab16aec8f8a536

Chiachang Wang   commited 2021-03-19 02:10:06 +00:00
2fb0846d70
Merge "Revert "Replace the usage of UidRange""
Anthony Stange   authored and   Gerrit Code Review   commited 2021-03-18 16:40:53 +00:00
83f77d83fd
Revert "Replace the usage of UidRange"
Revert "Replace the usage of UidRange"

Revert "Add shims for NetworkRequest"

Revert submission 1626206-replaceUidRange

Reason for revert: Breaking build - b/183106405
Reverted Changes:
I0b79c73e8:Add shims for NetworkRequest
I4bc0daf5a:Replace the usage of UidRange
I4e5aec6ef:Replace the usage of UidRange
I107c329d4:Expose uids related APIs in NetworkRequest and Net...

Change-Id: I5a4addc562d180487e2891fd2081c593126e6ffc

Anthony Stange   commited 2021-03-18 16:30:59 +00:00
274c796731
Merge "Replace the usage of UidRange"
Chiachang Wang   authored and   Gerrit Code Review   commited 2021-03-18 13:36:39 +00:00
1241156261
Merge "Fix a bug where any() returns null"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-18 09:59:21 +00:00
3a1932cd79
Merge "Remove networkAttributes resource usage"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-17 11:24:28 +00:00
584cfc6b67
Merge "Enable networking tests to be included in partial MTS files as well as full mts."
Kimberly Kreider   authored and   Gerrit Code Review   commited 2021-03-17 02:23:54 +00:00
6f4d35119f
Fix a bug where any() returns null
The type needs to be specified

Test: NetworkAgentTest
Change-Id: I7128ae520cb7175f1fb9467a94edfd1a4bdeb9da

Chalard Jean   commited 2021-03-16 21:49:29 +09:00
1705798d13
Remove networkAttributes resource usage
Supported network types are now deduced from system features, not the
networkAttributes resource.
Update the test to expect network types to be configured as per
resources before S, and to match system features on S+.

Bug: 146206136
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest
Change-Id: I715924d562f439f7239c1c95d2dc5bca7095a123

Remi NGUYEN VAN   commited 2021-03-16 16:54:17 +09:00
f1c04fb6b3
Merge "[NS01.cn] Adjust calls for NetworkScore"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-03-16 06:36:07 +00:00
bc786632cf
Fix NullPointerException when running testRequestBackgroundNetwork
aosp/1622675 made handler to be nonnull but
testRequestBackgroundNetwork still pass null as handler when
calling requestBackgroundNetwork, so there is a NullPointerException
when running testRequestBackgroundNetwork.

Bug: 175662146
Test: atest CtsNetTestCases:ConnectivityManagerTest#testRequestBackgroundNetwork
Change-Id: I871992549dfc8cc356221164f1dd49c64f0dae67

lucaslin   commited 2021-03-15 18:49:10 +08:00
bfaefe42d1
[NS01.cn] Adjust calls for NetworkScore
Test: NetworkAgentTest
Change-Id: I67b7adb867ec0fdb4ef17f00edd518836b69c8f3

Chalard Jean   commited 2021-03-15 09:50:03 +00:00
1fc092ac59
Replace the usage of UidRange
The parameter of NetworkCapabilities.setUids() and
NetworkRequest.Builder.setUids() are updated to take a set of
integer Range instead of a set of UidRange because of refactor
work for the incoming connectivity mainline module.

The parameter change stops NetworkRequestTest to work in the
different API levels. Replace the usage with shims to work in
both current and stable APIs.

Bug: 172183305
Test: atest FrameworksNetTests CtsNetTestCasesLatestSdk
Change-Id: I4bc0daf5ad9e4b4043f4a897ddab16aec8f8a536

Chiachang Wang   commited 2021-03-15 10:04:08 +08:00
c1f14634a4
Merge "Rename StringNetworkSpecifier to Ethernet"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-03-11 23:51:49 +00:00
ce2ab07074
Skipping printing AssumptionViolatedExceptions.
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

Sudheer Shanka   commited 2021-03-05 09:30:34 +00:00
c19cd34a35
Rename StringNetworkSpecifier to Ethernet
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

Remi NGUYEN VAN   commited 2021-03-03 18:28:38 +09:00
71de00d339
Make ConnectivityManagerTest use the API shims.
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

Lorenzo Colitti   commited 2021-03-01 15:59:40 +09:00
8060dfed23
Use NET_CAPABILITY_NOT_VCN_MANAGED from ConstantsShim.
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

Lorenzo Colitti   commited 2021-03-01 00:16:36 +09:00
589d0ad195
Merge "Fix CTS test failed on R device"
Junyu Lai   authored and   Gerrit Code Review   commited 2021-02-26 07:17:47 +00:00
75d28bee27
Merge "[VCN07.1] Add test for bypassing VCN for non-internet request"
Junyu Lai   authored and   Gerrit Code Review   commited 2021-02-25 10:16:03 +00:00
3f134a3805
Merge "Release test network in a test"
Chalard Jean   authored and   Gerrit Code Review   commited 2021-02-25 08:06:15 +00:00
26c11595bc
Fix CTS test failed on R device
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

junyulai   commited 2021-02-25 08:39:28 +08:00
d69d7c815c
Release test network in a test
This causes failures in subsequent tests that expect
only one test network to be up.

Bug: 181033598
Test: this
Change-Id: I74444f4aff7750a5bbd2564e5e22714d73c72d8b

Chalard Jean   commited 2021-02-24 23:07:13 +09:00
8a8bf7434c
Use unbundled version of BouncyCastle in Ike cts tests
Since BouncyCastle APIs provided by platform vary, use unbundled
BouncyCastle

Fixes: 180870458
Test: atest CtsNetTestCases
Change-Id: I78c053150bb9cf86173f869dd6e13e9a6917ffa7

Daulet Zhanguzin   commited 2021-02-24 13:09:36 +00:00
bb540131b7
Make the CTS tests explicitly depend on modules-utils-build.
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

Lorenzo Colitti   commited 2021-02-24 05:43:36 +00:00
2be434ab12
Enable networking tests to be included in partial MTS files as well as
full mts.

Test: built locally and verified contents.
Bug: 170318013
Change-Id: Idea798841c067002d7b1f47da73a34052a8ab32c

Kimberly Kreider   commited 2021-02-22 14:59:54 -08:00
6413dd84cf
Merge "Fix CTS test failed on R device"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-02-22 10:37:29 +00:00
afa18f0256
Merge "Add MUTABLE flag when creating PendingIntent"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-02-22 10:29:31 +00:00
f754671f07
Merge "Fix flaky test by extending timeout"
Treehugger Robot   authored and   Gerrit Code Review   commited 2021-02-22 07:58:10 +00:00
2108eada65
Add MUTABLE flag when creating PendingIntent
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

junyulai   commited 2021-02-22 15:06:32 +08:00
62f5117bfd
Fix CTS test failed on R device
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

junyulai   commited 2021-02-22 14:26:27 +08:00
e26bbf8032
Fix flaky test by extending timeout
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

junyulai   commited 2021-02-22 14:26:05 +08:00
607985b57f
[VCN07.1] Add test for bypassing VCN for non-internet request
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

junyulai   commited 2021-02-20 19:22:25 +08:00
651a95f126
Merge "[LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity"
Bob Badour   authored and   Gerrit Code Review   commited 2021-02-19 06:23:22 +00:00
f5b346ed1d
Merge "Add TEST_MAPPING to run CtsHostsideNetworkTests in presubmit."
Sudheer Shanka   authored and   Gerrit Code Review   commited 2021-02-19 00:33:15 +00:00
ddcfa071ab
Merge "Deflake CaptivePortalTest mobile data usage"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-02-18 13:11:25 +00:00
1a16358c36
Add TEST_MAPPING to run CtsHostsideNetworkTests in presubmit.
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

Sudheer Shanka   commited 2021-02-18 11:39:09 +00:00
be82d7d77a
Deflake CaptivePortalTest mobile data usage
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

Remi NGUYEN VAN   commited 2021-02-18 18:36:34 +09:00
6d190abfe2
Merge "Skip NetworkAgentTest via its runner on R-"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2021-02-18 01:30:58 +00:00
561c31906e
[LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity
Added SPDX-license-identifier-Apache-2.0 to:
  Tethering/Android.bp
  Tethering/apex/Android.bp
  Tethering/bpf_progs/Android.bp
  Tethering/common/TetheringLib/Android.bp
  Tethering/tests/Android.bp
  Tethering/tests/integration/Android.bp
  Tethering/tests/mts/Android.bp
  Tethering/tests/privileged/Android.bp
  Tethering/tests/unit/Android.bp
  tests/cts/hostside/Android.bp
  tests/cts/hostside/aidl/Android.bp
  tests/cts/hostside/app/Android.bp
  tests/cts/hostside/app2/Android.bp
  tests/cts/hostside/certs/Android.bp
  tests/cts/net/Android.bp
  tests/cts/net/api23Test/Android.bp
  tests/cts/net/appForApi23/Android.bp
  tests/cts/net/jni/Android.bp
  tests/cts/net/native/dns/Android.bp
  tests/cts/net/native/qtaguid/Android.bp
  tests/cts/net/util/Android.bp
  tests/cts/tethering/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I8534c580f0e2a17be146300b67b3604817b64507

Bob Badour   commited 2021-02-16 04:09:58 -08:00
97e6be27f6
Revert "[VCN07.1] Add test for bypassing VCN for non-internet re..."
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

Remi NGUYEN VAN   commited 2021-02-12 06:28:17 +00:00
075da46909
Revert "Address comments on aosp/1550755"
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

Remi NGUYEN VAN   commited 2021-02-12 06:27:44 +00:00
f77bed6d95
Merge changes I71a37663,Ib2010b38
* changes:
  Improve testing of registerSystemDefaultNetworkCallback.
  Remove buggy ConnectivityManagerTest#ensureWifiConnected.

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2021-02-12 02:45:02 +00:00
fd710547b2