Commit graph android_packages_modules_Co.../tests/net/java
Message SHA1
Merge "Add StackedLinkProperties test case"
am: faf31f8638

Change-Id: I33d75bf593708317dca4ba6cec035b7f035cfa86

Chalard Jean   authored and   android-build-merger   commited 2018-06-20 21:23:17 -07:00
e71a3833fe
Add StackedLinkProperties test case
Change access level of getNetworkAgentInfoForNetwork in ConnectivityService to get
better testability. And add test case to verify clat state transition and make sure
linkProperties are updated correctly.

Bug: 80261579, 109913107
Test: runtest frameworks-net -c com.android.server.ConnectivityServiceTest \
          -m testStackedLinkProperties
Change-Id: I72fce594d74bd349f65557edca03640e1b86317c

junyulai   commited 2018-06-19 16:53:08 +08:00
74f9a8b52a
Disable the AppOp Restriction for IpSec Tunnels
This CL temporarily removes the AppOp restriction
that disallows creation of IpSec tunnels due to
the lack of the appropriate AppOp in AOSP/master.
When the relevant framework merges out to master,
this CL should be reverted.

Manually merging this due to skipping a merge
conflict at 9fe9ec18c1

Bug: none
Test: compilation
Change-Id: Ic06c193f85f6bcdd0ead4238825c1add78703cde

Nathan Harold   commited 2018-06-08 23:23:04 +00:00
1db89848ab
Merge changes from topic "ipsec-sync-with-pi"
* changes:
  Disable the AppOp Restriction for IpSec Tunnels
  Rework Exception Handling for IpSecManager
  Update IpSecManager to use InetAddress and prefixLen
  Add AppOps Checks for MANAGE_IPSEC_TUNNELS
  Add MANAGE_IPSEC_TUNNELS Permission

nharold   authored and   Gerrit Code Review   commited 2018-06-08 17:07:11 +00:00
ff904be7a9
Disable the AppOp Restriction for IpSec Tunnels
This CL temporarily removes the AppOp restriction
that disallows creation of IpSec tunnels due to
the lack of the appropriate AppOp in AOSP/master.
When the relevant framework merges out to master,
this CL should be reverted.

Bug: none
Test: compilation
Change-Id: Ic06c193f85f6bcdd0ead4238825c1add78703cde

Nathan Harold   commited 2018-06-07 18:44:34 -07:00
71fc014f00
Update IpSecManager to use InetAddress and prefixLen
LinkAddress constructors are currently @hide; this change updates
IpSecManager to use InetAddress and prefixLen, and then construct a
LinkAddress internally. LinkAddress is used over the binder interface to
IpSecService to ensure validity.

Bug: 77528639
Test: CTS, Java unit tests ran on walleye
Merged-In: I19e124adef6d9f4992d8293db3190bcf74c95848
Change-Id: I19e124adef6d9f4992d8293db3190bcf74c95848
(cherry picked from commit 2ea91aee42)

Benedict Wong   authored and   Nathan Harold   commited 2018-06-07 18:42:52 -07:00
ba38f8b79f
Add AppOps Checks for MANAGE_IPSEC_TUNNELS
Adds support for a new AppOp to permit services to
use IpSec tunnel mode. The IpSecService now needs
a context so change the service mode to a cached
service rather than a static service.

Bug: 66955045
Test: runtest frameworks-net
Merged-In: I17a4a286225b432c3e15ea1587d946189931b4f4
Change-Id: I17a4a286225b432c3e15ea1587d946189931b4f4
(cherry picked from commit 68a7edf1cb)

Nathan Harold   commited 2018-06-07 18:42:52 -07:00
2a9b2c8165
Unify behavior of various cases of "no underlying networks"
Before this change, VPNs having no underlying networks would be
marked as metered as the safe option, but VPNs having only
disconnected underlying networks would be marked as unmetered.
Fix this discrepancy.

Clean cherry-pick of ag/4113809

Bug: 79748782
Test: runtest frameworks-net
Change-Id: Ie6ace6bd95139605ffcfa8cd6c15cf28f8fa28c8
Merged-In: If19b85325e7d684e645470293b3c8a674084c641
Merged-in: I22f80a6a39d4a19ff74aa61fcbd66f1a041b1003

