Commit Graph

9817 Commits

Author SHA1 Message Date
TreeHugger Robot
9f4372c9bc [automerger skipped] Merge "Add network agent to enhance NetworkProvider test" into rvc-dev am: 1943988c6c am: 3c7cd0b000 -s ours
am skip reason: Change-Id Id494a1697cc1b73e8e56ae585a69faec31c59f52 with SHA-1 efd9d6903a is in history

Change-Id: Id0b95eb38cb198a48b1d879ce8482657b4d8b1f4
2020-04-21 10:31:28 +00:00
TreeHugger Robot
3c7cd0b000 Merge "Add network agent to enhance NetworkProvider test" into rvc-dev am: 1943988c6c
Change-Id: I57c49e657d1d07d4c15df4893c9e9f3fe984aa11
2020-04-21 10:23:10 +00:00
Lorenzo Colitti
4517689dc1 [automerger skipped] Merge "Support learning the NAT64 prefix from two different sources." into rvc-dev am: 4f7f6d67e9 am: fbae8c5f26 -s ours
am skip reason: Change-Id Ic7452431d2d9aea1ae59b67a9d8383c6cc5b3902 with SHA-1 c2c962ef08 is in history

Change-Id: Ic8af70ae1a29cda5cc6ef33f885db3532037de81
2020-04-21 10:21:53 +00:00
Lorenzo Colitti
fbae8c5f26 Merge "Support learning the NAT64 prefix from two different sources." into rvc-dev am: 4f7f6d67e9
Change-Id: I930d63aa0364a20141cd8e096a1a8b88e3b81fa7
2020-04-21 10:21:08 +00:00
Lorenzo Colitti
9f50308450 [automerger skipped] Merge "Stop prefix discovery if an RA prefix arrives in DISCOVERING" into rvc-dev am: a314315001 -s ours am: 4fc0376da3 -s ours
am skip reason: Change-Id I3803fa3d9806848b331c35ee8bac256934bd1f21 with SHA-1 d8911baa45 is in history

Change-Id: I1ab9d8f022fb7fab636fe7b03ead1d7d3f97aeef
2020-04-20 14:49:39 +00:00
Lorenzo Colitti
36bf65dadb [automerger skipped] Merge "Make the Nat464Xlat tests more realistic." into rvc-dev am: 6a3e78a97d -s ours am: a864001e97 -s ours
am skip reason: Change-Id I41766e9adaa7c24454648b371e6e3cc647693be5 with SHA-1 1076d22c37 is in history

Change-Id: I96feccdbe7ad16d3b1670d439a404aaa27b485b1
2020-04-20 14:49:04 +00:00
TreeHugger Robot
510473aac8 [automerger skipped] Merge "Add network agent to enhance NetworkProvider test" into rvc-dev am: 1943988c6c -s ours am: b037f4ba9c -s ours
am skip reason: Change-Id Id494a1697cc1b73e8e56ae585a69faec31c59f52 with SHA-1 efd9d6903a is in history

Change-Id: I05d9159176a01ef6d840eb81a4b737c42366fca3
2020-04-20 14:47:26 +00:00
Lorenzo Colitti
4fc0376da3 [automerger skipped] Merge "Stop prefix discovery if an RA prefix arrives in DISCOVERING" into rvc-dev am: a314315001 -s ours
am skip reason: Change-Id I3803fa3d9806848b331c35ee8bac256934bd1f21 with SHA-1 d8911baa45 is in history

Change-Id: Ia03b25467390136e847f1ecde7e4f1cbe5ee6451
2020-04-20 14:31:07 +00:00
Lorenzo Colitti
a864001e97 [automerger skipped] Merge "Make the Nat464Xlat tests more realistic." into rvc-dev am: 6a3e78a97d -s ours
am skip reason: Change-Id I41766e9adaa7c24454648b371e6e3cc647693be5 with SHA-1 1076d22c37 is in history

