Commit graph android_packages_modules_Co.../tests/net/java
Message SHA1
Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev am: bbcd3b326b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11881939

Change-Id: I7c285a848ac947e0acf1acc8bc32f3ece3456412

Luke Huang   authored and   Automerger Merge Worker   commited 2020-06-18 03:23:46 +00:00
f12eff79db
Disable sockets and DNS if process lacks INTERNET permission.
This is a Client-only solution.
  - Add to NetdClient a per-process std::atomic_boolean
    similar to netIdForProcess and netIdForResolv.
  - The boolean says whether the process should be
    allowed Internet connectivity.
  - Add an @hide method to NetUtils.java to set the boolean;
    call it from the initialization code of the new
    process just after forking from zygote.
  - Make netdClientSocket and dnsOpenProxy check the
    boolean. If the boolean is false, return EPERM from
    socket calls.

Bug: 150028556
Test: atest NetworkUtilsTest
Test: atest CtsAppSecurityHostTestCases:UseProcessTest
Change-Id: If002280fbad493dfc2db3d9d505c0257d49a9056
Exempt-From-Owner-Approval: OWNERS already approved identical patchset 5

Luke Huang   commited 2020-06-18 03:02:06 +00:00
5a42a4132f
Test extra info sent to NetworkMonitor
Test extra info sent to NetworkMonitor correctly if network
agent is created through new NetworkAgent constructor without
legacy network info taken as parameter.

Bug: 156173829
Test: atest FrameworkNetTests
Merged-In: I4f827664c528bea30cc957a0a617dd37693f4460
Change-Id: I4f827664c528bea30cc957a0a617dd37693f4460

Chiachang Wang   commited 2020-06-16 01:57:46 +00:00
1182d5a7fc
Merge "Test extra info sent to NetworkMonitor" am: 9792742ee0 am: 26cd395a9e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1331060

Change-Id: Ice048df853589411ee1f1c935b929994af1c525b

Chiachang Wang   authored and   Automerger Merge Worker   commited 2020-06-16 01:02:52 +00:00
41b5925f01
Test extra info sent to NetworkMonitor
Test extra info sent to NetworkMonitor correctly if network
agent is created through new NetworkAgent constructor without
legacy network info taken as parameter.

Bug: 156173829
Test: atest FrameworkNetTests
Change-Id: I4f827664c528bea30cc957a0a617dd37693f4460

Chiachang Wang   commited 2020-06-12 18:13:00 +08:00
301bc7b40a
Merge "Add unit test for NetworkStatsSubscriptionsMonitor" into rvc-dev am: 70afc75769
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11788484

Change-Id: Iac633487b359d751206e06b2352a2a9cb475811e

Aaron Huang   authored and   Automerger Merge Worker   commited 2020-06-12 02:11:29 +00:00
65556318aa
Add unit test for NetworkStatsSubscriptionsMonitor
Bug: 154080205
Test: atest FrameworksNetTests:com.android.server.net.NetworkStatsSubscriptionsMonitorTest
Change-Id: I4ef3f1ab2e5ea1322133edd80db3ccd0022e9c91

Aaron Huang   commited 2020-06-09 00:40:36 +08:00
a8eab54eee
Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" into rvc-dev am: 36d9c275ac
Change-Id: Ibc0f236234cd87d50a393c3dfaca7898b04e7432

Benedict Wong   authored and   Automerger Merge Worker   commited 2020-05-29 17:32:42 +00:00
f4a72ac0ff
Merge "Add RequiresFeature annotations for IKEv2 VPN profiles" into rvc-dev
Benedict Wong   authored and   Android (Google) Code Review   commited 2020-05-29 17:17:10 +00:00
36d9c275ac
Adjust tests for renaming groupHint to cluster.
Bug: 146460486
Test: atest android.net.IpMemoryStoreTest
Test: atest com.android.server.connectivity.ipmemorystore.IpMemoryStoreServiceTest
Change-Id: Ia9797bb93aa4ff89147a77823d342dc22aec6a25
Merged-In: I69f7a2971cc5985d0f0078aecc39d4d6a6130033
(cherry-picked from aosp/1311654)

Automerger Merge Worker   authored and   Chalard Jean   commited 2020-05-29 02:28:59 +00:00
dcb0e912b1
Add RequiresFeature annotations for IKEv2 VPN profiles
This change adds the @RequiresFeature annotation to Ikev2VpnProfile
Builder methods, and checks before provisioning VPN profiles.

