Commit Graph

8005 Commits

Author SHA1 Message Date
Mark Chien
220e7854bd Merge "Fix null DadProxy failure in R Tethering unit test" 2020-11-06 11:00:19 +00:00
markchien
290e7c452b Fix null DadProxy failure in R Tethering unit test
Tethering unit test would verify the interfaction between DadProxy and
IpServer. Since DadProxy only available in S+, the test would fail if it
build with R sdk.

Bug: 171936270
Test: atest TetheringTests in both R and S
Change-Id: Ia73d4aa59d01400d1ccfd3fdc1b721e269cae952
2020-11-05 15:28:56 +08:00
Luke Huang
fcabfc688d Fix minor bug and deflaky for DnsResolverTest
1. Add the missing countdown() in the test callback
2. Add ensureWifiConnected() to prevent no available network problem.
3. Increase the timeout for awaiting private DNS setting because
   current one might not be enough.

Bug: 168027339
Test atest

Change-Id: I91190d8644ff7a7dfaf4fa3f2d43c17f67dfac11
2020-11-04 16:03:10 +08:00
Baligh Uddin
ebff93159e Adjust visibility for tests
BUG: 167962976
Test: TH
Merged-In: Ic89c084604788b4d41cf854e5015c8ce7791c64d
Change-Id: I12e326167c6fb61a59a919cdd0198ac8f8c84772
2020-11-04 05:06:58 +00:00
Baligh Uddin
43e624246b Merge history of CTS
BUG: 167962976
Test: TH
Merged-In: Ic89c084604788b4d41cf854e5015c8ce7791c64d
Change-Id: I475d5fc915b1525f02fa70cb0694f21c3eb7d15f
2020-11-04 04:08:37 +00:00
Baligh Uddin
1711a1222c Revert "Add OWNERS block to prevent the tree from mooving during migration."
Migration of frameworks/base/packages/Tethering is complete, removing
the OWNERS block.
This reverts commit 1623eb61d5.
BUG: 167962976
Test: TH

Change-Id: Ic89c084604788b4d41cf854e5015c8ce7791c64d
2020-10-31 04:50:11 +00:00
Treehugger Robot
9670ecfaa3 Merge "Fix MultinetworkApiTest for instant mode" 2020-10-30 13:28:53 +00:00
Weilun Du
aa00145105 Fix MultinetworkApiTest for instant mode
add AppModeFull@ to MultinetworkApiTest since CHANGE_NETWORK_STATE
could not be granted in instant mode.

CHANGE_NETWORK_STATE is required to select networks that are up but
not in the foreground, for example, the mobile network after the linger
timer has expired.

Bug: 168809106
Test: atest MultinetworkApiTest
      atest MultinetworkApiTest --instant

Signed-off-by: Weilun Du <wdu@google.com>
Change-Id: I37ca1a0f58d1c2ab57f8cd4489c2cfb13b0f2d39
2020-10-30 10:22:06 +00:00
Chalard Jean
e3c9bb8545 Merge "Make sure agents start in the CONNECTING state" 2020-10-29 12:31:03 +00:00
Treehugger Robot
5ecf780e6e Merge "Don't run hotspot related tests if Soft AP is not supported" 2020-10-29 05:32:56 +00:00
Baligh Uddin
1623eb61d5 Add OWNERS block to prevent the tree from mooving during migration.
BUG: 167962976
TEST: None.
Change-Id: I49db5a11ee89645dac158ec3757180b2387e2d70
2020-10-29 03:24:01 +00:00
markchien
8705535e40 Don't run hotspot related tests if Soft AP is not supported
Also explicitly hold ACCESS_WIFI_STATE permission to avoid
no permission problem when using WifiManager#getScanResults
without shell identity.

Fix: 169219565
Test: "atest CtsTetheringTest" in cuttlefish and phyical device

