Commit graph android_packages_modules_Co.../tests/net/java
Message SHA1
Merge "Inform the DNS resolver when it needs to do DNS64 synthesis." am: eed51faa49 am: f5a5cd3bd7
Change-Id: I06278ddff31d8c0dbb4ce6cfded01a38369d8a3c

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2020-05-26 10:13:17 +00:00
d0cf1afac5
Merge "Inform the DNS resolver when it needs to do DNS64 synthesis."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-05-26 09:26:46 +00:00
eed51faa49
Merge "Test that if an RA sets the same prefix as DNS, nothing happens." am: 82db920da4 am: 6d866bcd5f am: 352e8c2aa5 am: 7a35f41cf7 am: ccc05a0bc8
Change-Id: I58fbdf5bf51a1048acf61bd25107e2f2caa86617

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2020-05-24 12:14:57 +00:00
25045a554a
Merge "Test that if an RA sets the same prefix as DNS, nothing happens." am: 82db920da4 am: 6d866bcd5f
Change-Id: Ib2eb07e3794630cc636759ce6a6529b7b56a3cfe

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2020-05-24 11:30:55 +00:00
352e8c2aa5
Merge "Test that if an RA sets the same prefix as DNS, nothing happens."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2020-05-24 10:59:40 +00:00
82db920da4
Inform the DNS resolver when it needs to do DNS64 synthesis.
This is only necessary when learning the NAT64 prefix from the
RA, because if the NAT64 prefix is learned from DNS, the DNS
resolver already knows the prefix and automatically enables
DNS64 synthesis.

The DNS resolver needs to be informed of the prefix any time
clat is running on a prefix learned from an RA. This is simple to
implement: just set the prefix when starting clat if prefix
discovery is not running, and clear the prefix when stopping clat
if prefix discovery was not running. This ensures that the prefix
is cleared iff it was set.

Bug: 156914456
Test: new unit test coverage
Change-Id: If8ad2d30712a6df3e207c8d3e8a129705242191e

Lorenzo Colitti   commited 2020-05-21 23:32:57 +09:00
f28b6b705c
Merge "Suppress deprecation warnings in LegacyTypeTrackerTest." am: 585dc0665e am: 212e497cbc am: 4ca97a469c am: c1a0fffef6 am: 978aa17285
Change-Id: Ia7a29777227d1780e620c6c6b0ad84925512be12

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-05-21 09:17:22 +00:00
582c1a8e05
Merge "Suppress deprecation warnings in LegacyTypeTrackerTest." am: 585dc0665e am: 212e497cbc
Change-Id: I77fdf03484bd0da36ebffd025a33ab4859a0a5a2

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-05-21 08:31:13 +00:00
4ca97a469c
Test that if an RA sets the same prefix as DNS, nothing happens.
This is not particularly likely to happen unless the pref64 RA is
sent by a different router than the main RA. But more tests are
always good, and this additional coverage will be more useful
in an upcoming change.

Bug: 150648313
Test: test-only change
Change-Id: I3316d49d42100800740afadc4edf0a13a4d8377c

Lorenzo Colitti   commited 2020-05-21 17:26:00 +09:00
2a0ef00bb9
Merge "Suppress deprecation warnings in LegacyTypeTrackerTest."
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-05-21 07:47:45 +00:00
585dc0665e
Merge "Address nit from aosp/1301317" into rvc-dev
Chalard Jean   authored and   Android (Google) Code Review   commited 2020-05-21 06:44:30 +00:00
75fddad9b4
Merge "Fix a bug where VPNs start out suspended on cellular" into rvc-dev
Chalard Jean   authored and   Android (Google) Code Review   commited 2020-05-21 06:43:56 +00:00
8c06a845ac
Address nit from aosp/1301317
Test: atest ConnectivityServiceTest#testVpnSetUnderlyingNetworks
Bug: 150570873
Original-Change: https://android-review.googlesource.com/1307374
Merged-In: If5e5439b22f05e08a293fd83da4d54f6a4363ca5
Change-Id: If5e5439b22f05e08a293fd83da4d54f6a4363ca5

