Commit Graph

2043 Commits

Author SHA1 Message Date
Mark Chien
cf750de87c Merge "Don't run testRequestLatestEntitlementResult if not supported" am: 1129c316fd am: 793308371d
Original change: https://android-review.googlesource.com/c/platform/cts/+/1352284

Change-Id: I46d2d005d1a26c45f36cb387faa079a09ce708e4
2020-07-13 02:30:59 +00:00
Treehugger Robot
0a5ad58f9c Merge "Add CtsNetTestCasesLatestSdk to mainline-presubmit" am: ce5d7c09ab am: 8d12e31a62
Original change: https://android-review.googlesource.com/c/platform/cts/+/1331100

Change-Id: I167e3cd462e8ab0798c28b6b76c085f1a464cebb
2020-07-13 02:30:38 +00:00
Mark Chien
1129c316fd Merge "Don't run testRequestLatestEntitlementResult if not supported" 2020-07-10 07:06:56 +00:00
Treehugger Robot
ce5d7c09ab Merge "Add CtsNetTestCasesLatestSdk to mainline-presubmit" 2020-07-10 00:36:44 +00:00
Treehugger Robot
68238567cd Merge "Increase a timeout that's too short" am: 6cc5d32e6f am: c2944b4510
Original change: https://android-review.googlesource.com/c/platform/cts/+/1358064

Change-Id: I8d079fc0a514d7ada44df54b986de50455a730d5
2020-07-09 15:35:53 +00:00
Chalard Jean
a4ad47a46b Merge "Ignore non-matching callbacks to fix flakiness" am: 2e2642f909 am: b02ea3ecdd
Original change: https://android-review.googlesource.com/c/platform/cts/+/1318219

Change-Id: Id29544f27c6ede9f08354d630933083d1d21ef03
2020-07-09 06:40:18 +00:00
Chalard Jean
b7f471ae33 Increase a timeout that's too short
This should have been longer to start with. This oversight is due
to a poor API in TestNetworkCallback that was made that way for
backwards compatibility ; b/157405399 tracks improving this API.

Test: this
Bug: 160660082
Change-Id: If0587a2a91977427a2f679a502d838fbecdd82f2
2020-07-09 15:32:48 +09:00
Chalard Jean
2e2642f909 Merge "Ignore non-matching callbacks to fix flakiness" 2020-07-09 06:12:45 +00:00
easoncylee
a1b13d6d39 Add CtsNetTestCasesLatestSdk to mainline-presubmit
This is the pilot run for mainline testing in Test Mapping Suite.

For supporting mainline testing in Test Mapping Suite, developers can
run tests by configuring the TEST_MAPPING file, the 3 simple steps are:
  - Add tests to be part of general-tests suite if the test does not
    depend on a device specific features.
  - Update test configureation for TradeFed to run mainline testing.
  - Update TEST_MAPPING file with test-group as "mainline-presubmit"

It's only for postsubmit now, and will be moved to actual presubmit
once the whole mechanism is stable.

For more details about the usage, please refer to go/test-mapping-mainline-user-guide

Bug: 160753366
Test: forrest.
Change-Id: I8704cc5626a3e049eb3c27adb86e9c1a4d828273
2020-07-08 15:13:27 +08:00
Treehugger Robot
7dde88274a Merge "Create NetworkAgent CTS for NET_CAP_TEMP_NOT_METERED" 2020-07-08 04:30:22 +00:00
Chalard Jean
f70d762a55 Ignore non-matching callbacks to fix flakiness
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
2020-07-08 13:07:24 +09:00
Chalard Jean
db4f75ebeb Merge "Let testB141603906 run over ADB-over-network" am: 3cded8dc20 am: eb4d8b4fab
Original change: https://android-review.googlesource.com/c/platform/cts/+/1349862