Change-Id: I3d8fa7e8882bf96f61f3316a70efdf991addbcb2
2020-10-29 11:10:46 +08:00
Baligh Uddin
f814b9b1ce Add visibility rules for packages/modules/Connectivity/Tethering
BUG: 167962976
Test: TH
Change-Id: Id28881b35cf24fc9517fa11af6d8e539ab244fa6
2020-10-29 02:11:55 +00:00
Dan Shi
98716c5cdc Add all CTS tests to general-tests suite
Exempt-From-Owner-Approval: this change only adds the tests to
general-tests.zip, doesn't change any test behavior.

Bug: 171481522
Test: none
Change-Id: I1711237f00572d57f611dcd16ec9ad345a0b5b3b
2020-10-27 22:25:33 +00:00
Remi NGUYEN VAN
1cdfeec47d Merge "Move apache HTTP tests out of tests/net" 2020-10-27 06:39:25 +00:00
Remi NGUYEN VAN
438200afb9 Move apache HTTP tests out of tests/net
The apache HTTP library is part of the platform core APIs, which are
separate from the core networking APIs.

cts/tests/tests/net is planned to move to a separate git project to put
it closer to the associated connectivity module code.

Bug: 170371348
Test: m cts && cts-tradefed run cts -m CtsApacheHttpTestCases
Change-Id: I49972b21755235e280c75eec40db14f3db974ca1
2020-10-27 11:07:04 +09:00
Treehugger Robot
d75774dfe0 Merge "Add shared jarjar rule for tethering tests" 2020-10-26 11:43:59 +00:00
markchien
e3126480ba Add shared jarjar rule for tethering tests
Also jarjar com.android.net.module.util* to
com.android.networkstack.tethering.util*.

Bug: 171670016
Test: atest TetheringCoverageTests
Change-Id: I3bde9ad3c41adf36da99bd944303d88ce992201c
2020-10-26 18:20:25 +08:00
Treehugger Robot
7851370b12 Merge "Add com.google.android.resolv.apex and com.google.android.tethering.apex for CtsNetTestCasesLatestSdk." 2020-10-26 08:56:35 +00:00
Bill Yi
479e5b17ef Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I34e8bcf3c3f0a5db3522b6ff499ba1583577b250
2020-10-22 23:40:39 -07:00
easoncylee
48c4cf621d Add com.google.android.resolv.apex and com.google.android.tethering.apex
for CtsNetTestCasesLatestSdk.

Reference: https://android-review.googlesource.com/c/platform/cts/+/1331100/3/tests/tests/net/AndroidTestTemplate.xml#23

Bug: 160877913
Test: forrest.
Change-Id: If39c594a0fdc39a8a7272464fc59e2a1483f6d54
2020-10-23 13:10:56 +08:00
Remi NGUYEN VAN
0c70933916 Wait for connect before dropping permissions
WifiManager#connect is implemented with a oneway binder call, so it may
return before the permission check. The previous code could drop shell
permissions before the check is performed.

Use WifiManager.ActionListener to wait for the operation to end before
dropping permissions.

Also refactor current usages of various "run as shell" utilities to use
TestPermissionUtil.runAsShell, which is the "standard" utility used in
connectivity tests (both in CTS and in other tests).

Bug: 170371191
Test: atest CtsNetTestCasesLatestSdk:CaptivePortalTest
Change-Id: I0f47c455f2c1596a887abab7d35146d8557d736a
2020-10-22 15:37:50 +09:00
Xin Li
1b758aa811 Merge redfin/bramble support.
Bug: 171218636
Merged-In: I77cffc12306fafa5fdd79a426937f5ba232394a3
Change-Id: Ibd68bd742b6888c45994951a24cb133243ff3ac0
2020-10-19 10:08:12 -07:00
Mark Chien
d11a25eb56 Merge "Add the flag and default enable selectAllPrefixRange" am: 02fe8ac161
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1461742

Change-Id: I6055ea6ac737bb94bd9bc8c8642e86222f1e1d1a
2020-10-19 12:46:44 +00:00
markchien
4607c5535b Add the flag and default enable selectAllPrefixRange
Also add MtsTetheringTest which only run if tethering mainline
module is installed.