Bug: 156681625
Test: New tests added, passing.
Change-Id: I125d8fbe5d67fb877ad7d0636c007cb3e1a9f59b
Merged-In: I125d8fbe5d67fb877ad7d0636c007cb3e1a9f59b
(cherry picked from commit e84a17dd1706f4c8373047b2023a1ec4b7cf4bf3)

Benedict Wong   commited 2020-05-28 19:07:29 -07:00
ba8ca78394
Merge "Add RequiresFeature annotations for IKEv2 VPN profiles"
Benedict Wong   authored and   Gerrit Code Review   commited 2020-05-29 01:55:08 +00:00
de684cfa06
Merge changes I289d935f,I0121a4ac am: 84af34369d am: 843c1661c7
Change-Id: If3c25f5a373e96fc007698ad2c5cdef5af92804a

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-05-28 11:08:56 +00:00
e48eec1903
Merge changes I289d935f,I0121a4ac
* changes:
  NetworkStats: apply464xlatAdjustments - don't remove CLAT_UID
  NetworkStats: apply464xlatAdjustments - remove useBpfStats parameter.

Treehugger Robot   authored and   Gerrit Code Review   commited 2020-05-28 10:34:01 +00:00
84af34369d
NetworkStats: apply464xlatAdjustments - remove useBpfStats parameter.
Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0121a4ac7ee824adc5930bab786d550b2f00b05b
Merged-In: I0121a4ac7ee824adc5930bab786d550b2f00b05b

Maciej Å»enczykowski   commited 2020-05-28 02:44:10 -07:00
19e7950e50
fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting100MBDownload
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

(so just copy over the rx stats from the before file)

Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie73ba0586dafde67bc2726db26e07f7268c18be3
Merged-In: Ie73ba0586dafde67bc2726db26e07f7268c18be3

Maciej Å»enczykowski   commited 2020-05-28 02:44:02 -07:00
bcb4c0db35
fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

Test: atest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4393afcbe8e1bb886ecf4f5c1573f6ac8a0e29f5
Merged-In: I4393afcbe8e1bb886ecf4f5c1573f6ac8a0e29f5

Maciej Å»enczykowski   commited 2020-05-28 02:43:53 -07:00
e32498e437
fix android.net.NetworkStatsTest#testApply464xlatAdjustments
Test: atest NetworkStatsTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib12ee88295eb502f6da13d212b4fd6298dea380f
Merged-In: Ib12ee88295eb502f6da13d212b4fd6298dea380f

Maciej Å»enczykowski   commited 2020-05-28 02:43:33 -07:00
b6662062ff
Merge changes Ie73ba058,I4393afcb,Ifebd946e,Ib12ee882,Ia171b779 am: 9fb791c62d am: 62cf792d3f
Change-Id: If8abb4247759462532cbac6b43bfb8d3202c6e34

Maciej Å»enczykowski   authored and   Automerger Merge Worker   commited 2020-05-28 09:36:05 +00:00
d08aecf08f
Merge changes Ie73ba058,I4393afcb,Ifebd946e,Ib12ee882,Ia171b779
* changes:
  fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting100MBDownload
  fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting
  fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccountingSimple
  fix android.net.NetworkStatsTest#testApply464xlatAdjustments
  NetworkStats - no need for xt_qtaguid clat bw fixups

Maciej Å»enczykowski   authored and   Gerrit Code Review   commited 2020-05-28 09:04:42 +00:00
9fb791c62d
NetworkStats: apply464xlatAdjustments - remove useBpfStats parameter.
Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0121a4ac7ee824adc5930bab786d550b2f00b05b

Maciej Å»enczykowski   commited 2020-05-28 01:33:25 -07:00
4bfcfc5f02
fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting100MBDownload
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

(so just copy over the rx stats from the before file)

Test: atest NetworkStatsTest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ie73ba0586dafde67bc2726db26e07f7268c18be3

Maciej Å»enczykowski   commited 2020-05-28 00:26:18 -07:00
b053a337e3
fix com.android.server.net.NetworkStatsFactoryTest#testDoubleClatAccounting
No clat app uid 0 rx stats on base iface due to ip6tables raw prerouting drop

Test: atest NetworkStatsFactoryTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I4393afcbe8e1bb886ecf4f5c1573f6ac8a0e29f5