Treehugger Robot   authored and   Chalard Jean   commited 2020-05-21 05:12:41 +00:00
436608cf39
Fix a bug where VPNs start out suspended on cellular
As NetworkAgent is in a transition where all agents need
to include the NOT_SUSPENDED capability as part of their
migration to the system API, ConnectivityService adds it
forcefully to all agents that don't have the CELLULAR
transport. This doesn't include VPNs when VPNs have some
cellular network as their underlying network.

The best way to solve this is to make sure the VPN
capabilities reflect those of the underlying networks as
far as the NOT_SUSPENDED capability is concerned. This
is how they work for other similar capabilities.

This also happens to contain a drive-by fix for an issue
with a spurious capabilities callback is triggered when
a VPN connects and it has any underlying network (which
means almost always, because it will take the default
network if it doesn't declare any). Fixing this was
necessary to have a cogent test of this issue, but it
could be moved to another patch or it could stay unfixed
with some minor ajustment to the tests if judged too
dangerous to include in R at this point.

Test: New tests in this patch. Also manually tested with
      tcpdump as described in b/150570873.
Bug: 150570873
Original-Change: https://android-review.googlesource.com/1301317
Merged-In: I3e4ff990c0d4825b21c7679be29a482a2d1324ec
Change-Id: I3e4ff990c0d4825b21c7679be29a482a2d1324ec

Chalard Jean   commited 2020-05-21 05:10:37 +00:00
fc7054d0e9
Fix a bug where a spurious capabilities callback is sent.
When a VPN connects and it has any underlying network (which
means almost always, because it will take the default network
if it doesn't declare any), it has default capabilities and
will only take the capabilities of its underlying network
as part of an update happening after making the network
available but before the rematch can take place. This in turn
causes the capabilities callback sent as part of the rematch
to be spuriously sent.

Test: FrameworksNetTests. Also tested together with a
      followup that adds tests with drive-by coverage for this.
Bug: 150570873
Original-Change: https://android-review.googlesource.com/1305393
Merged-In: Id7d8bba486bada1a7ba5b0f152d2aa02e407f249
Change-Id: Id7d8bba486bada1a7ba5b0f152d2aa02e407f249

Chalard Jean   commited 2020-05-21 05:09:15 +00:00
1112dd3d83
Suppress deprecation warnings in LegacyTypeTrackerTest.
This saves dozens of warnings every time FrameworkNetTests is
compiled. There is nothing we can do about those warnings because
LegacyTypeTracker's reason for existence is to power deprecated
APIs.

Test: m FrameworksNetTests
Change-Id: I4d65b0aade493e12b56a94247efbf9d1ad7bb4b9

Lorenzo Colitti   commited 2020-05-20 20:53:16 +09:00
2f0583946a
Adjust tests for renaming groupHint to cluster.
Bug: 146460486
Test: atest android.net.IpMemoryStoreTest
Test: atest com.android.server.connectivity.ipmemorystore.IpMemoryStoreServiceTest
Change-Id: I69f7a2971cc5985d0f0078aecc39d4d6a6130033

Chalard Jean   commited 2020-05-20 14:37:17 +09:00
552c570501
Add methods for IKEv2/IPsec test mode profiles
This change adds the ability for IKEv2/IPsec VPN profiles to run on Test
Networks. If enabled, the IKEv2/IPsec VPN profiles will request ONLY
test networks.

Bug: 148582947
Test: FrameworksNetTests passing
Test: Added for testing
Change-Id: I2511b39b27a1e29ae97907cdb12728d13fb1628f
Merged-In: I2511b39b27a1e29ae97907cdb12728d13fb1628f
(cherry picked from commit 9e18eeb4a676ef3afc4bc510f18f81213b8edc55)

Benedict Wong   commited 2020-05-16 00:15:14 +00:00
23bd36bc04
Merge "Address nit from aosp/1301317" am: 14a5bf9510 am: 7b20fde8c9 am: b0af0ee400 am: 7af6037609 am: 02e86a3687
Change-Id: Id24f6eadf126616a8585ce56aef0de7f1c68c44b

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-05-15 08:15:35 +00:00
cda9dbd5aa
Merge "Address nit from aosp/1301317" am: 14a5bf9510 am: 7b20fde8c9
Change-Id: I7ae9b80954309b18eb6923da3aeaab3d1b8e3231

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-05-15 07:14:29 +00:00
b0af0ee400
Merge "Address nit from aosp/1301317"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-05-15 06:43:42 +00:00
14a5bf9510
Merge "Add methods for IKEv2/IPsec test mode profiles" am: 0dfb2b7b68 am: c2bdca3a27 am: b1368b92eb am: d65104d078 am: 623c8c9b7f
Change-Id: Ica5592c8b02effa49a8d672fb30ee703147e025e

Benedict Wong   authored and   Automerger Merge Worker   commited 2020-05-15 03:50:20 +00:00
8b89272659
Merge "Add methods for IKEv2/IPsec test mode profiles" am: 0dfb2b7b68 am: c2bdca3a27
Change-Id: I353d999ebcdd108a900abfe20be232e83147b6d2

Benedict Wong   authored and   Automerger Merge Worker   commited 2020-05-15 02:51:43 +00:00
b1368b92eb
Merge "Add methods for IKEv2/IPsec test mode profiles"
Benedict Wong   authored and   Gerrit Code Review   commited 2020-05-15 02:18:02 +00:00
0dfb2b7b68
Add methods for IKEv2/IPsec test mode profiles
This change adds the ability for IKEv2/IPsec VPN profiles to run on Test
Networks. If enabled, the IKEv2/IPsec VPN profiles will request ONLY
test networks.

Bug: 148582947
Test: FrameworksNetTests passing
Test: Added for testing
Change-Id: I2511b39b27a1e29ae97907cdb12728d13fb1628f

Benedict Wong   commited 2020-05-12 22:55:55 -07:00
cb09f72f47
Set owner and administrator UIDs for test networks.
This change sets the owner and administrator UIDs for test networks when
their initial values match the UID for the app creating the test
network. This ensures that apps registering test networks can only make
themselves owners / administrators of the network.

Bug: 153449964
Test: atest NetworkAgentTest
Change-Id: I3a974700aa1d83cb285295ed1de0aa263e2e5b58
Merged-In: I3a974700aa1d83cb285295ed1de0aa263e2e5b58
(cherry picked from commit 35782280a2adceec96b8e03c217788afa05894a0)

Cody Kesting   commited 2020-05-12 20:33:42 +00:00
ccfd0ff534
Merge "Set owner and administrator UIDs for test networks." am: eb44b7b1bb am: e4e48c22c5 am: 51edeeeb65 am: 88d1b83af6 am: e0336ca4d6
Change-Id: I4925d5a7f9c4dd063e87b138806a7b562a7390e4

Cody Kesting   authored and   Automerger Merge Worker   commited 2020-05-12 18:47:10 +00:00
5e6cc3187b
Merge "Set owner and administrator UIDs for test networks." am: eb44b7b1bb am: e4e48c22c5
Change-Id: I7af702ff5eafbd0f5bb2247e0debf975e51accd1

Cody Kesting   authored and   Automerger Merge Worker   commited 2020-05-12 17:26:44 +00:00
51edeeeb65
Merge "Set owner and administrator UIDs for test networks."
Cody Kesting   authored and   Gerrit Code Review   commited 2020-05-12 16:52:07 +00:00
eb44b7b1bb
Merge "Fix a bug where VPNs start out suspended on cellular" am: bd3a7f994d am: cbb9c78350 am: 986a8a1b76 am: 57ba9149dc am: e857684f7d
Change-Id: I94536a7867592ea4c2823f6dcaad1ac4420a3230

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-05-11 05:41:59 +00:00
e854cdbf3d
Merge "Fix a bug where VPNs start out suspended on cellular" am: bd3a7f994d am: cbb9c78350
Change-Id: I368308ded731b221be7fae6ddf1723c587ae4d20

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-05-11 04:59:35 +00:00
986a8a1b76
Address nit from aosp/1301317
Test: atest ConnectivityServiceTest#testVpnSetUnderlyingNetworks
Bug: 150570873
Change-Id: If5e5439b22f05e08a293fd83da4d54f6a4363ca5

Chalard Jean   commited 2020-05-11 13:25:16 +09:00
1f9e9ce3d5
Fix a bug where VPNs start out suspended on cellular
As NetworkAgent is in a transition where all agents need
to include the NOT_SUSPENDED capability as part of their
migration to the system API, ConnectivityService adds it
forcefully to all agents that don't have the CELLULAR
transport. This doesn't include VPNs when VPNs have some
cellular network as their underlying network.

The best way to solve this is to make sure the VPN
capabilities reflect those of the underlying networks as
far as the NOT_SUSPENDED capability is concerned. This
is how they work for other similar capabilities.

This also happens to contain a drive-by fix for an issue
with a spurious capabilities callback is triggered when
a VPN connects and it has any underlying network (which
means almost always, because it will take the default
network if it doesn't declare any). Fixing this was
necessary to have a cogent test of this issue, but it
could be moved to another patch or it could stay unfixed
with some minor ajustment to the tests if judged too
dangerous to include in R at this point.

Test: New tests in this patch. Also manually tested with
      tcpdump as described in b/150570873.
Bug: 150570873
Change-Id: I3e4ff990c0d4825b21c7679be29a482a2d1324ec

Chalard Jean   commited 2020-05-11 10:44:50 +09:00
91a1beddcc
Add tests for Tunnel, Transport mode application with released SPIs
This change adds tests to validate that both transport and tunnel mode
transforms continue to work even after the SPI resource has been
released. Specifically, since SPI resources are effectively subsumed by
the creation of a Transform, the SPI resource is still "alive", but
removed from the user-tracking sparse arrays.

Bug: 142072071
Test: Added these new tests. Failing prior to aosp/1133555, passes with.
Change-Id: I37dd459d08b57b14f72f3b28ea80fa231b152f10
Merged-In: I37dd459d08b57b14f72f3b28ea80fa231b152f10
(cherry picked from commit d06d390b20)

Benedict Wong   commited 2020-05-08 00:01:59 -07:00
ad72d21a53
Use TransformRecord to get SPI instead of SpiRecord
IpSecService.applyTunnelModeTransform() currently does not take an
SpiRecord instance, yet implicitly requires that the SpiRecord instance
is still alive based on the stored SpiRecord resourceId in
the TransformRecord's IpSecConfig.

This check is unnecessary, as the SpiRecord has been subsumed into the
TransformRecord, and the kernel resources are kept alive whether or
not the SpiRecord is still held by the user.

This allows users of the IpSecManager API to allocate short-lived SPIs
during the creation of an IpSecTransform, without having to keep track
of both of them (even though the SPI is no longer usable).

The TransformRecord.getSpiRecord() call is already used in
multiple other places in the same method.

Bug: 142072071
Test: New tests added, passing.
Change-Id: I1959f3080946267243564459ff4207647922566e
Merged-In: I1959f3080946267243564459ff4207647922566e
(cherry picked from commit 1425cf5655)

Benedict Wong   commited 2020-05-08 00:01:45 -07:00
c6cdcbfa83
Merge "Fix a bug where a spurious capabilities callback is sent." am: a4a379d6c9 am: fbf7472187 am: 3cfa50040f am: eb1b770994 am: f788a488fa
Change-Id: I18ba5d615df6c8a43aca01563f97ac451b48493a

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-05-08 02:35:29 +00:00
a19816b63c
Merge "Fix a bug where a spurious capabilities callback is sent." am: a4a379d6c9 am: fbf7472187
Change-Id: Ied089ed5ca553b206bdb3f7195f9e623aaabfa00

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-05-08 01:33:13 +00:00
3cfa50040f
Merge "Fix a bug where a spurious capabilities callback is sent."
Chalard Jean   authored and   Gerrit Code Review   commited 2020-05-08 00:49:33 +00:00
a4a379d6c9
Fix a bug where a spurious capabilities callback is sent.
When a VPN connects and it has any underlying network (which
means almost always, because it will take the default network
if it doesn't declare any), it has default capabilities and
will only take the capabilities of its underlying network
as part of an update happening after making the network
available but before the rematch can take place. This in turn
causes the capabilities callback sent as part of the rematch
to be spuriously sent.

Test: FrameworksNetTests. Also tested together with a
      followup that adds tests with drive-by coverage for this.
Bug: 150570873
Change-Id: Id7d8bba486bada1a7ba5b0f152d2aa02e407f249

Chalard Jean   commited 2020-05-07 12:07:03 +09:00
8c5e45895d
[SM10] Adopt helper class to monitor RAT type change per sub
Test: atest NetworkStatsServiceTest
Bug: 146415925
Change-Id: I45c3aa9046b316c8cd0943543d620a22e4afefd1
Merged-In: I45c3aa9046b316c8cd0943543d620a22e4afefd1
(cherry picked from commit 9f2e38da19)

junyulai   commited 2020-05-05 18:37:29 +08:00
5e3d346655
Merge "Merge "Restrict match conditions of TelephonyNetworkSpecifier#canBeSatisfied" into rvc-dev am: 7db902bf07 am: 3492cce255" into rvc-d1-dev-plus-aosp am: cb4807f190 am: 5eb9880d2b
Change-Id: I9956cd267a8d1394293c2f52ebc3af2dd559e9fe

Automerger Merge Worker   commited 2020-04-30 23:27:12 +00:00
19ecc3b610
Merge "Restrict match conditions of TelephonyNetworkSpecifier#canBeSatisfied" into rvc-dev am: 7db902bf07 am: 3492cce255
Change-Id: If62e7535d1417ceb0b2869007b87e37b34325972

Rambo Wang   authored and   Automerger Merge Worker   commited 2020-04-30 22:49:08 +00:00
ae7f1b1d58
Merge "Restrict match conditions of TelephonyNetworkSpecifier#canBeSatisfied" into rvc-dev am: 7db902bf07
Change-Id: I84be6ef46eb2e99749a86f24304555bff51ebfe6

Rambo Wang   authored and   Automerger Merge Worker   commited 2020-04-30 22:40:29 +00:00
1ec5abe098
Merge "Restrict match conditions of TelephonyNetworkSpecifier#canBeSatisfied" into rvc-dev
Rambo Wang   authored and   Android (Google) Code Review   commited 2020-04-30 22:23:13 +00:00
7db902bf07
Merge "Add filtering for IPsec algorithms in IKEv2 VPNs" into rvc-dev
Benedict Wong   authored and   Android (Google) Code Review   commited 2020-04-30 17:29:29 +00:00
b3ce2bb050
Add filtering for IPsec algorithms in IKEv2 VPNs
This commit adds support for validating and filtering IPsec algorithms.
Without a public API exposing IKEv2 algorithms (and their respective
public APIs), the allowedAlgorithms can only filter the proposals for
IPsec (Child) SA algorithms.

Additionally, this removes the HMAC_SHA1 from the IKE SA's integrity
algorithm proposals due to insecurity

Bug: 153701879
Test: FrameworksNetTests passing, new tests added
Change-Id: I7e61a1612692db275b751330af5bacbf86836a8c
Merged-In: I7e61a1612692db275b751330af5bacbf86836a8c
(cherry picked from commit a435ff8bf8)

Benedict Wong   commited 2020-04-29 23:05:35 -07:00
22d1b7df13
Merge "Address comments on NetworkStack AIDL v6" into rvc-dev
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2020-04-30 06:02:32 +00:00
3551e00976
Filter debug entries for each vpn
NetworkStats calculation needs to filter out debug entries to
prevent over counting. While NetworkStatsFactory migrates data
usage over a VPN to the TUN network, NetworkStatsFactory does
not filter out debug entries per vpn which will cause debug
entries left and cause exception.

Bug: 152678151
Test: atest com.android.server.net.NetworkStatsFactoryTest
      and verify no exception
Change-Id: I3525edc385b07858b48c7add2d331c4b5a2e84ad
Merged-In: I3525edc385b07858b48c7add2d331c4b5a2e84ad

Chiachang Wang   commited 2020-04-30 02:39:15 +00:00
61d8a11ea9
Add test prefix into test cases
Bug: 152678151
Test: atest com.android.server.net.NetworkStatsFactoryTest
Change-Id: I6e18915e383ac20072cb238d0136d7a8e4ceb811
Merged-In: I6e18915e383ac20072cb238d0136d7a8e4ceb811

Chiachang Wang   commited 2020-04-30 02:38:18 +00:00
a92a825412
Merge changes I3525edc3,I6e18915e am: c2e56739dc am: 11ed6b71d4 am: 15694d6d85 am: 8a29060fb7 am: bae528a933
Change-Id: Ibe3182636251cb16c42e93bf886de01908de8fb9

Chiachang Wang   authored and   Automerger Merge Worker   commited 2020-04-29 10:12:42 +00:00
15f80d3f14