Bug: 166057846
Bug: 170265597
Test: atest TetheringTests
Change-Id: I434dda81eb5fab700d873a8ff3429b4222f0c7e6
2020-10-19 16:50:29 +08:00
Mark Chien
6bff7607d6 Merge "Migrate Tethering util functions to CtsTetheringUtils" am: cea075213c
Original change: https://android-review.googlesource.com/c/platform/cts/+/1460711

Change-Id: I4f8e1e0554c5c1b6cf6cdc306920cd93d32c7d68
2020-10-17 01:37:55 +00:00
Chalard Jean
845fa07bdc Make sure agents start in the CONNECTING state
Bug: 170904131
Test: this
Change-Id: I302b75c8e6606379c1887fa559b29bb4d29e0bdf
2020-10-17 01:03:44 +09:00
markchien
2888ab7bc7 Migrate Tethering util functions to CtsTetheringUtils
Bug: 166057846
Bug: 170265597
Test: atest MtsTetheringTest
      atest CtsTetheringTest
Change-Id: I59d529cb50b4b6cdafc6be78ad61a55ee1be0404
2020-10-16 17:11:20 +08:00
Yan Yan
7ccfde6046 Merge "Migrate IPsec CTS out of tests/tests/net" am: d8f0f4a3c7
Original change: https://android-review.googlesource.com/c/platform/cts/+/1455144

Change-Id: Ib31f7306f60b1cb60e968efe5ee82bc99c5f46e9
2020-10-15 17:34:22 +00:00
Yan Yan
d8f0f4a3c7 Merge "Migrate IPsec CTS out of tests/tests/net" 2020-10-15 17:30:49 +00:00
Mark Chien
a5b9e4a1b4 Merge "Fix miss tracking downstream problem in PrivateAddressCoordinator" am: 8565b0244a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1459887

Change-Id: I2874508c560cc31f99e88c02fd63995f62f86a2f
2020-10-15 12:46:39 +00:00
Mark Chien
8565b0244a Merge "Fix miss tracking downstream problem in PrivateAddressCoordinator" 2020-10-15 12:07:19 +00:00
Anton Hansson
67f88535d1 Merge "Remove Tethering @TestApi" am: bd175573a5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1460522

Change-Id: I3dcf776384d6c53876acaeb344820a88c19027da
2020-10-15 11:11:02 +00:00
markchien
634f0a8ec1 Fix miss tracking downstream problem in PrivateAddressCoordinator
The downstream do not be tracked if PrivateAddressCoordinator just
return cached address. Then, PrivateAddressCoordinator would not notify
that downstream if conflict happen.

Also remove the null check in getDownstreamPrefix because:
- An IpServer is only added to mDownstreams by requestDownstreamAddress.
- That method will only add the IpServer to mDownstreams if it has an
IPv4 address.
- As soon as that method returns, the IpServer sets mIpv4Address to the
address that was returned.
- When an IpServer is torn down, mIpv4Address is set to null after
releaseDownstream is called.

So it should never be possible for this to return null.

Bug: 168169687
Test: atest CtsTetheringTest
      atest TetheringTests
Change-Id: Ide5206b013acdc499344e1c839a830c5b245af41
2020-10-15 16:21:12 +08:00
Yan Yan
b4d5a4b66f Migrate IPsec CTS out of tests/tests/net
Bug: 170487836
Test: atest CtsIkeTestCases
Change-Id: I08f069c2a11f3daa3f0332c631055a1e0be7ce7b
2020-10-14 10:58:37 -07:00
Anton Hansson
87b8363cb9 Remove Tethering @TestApi
Modules shouldn't have TestApis, as documented in go/android-api-types.
Additionally, nothing depends on these TestApis existing.

Bug: 170395679
Test: m checkapi
Change-Id: I6e2c8298e90b4b54f0264be974d036fa08cd5632
Merged-In: I6e2c8298e90b4b54f0264be974d036fa08cd5632
2020-10-14 16:03:57 +01:00
Treehugger Robot
eea93bf6ed Merge "Test conflict notification work when using cached address" am: 32456142c0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1459889