Change-Id: Ib62c56f16ad3df8a98038271ea5d57e0ed189192
2020-04-20 14:30:55 +00:00
TreeHugger Robot
b037f4ba9c [automerger skipped] Merge "Add network agent to enhance NetworkProvider test" into rvc-dev am: 1943988c6c -s ours
am skip reason: Change-Id Id494a1697cc1b73e8e56ae585a69faec31c59f52 with SHA-1 efd9d6903a is in history

Change-Id: I2fc90cbe6f01ba42a6ac47859d07ea3f4da8fb11
2020-04-20 14:30:34 +00:00
Lorenzo Colitti
a314315001 Merge "Stop prefix discovery if an RA prefix arrives in DISCOVERING" into rvc-dev 2020-04-20 14:29:29 +00:00
Lorenzo Colitti
6a3e78a97d Merge "Make the Nat464Xlat tests more realistic." into rvc-dev 2020-04-20 14:19:53 +00:00
TreeHugger Robot
1943988c6c Merge "Add network agent to enhance NetworkProvider test" into rvc-dev 2020-04-20 14:18:10 +00:00
Lorenzo Colitti
1a05283dd0 [automerger skipped] Merge "Support learning the NAT64 prefix from two different sources." into rvc-dev am: 4f7f6d67e9 -s ours am: 98955c3f79 -s ours
am skip reason: Change-Id Ic7452431d2d9aea1ae59b67a9d8383c6cc5b3902 with SHA-1 54fb93fbde is in history

Change-Id: Id0c91aa087b90efc608f63f7ce0f133c0d7a59de
2020-04-20 14:04:25 +00:00
Lorenzo Colitti
98955c3f79 [automerger skipped] Merge "Support learning the NAT64 prefix from two different sources." into rvc-dev am: 4f7f6d67e9 -s ours
am skip reason: Change-Id Ic7452431d2d9aea1ae59b67a9d8383c6cc5b3902 with SHA-1 54fb93fbde is in history

Change-Id: I6724e192ae3ad62fd44ead33369f76c9d7709525
2020-04-20 13:56:13 +00:00
Aaron Huang
5769ec5ad7 Add network agent to enhance NetworkProvider test
Add network agent to test more situation that could get the
onNetworkRequested callback.

Bug: 153614605
Bug: 153613690
Bug: 153612373
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkProviderTest
Change-Id: I7f827710b47546bd4419cc1ff06f03ec4635583d
Merged-In: Id494a1697cc1b73e8e56ae585a69faec31c59f52
(cherry picked from commit 9e92e57fd70944cbe8bb61bbb7a5fa728d0e68f5)
2020-04-20 12:13:03 +00:00
Lorenzo Colitti
c44662351e Stop prefix discovery if an RA prefix arrives in DISCOVERING
Currently, if a prefix is learned from an RA while prefix
discovery is running, clatd will be correctly started, but
prefix discovery will be stopped.

In order to fix this, make it possible to call
stopPrefixDiscovery without transitioning to IDLE state (which
is obviously necessary in this case), by moving the assignment of
the next state from that method to its callers. For consistency,
do the same for startPrefixDiscovery.

Bug: 150648313
Test: new test coverage
Change-Id: I3803fa3d9806848b331c35ee8bac256934bd1f21
Merged-In: I3803fa3d9806848b331c35ee8bac256934bd1f21
(cherry picked from commit c7c6f76402a989f91b02c37574b6a9de592cf1af)
2020-04-20 12:06:45 +00:00
Lorenzo Colitti
e0084efb28 Make the Nat464Xlat tests more realistic.
464xlat will never be started on a network that is not connected,
or on a network that has no IPv6 address.

This is a no-op test-only change but it is necessary for an
upcoming change that violates some of the invalid assumptions
currently made by this test and causes it to fail.

Bug: 150648313
Test: test-only change
Change-Id: I41766e9adaa7c24454648b371e6e3cc647693be5
Merged-In: I41766e9adaa7c24454648b371e6e3cc647693be5
(cherry picked from commit df0c522d18ee73c1d20cff1a1dc955b383e6c355)
2020-04-20 12:05:36 +00:00
Lorenzo Colitti
c2c962ef08 Support learning the NAT64 prefix from two different sources.
The NAT64 prefix from the RA always takes precedence over the
NAT64 prefix from DNS discovery, because it is detected faster,
and detecting it does not require sending any packets.