Chalard Jean   commited 2018-06-06 08:25:10 +00:00
ec3d62faa5
Fix: VPNs update caps upon underlying network disconnect.
Clean cherry-pick of ag/4083954

Bug: 79748782
Test: ConnectivityServiceTests still pass
Change-Id: I21e866c723099e5c3dee54ff13e830d44427fc7a
Merged-In: I12c948ebeb2b74290908f8320ff77220dc4a9fb9

Chalard Jean   commited 2018-06-06 08:25:02 +00:00
22670f9b93
Add tests for setUnderlyingNetworks.
Fixes come later. This is complex enough as it is.

Clean cherry-pick of ag/4083953

Bug: 79748782
Test: new test passes, old tests still pass
Change-Id: If7276fe1f751be7b9c18f689e97699e566e5bde0
Merged-In: I12c948ebeb2b74290908f8320ff77220dc4a9fb9

Chalard Jean   commited 2018-06-06 08:24:51 +00:00
32f9daa029
Fix setCapabilities.
P introduced setSSID, UIDs and unwanted capabilities.
None of these exhibit commutative behavior through combineCapabilities
because their semantics don't allow it. Therefore
NetworkRequest.setCapabilities() is badly broken around any of
these. Look at the comments in the new tests to realize the
extent of the damage.

Clean cherry-pick of ag/4083952

Bug: 79748782
Test: new tests written, old tests pass
Change-Id: Iafe074126132a82af37f4bf056c4a7b8d56bdc83
Merged-In: Ia5bebf8a233775367bbf1b788870528934ecbcfb
Merged-In: I13d7782a6c0c7b1f94137995bbb0d257a58d89c1

Chalard Jean   commited 2018-06-06 08:24:43 +00:00
52a6d547b7
Make sure getActiveNetwork is consistent with default callbacks
Almost clean cherry-pick of ag/3889538.

Bug: 77737389
Test: runtest framework-net
      new test don't pass without the main code change, but they
      do with it
Change-Id: I0cd83a935ab0b349aa47e065b830e5a43ab9a091
Merged-In: Iaa0285825735d3f16bba6e4946723a437fd9b0b9
Merged-In: Ia8f985b448251f911484e6bd63fa562bffc1b0e4

Chalard Jean   commited 2018-06-06 08:24:21 +00:00
818f6b5c6a
Add tests for getActiveNetwork.
Clean cherry-pick of ag/3918295
One-line adjustment for ag/3638326 which has not been put in AOSP.

Bug: 77737389
Test: runtest frameworks-net
Change-Id: I03ae2bbb08559f2cd44979e291c1f5d50eb215da
Merged-In: Iaa0285825735d3f16bba6e4946723a437fd9b0b9
Merged-In: Ia8f985b448251f911484e6bd63fa562bffc1b0e4

Chalard Jean   commited 2018-06-06 08:24:12 +00:00
d94e48ff95
Add a new ssid field in NetworkCapabilities.
Clean cherry-pick of ag/3887737

Bug: 77891227
Test: frameworks-net
Change-Id: Icefe1657bca52b913a72b56705342a7285769658
Merged-In: Ia1f4e51b7c2e9118789242cf6d9e7576c4167cda
Merged-In: I6dd1aba6fde5a502b4a9145cf16393d8ce623c89

Chalard Jean   commited 2018-06-06 08:23:52 +00:00
390bee5f2c
Merge "Migrating remaining core networking tests to Junit4"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2018-05-25 03:27:39 +00:00
bbfe4d043f
Merge changes I3b3bcbbd,I18b3f263,I3c416c1a
* changes:
  Use CaptivePortalProbeSpec method in portal app
  Add configurable captive portal probes
  Move CaptivePortalProbeResult to its own file

Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2018-05-24 07:53:00 +00:00
3f6d2b08ad
Migrating remaining core networking tests to Junit4
Bug: 62918393
Test: runtest frameworks-net
Merged-In: I30f7eaa0307b8fad5a8de7a0da235a4f76c18677
(clean cherry-pick of I30f7eaa0307b8fad5a8de7a0da235a4f76c18677)