Change-Id: Ib9be992d5728346f063cea6ebc67b11a209e04c4
2020-10-14 13:34:06 +00:00
Treehugger Robot
32456142c0 Merge "Test conflict notification work when using cached address" 2020-10-14 13:18:58 +00:00
Treehugger Robot
6d893b3eb3 Merge "Do not expect broadcasts in CaptivePortalTest" am: b54ca7b0c3
Original change: https://android-review.googlesource.com/c/platform/cts/+/1459764

Change-Id: I3efaa542deef2964082637cfbf7d6cac17a38fa8
2020-10-14 12:08:43 +00:00
Treehugger Robot
b54ca7b0c3 Merge "Do not expect broadcasts in CaptivePortalTest" 2020-10-14 11:57:25 +00:00
markchien
ccf07b1dd6 Test conflict notification work when using cached address
This test catch the regression introduced in r.android.com/1432958.

Bug: 1432958
Test: atest TetheringTest

Change-Id: Id0c1afb5563954ffee1f598a3a5de6a245d77a0e
2020-10-14 17:02:29 +08:00
Mark Chien
4388f63021 Merge "Allow tethering pick prefix from all of private address range" am: 8c9a2645d8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1436852

Change-Id: Ief2520cd30059542ae3786a36b92198af6739a2a
2020-10-13 13:42:20 +00:00
Mark Chien
8c9a2645d8 Merge "Allow tethering pick prefix from all of private address range" 2020-10-13 13:12:58 +00:00
markchien
d9acdccbd3 Allow tethering pick prefix from all of private address range
Currently tethering only pick prefix from 192.168.0.0/16. There is no
aviable tethering address if the upstream address is 192.168.x.y/16.
This change allow tethering to pick prefix from any private address
rnages. Now it still pick from 192.168.0.0/16 only to avoid behavior
change. Will have follow up commit to change the configuration.

Bug: 166057846
Bug: 170265597
Test: atest TetheringTests
      atest CtsTetheringTest

Change-Id: Ib6304eb8b4788e9196d0af48e72f00a6bda73a5f
2020-10-13 16:45:09 +08:00
Remi NGUYEN VAN
d7b3661334 Merge "Use IpUtils, NetworkStackConstants in DadProxyTest" am: 80794b2476
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440214

Change-Id: I2e8d55b7984bccbd5959b7b00fa8c8b24acdb67c
2020-10-13 06:31:32 +00:00
TreeHugger Robot
43c44f872a Merge "Merge ab/6749736 in stage." into stage-aosp-master 2020-10-13 03:31:41 +00:00
Remi NGUYEN VAN
71b9e93a83 Use IpUtils, NetworkStackConstants in DadProxyTest
The test had TODOs to address to use IpUtils and NetworkStackConstants
classes once they were moved to frameworks/libs/net. This is now done,
so using the new classes.

Bug: 158042941
Test: atest TetheringPrivilegedTests
Change-Id: I536b4506dbc3b42547ba9cb4e7c3c7a3e9459dd1
2020-10-13 11:30:03 +09:00
Sudheer Shanka
7cb66673cc Merge "Verify network state of apps hosting fg-service and in idle state." am: 468293beef
Original change: https://android-review.googlesource.com/c/platform/cts/+/1455860

Change-Id: I2b0130b115328ff43e9b495caef51167a4a46702
2020-10-13 00:01:00 +00:00
Sudheer Shanka
468293beef Merge "Verify network state of apps hosting fg-service and in idle state." 2020-10-12 23:31:17 +00:00
xiamengsen
05c8a1ddd0 Verify network state of apps hosting fg-service and in idle state.
Test: atest hostsidetests/net/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java

Signed-off-by: xiamengsen <xiamengsen@xiaomi.com>
Change-Id: I0e6e40b714483e51cfee45c155d8ac8b2b356494
2020-10-12 18:42:00 +00:00