Bug: 150648313
Test: new unit test
Merged-In: Ic7452431d2d9aea1ae59b67a9d8383c6cc5b3902
Change-Id: Ic7452431d2d9aea1ae59b67a9d8383c6cc5b3902
2020-04-20 11:53:00 +00:00
Lorenzo Colitti
3c23b6ca88 Merge "Stop prefix discovery if an RA prefix arrives in DISCOVERING" am: 1e003f8ef6 am: 75b7cd38b2 am: 60f29587df
Change-Id: I896d49e23b8e7eadb29c930a295655cff5e92349
2020-04-20 11:48:18 +00:00
Lorenzo Colitti
0dc1e1a402 Merge "Make the Nat464Xlat tests more realistic." am: be49675e8d am: 1cfbcd12d6 am: f1e626d293
Change-Id: I31aa59d82248cbb1d2b4f51c6db0ca92e9798143
2020-04-20 11:38:14 +00:00
Lorenzo Colitti
60f29587df Merge "Stop prefix discovery if an RA prefix arrives in DISCOVERING" am: 1e003f8ef6 am: 75b7cd38b2
Change-Id: If6dd56d2860611586af3c434af3ddc4b6df76ab3
2020-04-20 11:38:11 +00:00
Lorenzo Colitti
e96495b03b Merge "Support learning the NAT64 prefix from two different sources." am: 35c55bc6ed am: 2418e4c269 am: 97beff86f9
Change-Id: I455df243a74d9e807e20d3aeada2bc90b565bce3
2020-04-20 11:37:55 +00:00
Lorenzo Colitti
f1e626d293 Merge "Make the Nat464Xlat tests more realistic." am: be49675e8d am: 1cfbcd12d6
Change-Id: Ib8d91c81af3d2e5d03c0fd47f415ff93fee5e2aa
2020-04-20 11:37:54 +00:00
Lorenzo Colitti
97beff86f9 Merge "Support learning the NAT64 prefix from two different sources." am: 35c55bc6ed am: 2418e4c269
Change-Id: I0c7e48c0b16fe09269ced98712bd636105f46a5c
2020-04-20 11:37:18 +00:00
Lorenzo Colitti
75b7cd38b2 Merge "Stop prefix discovery if an RA prefix arrives in DISCOVERING" am: 1e003f8ef6
Change-Id: Ia51addeb9d1f954a396764ec049213ac216b7c1f
2020-04-20 11:21:47 +00:00
Lorenzo Colitti
1cfbcd12d6 Merge "Make the Nat464Xlat tests more realistic." am: be49675e8d
Change-Id: I6a611b7fd7199d8c91baca39e04749ad8852a42e
2020-04-20 11:21:17 +00:00
Lorenzo Colitti
2418e4c269 Merge "Support learning the NAT64 prefix from two different sources." am: 35c55bc6ed
Change-Id: I8778773dab5f46aec6bf18c83d9766687307ca25
2020-04-20 11:20:58 +00:00
Lorenzo Colitti
1e003f8ef6 Merge "Stop prefix discovery if an RA prefix arrives in DISCOVERING" 2020-04-20 11:10:31 +00:00
Lorenzo Colitti
be49675e8d Merge "Make the Nat464Xlat tests more realistic." 2020-04-20 11:06:08 +00:00
Lorenzo Colitti
35c55bc6ed Merge "Support learning the NAT64 prefix from two different sources." 2020-04-20 11:05:52 +00:00
Lorenzo Colitti
d8911baa45 Stop prefix discovery if an RA prefix arrives in DISCOVERING
Currently, if a prefix is learned from an RA while prefix
discovery is running, clatd will be correctly started, but
prefix discovery will be stopped.

In order to fix this, make it possible to call
stopPrefixDiscovery without transitioning to IDLE state (which
is obviously necessary in this case), by moving the assignment of
the next state from that method to its callers. For consistency,
do the same for startPrefixDiscovery.