Maciej Å»enczykowski   commited 2020-05-28 00:26:18 -07:00
2cc6ec11d7
fix android.net.NetworkStatsTest#testApply464xlatAdjustments
Test: atest NetworkStatsTest
Bug: 150738490
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ib12ee88295eb502f6da13d212b4fd6298dea380f

Maciej Å»enczykowski   commited 2020-05-28 00:26:18 -07:00
f24ada13aa
Merge "Adjust tests for renaming groupHint to cluster." am: f1b1600637 am: 3d2d28eac5
Change-Id: Ifd2d659c4c386fb8895230ffc85b2a9086ee1a84

Chalard Jean   authored and   Automerger Merge Worker   commited 2020-05-28 04:41:05 +00:00
53f0c18b8a
Merge "Adjust tests for renaming groupHint to cluster."
Chalard Jean   authored and   Gerrit Code Review   commited 2020-05-28 04:20:26 +00:00
f1b1600637
Merge "Add methods for IKEv2/IPsec test mode profiles" into rvc-dev
Benedict Wong   authored and   Android (Google) Code Review   commited 2020-05-27 17:31:00 +00:00
363674479d
Add RequiresFeature annotations for IKEv2 VPN profiles
This change adds the @RequiresFeature annotation to Ikev2VpnProfile
Builder methods, and checks before provisioning VPN profiles.

Bug: 156681625
Test: New tests added, passing.
Change-Id: I125d8fbe5d67fb877ad7d0636c007cb3e1a9f59b

Benedict Wong   commited 2020-05-27 02:05:49 -07:00
d196714698
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
Original-Change: https://android-review.googlesource.com/1315578
Merged-In: If8ad2d30712a6df3e207c8d3e8a129705242191e
Change-Id: If8ad2d30712a6df3e207c8d3e8a129705242191e

Lorenzo Colitti   commited 2020-05-26 11:52:35 +00:00
37aa693fb5
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
Original-Change: https://android-review.googlesource.com/1316094
Merged-In: I3316d49d42100800740afadc4edf0a13a4d8377c
Change-Id: I3316d49d42100800740afadc4edf0a13a4d8377c

Lorenzo Colitti   commited 2020-05-26 11:35:33 +00:00
0424f88915
Merge "Inform the DNS resolver when it needs to do DNS64 synthesis." am: c0ba5bf41d am: df775be39f
Change-Id: I06278ddff31d8c0dbb4ce6cfded01a38369d8a3c

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2020-05-26 10:13:17 +00:00
79fde3a970
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
c0ba5bf41d
Merge "Test that if an RA sets the same prefix as DNS, nothing happens." am: eafdd034f8 am: fcf8e6a45a
Change-Id: Ib2eb07e3794630cc636759ce6a6529b7b56a3cfe

Lorenzo Colitti   authored and   Automerger Merge Worker   commited 2020-05-24 11:30:55 +00:00
cc2ab62176
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
eafdd034f8
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
b432bc75e5
Merge "Suppress deprecation warnings in LegacyTypeTrackerTest." am: 8d55b55f60 am: 2911ce534e
Change-Id: I77fdf03484bd0da36ebffd025a33ab4859a0a5a2

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-05-21 08:31:13 +00:00
da847627ad
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
16b28e2b22
Merge "Suppress deprecation warnings in LegacyTypeTrackerTest."
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-05-21 07:47:45 +00:00
8d55b55f60
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
9024f27f97
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
5c721ed487
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
4a7eb2a5d2
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
ebbece8b22
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
bee5b3f227
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
84f1909fb1
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
3cd880b4bb
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
01ca51a900
Merge "Address nit from aosp/1301317" am: 1894a79964 am: 2dc15b02b2
Change-Id: I7ae9b80954309b18eb6923da3aeaab3d1b8e3231

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-05-15 07:14:29 +00:00
4e94c06d29
Merge "Address nit from aosp/1301317"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-05-15 06:43:42 +00:00
1894a79964
Merge "Add methods for IKEv2/IPsec test mode profiles" am: 56b98b0206 am: 099b0b8700
Change-Id: I353d999ebcdd108a900abfe20be232e83147b6d2

Benedict Wong   authored and   Automerger Merge Worker   commited 2020-05-15 02:51:43 +00:00
317aa920aa
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
56b98b0206