Change-Id: I272fea0bb4a9e7f6252bb3bd14a6b769a082039e

Hugo Benichi   authored and   Remi NGUYEN VAN   commited 2018-05-24 16:24:47 +09:00
e17657c0f1
Move CaptivePortalProbeResult to its own file
This is necessary to resolve visibility issues for the next change.

Bug: b/79499239
Test: runtest frameworks-net
Merged-In: Ia48b32307a51a66f2672d7112f71166dd6db41b1
Merged-In: I5df7ee9f16bc6be4f02353d40a843a383dd4cbd9
(Clean cherry-pick of pi-dev I50bc96afe6ae88c8f58a693f0a4e821f1f9b3299)

Change-Id: I3c416c1a91ebfdf914fd528ff8ab73e3eb490562

Remi NGUYEN VAN   commited 2018-05-24 12:04:27 +09:00
f3eae13de9
Merge "Unify behavior of various cases of "no underlying networks"" into pi-dev
am: 468fdc3dd2

Change-Id: I22f80a6a39d4a19ff74aa61fcbd66f1a041b1003

Chalard Jean   authored and   android-build-merger   commited 2018-05-22 05:19:52 -07:00
8edc5b4398
Merge changes Ic8231b18,I30009f88 into pi-dev
am: 200cad09c7

Change-Id: I12c948ebeb2b74290908f8320ff77220dc4a9fb9

Chalard Jean   authored and   android-build-merger   commited 2018-05-22 04:06:35 -07:00
9eee2c33d4
Unify behavior of various cases of "no underlying networks"
Before this change, VPNs having no underlying networks would be
marked as metered as the safe option, but VPNs having only
disconnected underlying networks would be marked as unmetered.
Fix this discrepancy.

Bug: 79748782
Test: runtest frameworks-net
Change-Id: I51c3badde29f43f692f383553bd98327d2da8dd1

Chalard Jean   commited 2018-05-22 18:50:00 +09:00
f90bb339f5
Fix: VPNs update caps upon underlying network disconnect.
Bug: 79748782
Test: ConnectivityServiceTests still pass
Change-Id: Ic8231b18a17e6feb5ebafe8d5688fb59f9d4d58e

Chalard Jean   commited 2018-05-22 18:49:58 +09:00
d4f01cadc0
Add tests for setUnderlyingNetworks.
Fixes come later. This is complex enough as it is.

Bug: 79748782
Test: new test passes, old tests still pass
Change-Id: I30009f88e68a534c332ca88bae517cacc39a60bb

Chalard Jean   commited 2018-05-22 18:25:33 +09:00
e2b9a76574
Merge "Move CaptivePortalProbeResult to its own file" into pi-dev
am: 11d94b5742

Change-Id: Ia48b32307a51a66f2672d7112f71166dd6db41b1

Remi NGUYEN VAN   authored and   android-build-merger   commited 2018-05-22 01:09:08 -07:00
a9ba4a9d29
Merge "Fix setCapabilities." into pi-dev
am: cb42feb502

Change-Id: I13d7782a6c0c7b1f94137995bbb0d257a58d89c1

Chalard Jean   authored and   android-build-merger   commited 2018-05-22 01:01:39 -07:00
2e7a6c1b8f
Merge "Move CaptivePortalProbeResult to its own file" into pi-dev
Remi NGUYEN VAN   authored and   Android (Google) Code Review   commited 2018-05-22 08:00:56 +00:00
11d94b5742
Merge "Fix setCapabilities." into pi-dev
Chalard Jean   authored and   Android (Google) Code Review   commited 2018-05-22 07:51:09 +00:00
cb42feb502
Move CaptivePortalProbeResult to its own file
This is necessary to resolve visibility issues for the next change.

Bug: b/79499239
Test: runtest frameworks-net
Change-Id: I50bc96afe6ae88c8f58a693f0a4e821f1f9b3299