Bug: 150648313
Test: new test coverage
Change-Id: I3803fa3d9806848b331c35ee8bac256934bd1f21
2020-04-20 17:54:20 +09:00
Lorenzo Colitti
1076d22c37 Make the Nat464Xlat tests more realistic.
464xlat will never be started on a network that is not connected,
or on a network that has no IPv6 address.

This is a no-op test-only change but it is necessary for an
upcoming change that violates some of the invalid assumptions
currently made by this test and causes it to fail.

Bug: 150648313
Test: test-only change
Change-Id: I41766e9adaa7c24454648b371e6e3cc647693be5
2020-04-20 17:54:20 +09:00
Aaron Huang
bc2e71d17d Merge "Add network agent to enhance NetworkProvider test" am: 9f22c802c3 am: 37a275e9a9 am: 47699d24f3
Change-Id: Ieea40ecca466155a6044ac93544ed6fc5531ef1f
2020-04-20 08:30:29 +00:00
Aaron Huang
47699d24f3 Merge "Add network agent to enhance NetworkProvider test" am: 9f22c802c3 am: 37a275e9a9
Change-Id: I295d001e7b195c523b18b667825a84bb5e862248
2020-04-20 08:11:44 +00:00
Lorenzo Colitti
54fb93fbde Support learning the NAT64 prefix from two different sources.
The NAT64 prefix from the RA always takes precedence over the
NAT64 prefix from DNS discovery, because it is detected faster,
and detecting it does not require sending any packets.

Bug: 150648313
Test: new unit test
Change-Id: Ic7452431d2d9aea1ae59b67a9d8383c6cc5b3902
2020-04-20 16:50:53 +09:00
Aaron Huang
37a275e9a9 Merge "Add network agent to enhance NetworkProvider test" am: 9f22c802c3
Change-Id: Ib1b65aec6398f4e6a1cc2e14ec86d669be88ab74
2020-04-20 07:41:36 +00:00
Aaron Huang
9f22c802c3 Merge "Add network agent to enhance NetworkProvider test" 2020-04-20 07:20:25 +00:00
Aaron Huang
b624fff2da Merge "Move DhcpInfoTest to frameworks/base/tests/net/common" am: e66ba51271 am: 1b1056647b am: fbb37dbaea
Change-Id: I335f03257eb3a0b63c6b35527ff5964d677a8c40
2020-04-17 15:40:16 +00:00
Aaron Huang
fbb37dbaea Merge "Move DhcpInfoTest to frameworks/base/tests/net/common" am: e66ba51271 am: 1b1056647b
Change-Id: I7fb30591e0e380f3cf75417bb1d39c81baaaa3f0
2020-04-17 15:18:31 +00:00
Aaron Huang
1b1056647b Merge "Move DhcpInfoTest to frameworks/base/tests/net/common" am: e66ba51271
Change-Id: I7179f2e312d1e8237b211cb60eee5c08cd759197
2020-04-17 14:54:34 +00:00
Aaron Huang
88ec2e449d [automerger skipped] Merge "This contains a squash of two changes >>>>>>>>>>>>>>>>>>>>>> aosp/1284588 Adjust permission of NetworkProvider related API" into rvc-dev am: 6be2260534 -s ours am: babaf4a6eb -s ours
am skip reason: Change-Id Ic9809e731aa811a51c2f82d189372169d99a5ed9 with SHA-1 e5c0ba325d is in history

Change-Id: Iec99573d8584492622e1caf85b9879ec63dada8b
2020-04-17 11:17:21 +00:00
Aaron Huang
b0f3c6e6e5 [automerger skipped] Merge "This contains a squash of two changes >>>>>>>>>>>>>>>>>>>>>> aosp/1284588 Adjust permission of NetworkProvider related API" into rvc-dev am: 6be2260534 am: 64e475ef4e -s ours
am skip reason: Change-Id Ic9809e731aa811a51c2f82d189372169d99a5ed9 with SHA-1 e5c0ba325d is in history