Change-Id: Ie54c911ca55be520d20b582a67bb2bf36259b91c
2020-07-01 13:57:56 +00:00
Chalard Jean
3cded8dc20 Merge "Let testB141603906 run over ADB-over-network" 2020-07-01 13:31:26 +00:00
Jiyong Park
188ebc6a7f Merge "Drop .stubs from android.test.[base|runner|mock].stubs" 2020-07-01 11:58:41 +00:00
Jiyong Park
616e299222 Drop .stubs from android.test.[base|runner|mock].stubs
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
2020-07-01 17:17:28 +09:00
Remi NGUYEN VAN
4c602c3388 Merge "Move Inet[4]AddressUtils to libs/net" 2020-07-01 04:08:25 +00:00
Remi NGUYEN VAN
ba6f3be791 Move Inet[4]AddressUtils to libs/net
The classes should not be picked up from frameworks/base, as they are
part of several mainline modules.

Bug: 151052811
Test: m; manual: flashed, wifi and telephony working
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalApiTest
(clean cherry-pick from internal branch)
Merged-In: Ic7534afe3a437f2089ed33cebdad391dc498d187

Change-Id: Ic7534afe3a437f2089ed33cebdad391dc498d187
2020-06-30 19:20:40 +09:00
markchien
b589520368 Don't run testRequestLatestEntitlementResult if not supported
If tethering is not supported, skip testRequestLatestEntitlementResult
which test TetheringManager#requestLatestTetheringEntitlementResult
API.

Bug: 159869957
Test: atest CtsTetheringTest
Change-Id: I65c32d5bc26f18f8c9d91593ab0c178e69e75c39
2020-06-30 17:04:58 +08:00
Jiyong Park
82bb526062 Drop .stubs from android.test.[base|runner|mock].stubs
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
2020-06-29 22:56:28 +09:00
Chalard Jean
5ed6690e66 Let testB141603906 run over ADB-over-network
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
2020-06-29 02:02:35 +00:00
Lorenzo Colitti
6fcf2ec7f1 Merge "Increase ConnDiagsTest timeout for end-to-end test." am: a86ff10ecf am: bcd58ba008
Original change: https://android-review.googlesource.com/c/platform/cts/+/1349068

Change-Id: I0e55bacc1e8bcad9844e0e60ac4eadf92b977cf9
2020-06-26 07:48:13 +00:00
Cody Kesting
c8d9a5706e Increase ConnDiagsTest timeout for end-to-end test.
This change increases the delay allowed for administratorUid updates to
reach ConnectivityService in #testRegisterCallbackWithCarrierPrivileges.
Currently, there is no deterministic signal that can be used to wait for
this change, so Thread#sleep is required. This value is increased
because the previous delay did not give enough time for the
administratorUid change to reach CS, causing test flake.

Bug: 159718782
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: I36347f6d52e3ce1bd30e3f74c35f4ecd15c8c65e
2020-06-26 07:13:45 +00:00
Cody Kesting
ee8feba3c1 Fix ConnDiags Test for invoke-after-validate and unregister CBs.
This change fixes several things in ConnectivityDiagnosticsManagerTest:
- testOnConnectivityReportAvailable creates the Test Network after
registering the ConnectivityDiagnosticsCallback. This ensures that the
callback is invoked only after the network is validated (not for the
on-register behavior).

- The TestNetworkInterface created while setting up the Test Network is
held onto for the duration of each test. This ensures that the interface
is not garbage collected during the test. While the interface is not
needed for the test, this change makes it clear when the interface is
cleaned up.

- All registered ConnectivityDiagnosticsCallbacks are unregistered at
the end of each test. This ensures that all accompanying NetworkRequests
are cleaned up. If NetworkRequests are leaked, unrelated test failures
can occur (the platform limits the number of NetworkRequests per UID).