Remi NGUYEN VAN   commited 2018-05-22 10:00:28 +09:00
cabd8329f3
Fix setCapabilities.
P introduced setSSID, UIDs and unwanted capabilities.
None of these exhibit commutative behavior through combineCapabilities
because their semantics don't allow it. Therefore
NetworkRequest.setCapabilities() is badly broken around any of
these. Look at the comments in the new tests to realize the
extent of the damage.

Bug: 79748782
Test: new tests written, old tests pass
Change-Id: Ie46581bdaf9ecc2f14aab44788bbdb27a3fec8c1

Chalard Jean   commited 2018-05-21 14:46:40 +09:00
e15627ef72
Merge "Add explicit override for default Private DNS mode" into pi-dev
am: 2b3c858296

Change-Id: If480ab40c7cf9ab75c52feafc28338a049cbceef

Erik Kline   authored and   android-build-merger   commited 2018-05-18 01:08:26 -07:00
0e5c8f2092
Add explicit override for default Private DNS mode
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 79719289
Change-Id: I943c5476666e47d04690626e2133f501cb875b46

Erik Kline   commited 2018-05-17 17:41:12 +09:00
a7edf6ff56
Merge "Fix testRegisterUsageCallback" am: 899283d833
am: bc3a7a5ba5

Change-Id: If16708b5ce00dc374663e3c3dedd1d96342175f1

Remi NGUYEN VAN   authored and   android-build-merger   commited 2018-05-08 02:13:00 -07:00
80770e423c
Merge "Fix testRegisterUsageCallback"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2018-05-08 07:55:42 +00:00
899283d833
Merge changes from topic "ifaceStatsDetail" into pi-dev
* changes:
  Remove the unused file parsing function
  Use eBPF map data for per iface stats

android-build-team Robot   authored and   Android (Google) Code Review   commited 2018-05-02 19:17:27 +00:00
24596473b7
Fix testRegisterUsageCallback
noteOp (introduced in go/ag/3897834) checks that the calling uid matches
the calling package, which is not correct when using a fake calling
package. Use the real package of the test so permissions are checked
properly.

The test currently only fails this way in pi-dev as noteOp is only used
in pi-dev.
Change-Id: I9ac3717af9335ba9efa0b8842a2df0d7b69ec9ab
Test: Fixed test now passes in pi-dev
Bug: b/78487385

Remi NGUYEN VAN   commited 2018-05-02 16:51:13 +09:00
b1ff5a381e
Merge changes from topic "ifaceStats" am: 3f675c25e0
am: 7df94359d4

Change-Id: I460bc25806182bc2dc5fcc2512ab01e776a0e8e6

android-build-prod (mdb)   authored and   android-build-merger   commited 2018-05-01 19:53:30 -07:00
feed20b4e9
Remove the unused file parsing function
With the new xt_bpf support for iface stats. We no longer need to parse
the per interface stats from /proc/net/dev. And since the old xt_qtaguid
code path also not depend on it, we can completly remove that helper
function since no caller is depending on it now.

Bug: 72111305
Test: runtest frameworks-net -c com.android.internal.net.NetworkStatsFactoryTest
Change-Id: Icb7eaeef0eeb9fdffd32a90316c76ee05bafffbe
Merged-In: Icb7eaeef0eeb9fdffd32a90316c76ee05bafffbe
(cherry picked from aosp commit b815c978b81eee4b1494bd0b9d25bfad52f08b72)

Chenbo Feng   commited 2018-05-01 19:48:03 -07:00
cf7567ba7a
Remove the unused file parsing function
With the new xt_bpf support for iface stats. We no longer need to parse
the per interface stats from /proc/net/dev. And since the old xt_qtaguid
code path also not depend on it, we can completly remove that helper
function since no caller is depending on it now.

Bug: 72111305
Test: runtest frameworks-net -c com.android.internal.net.NetworkStatsFactoryTest
Change-Id: Icb7eaeef0eeb9fdffd32a90316c76ee05bafffbe

Chenbo Feng   commited 2018-05-01 14:13:55 -07:00
84c1437111
Let DnsManager fill in LinkProperties for private DNSes
(clean cherry-pick from ag/3880157)