Change-Id: I00a29862733b57decf62241abdc7582cacd156e6
2020-04-17 11:17:00 +00:00
Aaron Huang
babaf4a6eb [automerger skipped] Merge "This contains a squash of two changes >>>>>>>>>>>>>>>>>>>>>> aosp/1284588 Adjust permission of NetworkProvider related API" into rvc-dev am: 6be2260534 -s ours
am skip reason: Change-Id Ic9809e731aa811a51c2f82d189372169d99a5ed9 with SHA-1 e5c0ba325d is in history

Change-Id: I581e84d6c3e77d294089c4eccc464073191f341a
2020-04-17 11:01:43 +00:00
Aaron Huang
64e475ef4e Merge "This contains a squash of two changes >>>>>>>>>>>>>>>>>>>>>> aosp/1284588 Adjust permission of NetworkProvider related API" into rvc-dev am: 6be2260534
Change-Id: I2584b86082f224c6fdaa7e4ecc0aac52a92c3427
2020-04-17 11:01:29 +00:00
Aaron Huang
6be2260534 Merge "This contains a squash of two changes >>>>>>>>>>>>>>>>>>>>>> aosp/1284588 Adjust permission of NetworkProvider related API" into rvc-dev 2020-04-17 10:32:13 +00:00
Aaron Huang
b124dcff2c Move DhcpInfoTest to frameworks/base/tests/net/common
Address comment from aosp/1162443.
Move to FrameworksNetCommonTests so that it can be run in
cts test and presubmit test.

Also change package name from android.net.cts to android.net

Bug: 154299158
Test: atest FrameworksNetTest
      atest CtsNetTestCasesLatestSdk:android.net.DhcpInfoTest
Change-Id: I42a965ae5cb748fdd80b4d5c0f8b26f36f74be72
2020-04-17 18:26:20 +08:00
Aaron Huang
efd9d6903a Add network agent to enhance NetworkProvider test
Add network agent to test more situation that could get the
onNetworkRequested callback.

Bug: 153614605
Bug: 153613690
Bug: 153612373
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkProviderTest
Change-Id: Id494a1697cc1b73e8e56ae585a69faec31c59f52
2020-04-17 17:26:07 +08:00
Aaron Huang
07c36b1720 This contains a squash of two changes
>>>>>>>>>>>>>>>>>>>>>>
aosp/1284588
Adjust permission of NetworkProvider related API

- Allow an app holds NETWORK_SETTINGS to acess registerNetworkProvier()
  and unregisterNetworkProvider().
- To access declareNetworkRequestUnfulfillable(), allow an app holds
  MANAGE_TEST_NETWORKS to declare a unfulfillable request that contains
  TRANSPORT_TEST transport.

This makes easier to write cts to test.
>>>>>>>>>>>>>>>>>>>>>>
aosp/1285957
Add cts test for NetworkProvider

It will skip whole tests on Q device since NetworkProvider class
is introduced in R.

Result on Q device would be:
[1/1] android.net.NetworkProviderTest#skippedClassForDevSdkMismatch: IGNORED (3ms)
>>>>>>>>>>>>>>>>>>>>>>
Bug: 153614605
Bug: 153613690
Bug: 153612373
Test: atest FrameworksNetTests
      atest CtsNetTestCases:android.net.NetworkProviderTest
Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkProviderTest
Change-Id: Ib6f42b8f0e94e8c2715a030587e065864edff25b
Merged-In: Ic9809e731aa811a51c2f82d189372169d99a5ed9
Merged-In: If7bfc7fae503e3497c37754697d0b148ff4cab3b
(cherry picked from commit 10138d42a8f3892fcdb129a39409efe42873f6fe)
2020-04-17 08:45:29 +00:00
Bruce Chen
1f646ccece [automerger skipped] Merge "Add testTransportTypesEqual to dnsmanager test cases" into rvc-dev am: 0735c5f589 am: bb3cf385bb -s ours
am skip reason: Change-Id I6b23ccc6ce1659fdfd9573dfcd895f2c20fa9417 with SHA-1 366d6f9ada is in history

Change-Id: I4895ee75b1b1143fd4a05f7cc3e6adf20166fa87
2020-04-17 08:45:01 +00:00