Bug: 156294356
Bug: 148032944
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: I1836536fe60a65ba33170cd80e8f4996f1965d19
Merged-In: I1836536fe60a65ba33170cd80e8f4996f1965d19
2020-06-25 01:07:48 +00:00
Luke Huang
10fa0790d9 Merge "Add net-utils-framework-common to cts-net" 2020-06-24 18:41:18 +00:00
Luke Huang
1ef852ef06 Merge "Update DnsPacket package name" 2020-06-24 18:39:56 +00:00
Cody Kesting
5c2e383949 Only run ConnectivityDiagnosticsManagerTest as AppModeFull.
This CL restricts ConnectivityDiagnosticsManagerTest to only being run
as @AppModeFull. This is required, as Instant Apps are not allowed
CHANGE_NETWORK_STATE (required for CM#requestNetwork) or
MANAGE_TEST_NETWORKS (required for TestNetworkManager#setupTestNetwork)
permissions - both of which are required for
ConnectivityDiagnosticsManagerTest.

Bug: 158431112
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: Id867b8dcaca758cfeb83009848e1099e900a0790
Merged-In: Id867b8dcaca758cfeb83009848e1099e900a0790
2020-06-24 07:59:36 -07:00
Luke Huang
1eebfa3d87 Add net-utils-framework-common to cts-net
In order to avoid class package missing problem, add
net-utils-framework-common in cts net test build. Also jarjar
the package name to prevent conflict.

Test: build
Test: atest DnsResolverTest
Bug: 150952393
(clean cherry-pick from internal branch)
Merged-In: I40e2d4c4945a0579f6e1923e4722b09354ff050c
Change-Id: I40e2d4c4945a0579f6e1923e4722b09354ff050c
2020-06-24 11:39:56 +00:00
Luke Huang
d9daaff707 Update DnsPacket package name
The package name needs to be updated as
the class is moved into com.android.net.module.util.

Bug: 149403767
Test: atest DnsResolverTest
(clean cherry-pick from internal branch)
Merged-In: I908cb5f7bc6150e461748c8e34c92a19aa0206e4
Change-Id: I908cb5f7bc6150e461748c8e34c92a19aa0206e4
2020-06-24 19:38:10 +08:00
Remi NGUYEN VAN
4feab037a5 Skip flaky CTS tests for presubmit
Skip testRegisterCallbackWithCarrierPrivileges and
testContinuousQueriesInline for presubmit, as they are highly flaky.
These tests are still run in postsubmit as part of MTS. In order to put
the CTS suite in presubmit as early as possible, add the annotation so
they are skipped in TEST_MAPPING.

Bug: 158153057
Bug: 159718782
Bug: 159762682
Test: m
Change-Id: I4763db869fbc714767ea5ca3651e4a0b0c9e9378
2020-06-24 06:02:27 +00:00
Cody Kesting
ba9dd48cca Merge "Fix ConnDiags Test for invoke-after-validate and unregister CBs." into rvc-dev 2020-06-22 18:17:28 +00:00
Cody Kesting
efaf28e9f3 Merge "CTS test ConnectivityDiagnostics via CarrierPrivilegesTracker." into rvc-dev 2020-06-22 17:12:41 +00:00
Cody Kesting
cce29fc44d Fix ConnDiags Test for invoke-after-validate and unregister CBs.
This change fixes several things in ConnectivityDiagnosticsManagerTest:
- testOnConnectivityReportAvailable creates the Test Network after
registering the ConnectivityDiagnosticsCallback. This ensures that the
callback is invoked only after the network is validated (not for the
on-register behavior).

- The TestNetworkInterface created while setting up the Test Network is
held onto for the duration of each test. This ensures that the interface
is not garbage collected during the test. While the interface is not
needed for the test, this change makes it clear when the interface is
cleaned up.

- All registered ConnectivityDiagnosticsCallbacks are unregistered at
the end of each test. This ensures that all accompanying NetworkRequests
are cleaned up. If NetworkRequests are leaked, unrelated test failures
can occur (the platform limits the number of NetworkRequests per UID).

Bug: 156294356
Bug: 148032944
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: I1836536fe60a65ba33170cd80e8f4996f1965d19
2020-06-22 16:03:15 +00:00
Luke Huang
6261d27a9f Add net-utils-framework-common to cts-net
In order to avoid class package missing problem, add
net-utils-framework-common in cts net test build. Also jarjar
the package name to prevent conflict.

Test: build
Test: atest DnsResolverTest
Bug: 150952393
Change-Id: I40e2d4c4945a0579f6e1923e4722b09354ff050c
2020-06-22 15:08:27 +08:00
Cody Kesting
a9dda29874 CTS test ConnectivityDiagnostics via CarrierPrivilegesTracker.
This change adds a CTS test for ConnectivityDiagnostics using
CarrierPrivilegesTracker to receive permissions for
ConnectivityDiagnostics callbacks.

Specifically, the test provides CarrierPrivileges to the test package
(android.net.cts) for the active subscription via Carrier Configs
overrides. CarrierPrivilegesTracker listens to the Carrier Configs
change and matches the loaded certificate with the test package, then
includes the test package UID as an administrator for the Network in
ConnectivityService. Then, a ConnectivityDiagnosticsCallback is
registered and receives a ConnectivityReport on register for the active
subscription.

Bug: 148032944
Bug: 151332031
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: Iee8a428ada0b6e2127410267a13c3b688df83e6d
Merged-In: Iee8a428ada0b6e2127410267a13c3b688df83e6d
2020-06-22 04:44:17 +00:00
Lorenzo Colitti
c7f94d5052 Merge "CTS test ConnectivityDiagnostics via CarrierPrivilegesTracker." 2020-06-22 04:41:43 +00:00
Remi NGUYEN VAN
a530216c7d Merge "Move Inet[4]AddressUtils to libs/net" into rvc-dev 2020-06-19 00:49:29 +00:00
Lorenzo Colitti
7703986e4c Merge "Update DnsPacket package name" into rvc-dev 2020-06-18 10:14:47 +00:00
Cody Kesting
7c9d2128de Only run ConnectivityDiagnosticsManagerTest as AppModeFull.
This CL restricts ConnectivityDiagnosticsManagerTest to only being run
as @AppModeFull. This is required, as Instant Apps are not allowed
CHANGE_NETWORK_STATE (required for CM#requestNetwork) or
MANAGE_TEST_NETWORKS (required for TestNetworkManager#setupTestNetwork)
permissions - both of which are required for
ConnectivityDiagnosticsManagerTest.

Bug: 158431112
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: Id867b8dcaca758cfeb83009848e1099e900a0790
2020-06-18 13:38:00 +09:00
Luke Huang
8f3a1b5091 Update DnsPacket package name
The package name needs to be updated as
the class is moved into com.android.net.module.util.

Bug: 149403767
Test: atest DnsResolverTest
Change-Id: I908cb5f7bc6150e461748c8e34c92a19aa0206e4
2020-06-18 03:27:27 +00:00
Cody Kesting
7d1159a2d4 CTS test ConnectivityDiagnostics via CarrierPrivilegesTracker.
This change adds a CTS test for ConnectivityDiagnostics using
CarrierPrivilegesTracker to receive permissions for
ConnectivityDiagnostics callbacks.

Specifically, the test provides CarrierPrivileges to the test package
(android.net.cts) for the active subscription via Carrier Configs
overrides. CarrierPrivilegesTracker listens to the Carrier Configs
change and matches the loaded certificate with the test package, then
includes the test package UID as an administrator for the Network in
ConnectivityService. Then, a ConnectivityDiagnosticsCallback is
registered and receives a ConnectivityReport on register for the active
subscription.

Bug: 148032944
Bug: 151332031
Test: atest ConnectivityDiagnosticsManagerTest
Change-Id: Iee8a428ada0b6e2127410267a13c3b688df83e6d
2020-06-17 10:38:48 -07:00
TreeHugger Robot
8badddb04d Merge "Verify owner of IKEv2 VPNs" into rvc-dev 2020-06-17 15:26:22 +00:00
TreeHugger Robot
3cc6da3e61 Merge "Toggle wifi when running CaptivePortalTest" into rvc-dev 2020-06-16 09:09:17 +00:00
Treehugger Robot
ec38685a7f Toggle wifi when running CaptivePortalTest
Instead of reconnecting without disabling/re-enabling wifi in
CaptivePortalTest, actually do the toggle during the test and
on teardown to ensure that the BSSID blacklist is cleared.

CaptivePortalTest intentionally makes the network not validate, which
causes it to be added to the BSSID blacklist. Toggling wifi is necessary
to make sure the test does not affect other tests.

Also check development SDK instead of the exact SDK_INT number so that
the test can pass on current AOSP builds.

Bug: 158924461
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalTest \
          CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Original-Change: https://android-review.googlesource.com/1336114
Merged-In: I31f9f4a9678e11042005c29535af840246358764
Change-Id: I31f9f4a9678e11042005c29535af840246358764
2020-06-16 16:53:25 +09:00
Benedict Wong
21bf8ba8e7 Verify owner of IKEv2 VPNs
This change adds assertions to ensure that the owner UIDs of IKEv2 VPNs
are correctly set.

Bug: 150135470
Test: This
Merged-In: Iabf2859c289aa86ec38aea1edcc1fb248b9d0d26
Change-Id: Iabf2859c289aa86ec38aea1edcc1fb248b9d0d26
(cherry picked from commit 30234827aa24716062a23f28b1effc59e9ef46de)
2020-06-16 01:43:34 +00:00
Treehugger Robot
1ae290c1a6 Merge "Toggle wifi when running CaptivePortalTest" 2020-06-16 00:43:07 +00:00
Benedict Wong
a330e50192 Merge "Verify owner of IKEv2 VPNs" 2020-06-15 17:09:46 +00:00
Yan Yan
91e4a69abe Merge "Fix tests that failed on devices without IPsec tunnel feature" into rvc-dev 2020-06-15 17:03:23 +00:00
Treehugger Robot
3abe36567c Fix CtsTetheringTest on devices without permanent softAp interfaces.
Normally stop wifi tethering flow would be:
Tethering#stopTethering -> WifiManager#stopSoftAp -> softAp disabled,
then have WIIF_AP_STATE_CHANGED intent -> stop IpServer and broadcast
TETHER_STATE_CHANGED intent. SoftAp is disabled before tethering stop.

Because tethering would shutdown the corresponding IpServer if it
observed the interface is removed. For those devices that softAp
interface would be removed when stop tethering, the flow may be
Tethering#stopTethering -> WifiManager#stopSoftAp -> softAp disabing,
softAp interface is removed -> tethering trigger stop IpServer and
broadcast TETHER_STATE_CHANGED intent -> -> softAp disabled, then wifi
broadcast WIIF_AP_STATE_CHANGED intent. In this case, tethering is
stopped ready before softap is disabled.
For this case, CtsTeteringTest would have race between two test cases.
If two case need to start wifi tethering for testing and stop wifi
tethering after finish testing.
The second test may suffer from startTethering fail problem due to
softAP is not disabled yet.
    E WifiService: Tethering is already active.

Bug: 157806780
Test: atest CtsTetheringTest

Original-Change: https://android-review.googlesource.com/1331096
Merged-In: I0ba6bc9dcbf7829dcad5561c707d5f5c5540f10b
Change-Id: I0ba6bc9dcbf7829dcad5561c707d5f5c5540f10b
2020-06-15 11:30:50 +00:00
Lorenzo Colitti
53430127ec Bump CtsNetTestCasesLatestSdk to target SDK 30.
This is not necessary for the tests to be able to use APIs
introduced in R because they can already access hidden APIs.
But it is important to ensure that they are subject to whatever
new system behaviour is applied to SDK 30 apps.

Fix: 158839774
Test: treehugger
Test: atest CtsNetTestCasesLatestSdk has no new failures
Change-Id: Ic86fe84b28b5becc722903650f00e9ca7d6e5f3f
2020-06-15 11:24:02 +00:00
Remi NGUYEN VAN
fa761d5917 Toggle wifi when running CaptivePortalTest
Instead of reconnecting without disabling/re-enabling wifi in
CaptivePortalTest, actually do the toggle during the test and
on teardown to ensure that the BSSID blacklist is cleared.

CaptivePortalTest intentionally makes the network not validate, which
causes it to be added to the BSSID blacklist. Toggling wifi is necessary
to make sure the test does not affect other tests.

Also check development SDK instead of the exact SDK_INT number so that
the test can pass on current AOSP builds.

Bug: 158924461
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalTest \
          CtsNetTestCasesLatestSdk:ConnectivityManagerTest
Change-Id: I31f9f4a9678e11042005c29535af840246358764
2020-06-15 19:38:01 +09:00