Test: new tests pass
Bug: 73641539
Change-Id: I971ef4d27b22a435d7459e1c4b31a8715ef6e610
Merged-In: I837df61e3c277ae08ebf4fdcd4c4e9ac8c550811
Merged-In: I72ecaa4f7d7320ffa2e0ba82fadafc947c8a6981

Chalard Jean   commited 2018-04-27 13:32:10 +09:00
70be7a9dd0
Add the list of private DNS addresses to LinkProperties
(clean cherry-pick from ag/3874803)

Test: atest android.net.LinkPropertiesTest, also new tests pass
Bug: 73641539
Change-Id: If33a35b1354a67db09411ff098f20064797296ad
Merged-In: I4b739c56e658690532ae9deb0b9a3bc9b2adf8b0
Merged-In: I6bdbef78d078d68534c8e07e9af031ce374560ef

Chalard Jean   commited 2018-04-27 13:32:10 +09:00
299d856143
Merge changes I0cd83a93,I03ae2bbb into pi-dev
am: 411e79b8b0

Change-Id: Iaa0285825735d3f16bba6e4946723a437fd9b0b9

Chalard Jean   authored and   android-build-merger   commited 2018-04-24 03:02:11 -07:00
6093933b48
Make sure getActiveNetwork is consistent with default callbacks
Bug: 77737389
Test: runtest framework-net
      new test don't pass without the main code change, but they
      do with it
Change-Id: I0cd83a935ab0b349aa47e065b830e5a43ab9a091

Chalard Jean   commited 2018-04-24 17:32:00 +09:00
46adcf3089
Add tests for getActiveNetwork.
Bug: 77737389
Test: runtest frameworks-net
Change-Id: I03ae2bbb08559f2cd44979e291c1f5d50eb215da

Chalard Jean   commited 2018-04-24 15:23:28 +09:00
fd424b90be
Merge "Let DnsManager fill in LinkProperties for private DNSes" into pi-dev
am: 2a915264a6

Change-Id: I837df61e3c277ae08ebf4fdcd4c4e9ac8c550811

Chalard Jean   authored and   android-build-merger   commited 2018-04-23 00:33:21 -07:00
89af2956e6
Let DnsManager fill in LinkProperties for private DNSes
Test: new tests pass
Bug: 73641539
Change-Id: I971ef4d27b22a435d7459e1c4b31a8715ef6e610

Chalard Jean   commited 2018-04-23 13:58:42 +09:00
48bb49deff
Merge "Add the list of private DNS addresses to LinkProperties" into pi-dev
am: f12a2130a4

Change-Id: I4b739c56e658690532ae9deb0b9a3bc9b2adf8b0

Chalard Jean   authored and   android-build-merger   commited 2018-04-20 04:49:43 -07:00
2cc723e410
Add the list of private DNS addresses to LinkProperties
Test: atest android.net.LinkPropertiesTest, also new tests pass
Bug: 73641539
Change-Id: If33a35b1354a67db09411ff098f20064797296ad

Chalard Jean   commited 2018-04-20 16:48:43 +09:00
3e0a46a439
Merge "Revert "Revert "OP_GET_USAGE_STATS should be noted, not checked.""" into pi-dev
am: 687ddf6928

Change-Id: Ie9bcdc9736c04ab787efc193311a20d03718b593

Jeff Sharkey   authored and   android-build-merger   commited 2018-04-16 10:19:39 -07:00
569e8c496b
Merge "Revert "OP_GET_USAGE_STATS should be noted, not checked."" into pi-dev
am: 04efa57798

Change-Id: I2cc76316bca81c12e56337d6e36d82b0de6d9ded

Jeff Sharkey   authored and   android-build-merger   commited 2018-04-16 10:07:52 -07:00
330f1c0b18
Revert "Revert "OP_GET_USAGE_STATS should be noted, not checked.""
This reverts commit d5992e681f.

Reason for revert: ijpedowitz@

Bug: 77662908
Change-Id: I596d330d64942105f447bb613012bb11e281a805
Exempt-From-Owner-Approval: keep tests passing

Jeff Sharkey   commited 2018-04-16 16:50:34 +00:00
069002e639