Commit Graph

564 Commits

Author SHA1 Message Date
Benedict Wong
81632553fb Merge "Return a port from bindToPort() in IpSecService" am: 9305fb7ea1 am: d6ab173f6c
am: a18f840082

Change-Id: I0d1c17c3740983ab0cbc24c2cd0d3a530b56ca99
2017-10-24 17:09:28 +00:00
Benedict Wong
a18f840082 Merge "Return a port from bindToPort() in IpSecService" am: 9305fb7ea1
am: d6ab173f6c

Change-Id: Ie59d496a38bf9775c1f40a543a24cb3fec5719bf
2017-10-24 16:54:57 +00:00
Benedict Wong
d6ab173f6c Merge "Return a port from bindToPort() in IpSecService"
am: 9305fb7ea1

Change-Id: I51705d5db6af560f2423ef7861bfde6734632ec9
2017-10-24 16:44:59 +00:00
Benedict Wong
9305fb7ea1 Merge "Return a port from bindToPort() in IpSecService" 2017-10-24 16:31:21 +00:00
Benedict Wong
c35ca6de37 Merge "Add support for AES-GCM-ESP as an IPSec algorithm" am: b6df7f0d35 am: d3a5792024 am: f92bfc3b77
am: 9c6f24d1ee

Change-Id: Ie9a43c7f0519a2d7ac3326944608190503804483
2017-10-19 17:48:53 +00:00
Benedict Wong
9c6f24d1ee Merge "Add support for AES-GCM-ESP as an IPSec algorithm" am: b6df7f0d35 am: d3a5792024
am: f92bfc3b77

Change-Id: I49932a5fc048b4a60512fac45a3537f050397168
2017-10-19 17:37:22 +00:00
Benedict Wong
d3a5792024 Merge "Add support for AES-GCM-ESP as an IPSec algorithm"
am: b6df7f0d35

Change-Id: Ic099206a28c4f21fa796969c953a8d4e81e8495b
2017-10-19 17:14:53 +00:00
Benedict Wong
f186d6703e Return a port from bindToPort() in IpSecService
When binding to a random port, the port number was not being
returned, so the user is incorrectly receiving a port of zero.
Return the port number that was ultimately bound.

Bug: 67662580
Test: Ran CTS test on aosp_angler-eng
Change-Id: I22f4e5cdc83d43dc453788889990feb34e451bd3
2017-10-18 11:43:43 -07:00
Benedict Wong
0febe5ece5 Add support for AES-GCM-ESP as an IPSec algorithm
Allows native AES-GCM-ESP to be used as an IPSec transport/tunnel mode
algorithm with kernel support

Bug: 63589918
Test: IPsecService tests added, existing ones pass
Change-Id: Ie1a9a902be205f269aa37bf956198f2e5b177c21
2017-10-18 11:22:24 -07:00
Hugo Benichi
98bee8d32c Merge "Fix ConnectivityServiceTest#testNetworkCallbackMaximum" am: d098328585 am: 104b2bcc79 am: 4071792cce
am: e4cf6229f7

Change-Id: I65c210d8f0ee27540339233d45def0c464920aea
2017-10-15 03:39:01 +00:00
Hugo Benichi
e4cf6229f7 Merge "Fix ConnectivityServiceTest#testNetworkCallbackMaximum" am: d098328585 am: 104b2bcc79
am: 4071792cce

Change-Id: Id5ee94ae9a7e2a92289f2b25b0d5c0f0b5b7381a
2017-10-15 02:53:58 +00:00
Hugo Benichi
104b2bcc79 Merge "Fix ConnectivityServiceTest#testNetworkCallbackMaximum"
am: d098328585

Change-Id: I1cbe45eb339903630675713d287e3375c7c98e62
2017-10-15 02:24:52 +00:00
TreeHugger Robot
92ec65eee1 Merge "Migrating remaining core networking tests to Junit4" 2017-10-13 05:26:31 +00:00
Hugo Benichi
3d6ba6ed6d Migrating remaining core networking tests to Junit4
Bug: 62918393
Test: runtest frameworks-net
Change-Id: I30f7eaa0307b8fad5a8de7a0da235a4f76c18677
2017-10-13 12:16:32 +09:00
Hugo Benichi
1e5039e0e4 Fix ConnectivityServiceTest#testNetworkCallbackMaximum
Although commit 893a762c2f fixed some flakyness issues in
testNetworkCallbackMaximum so that it became stable when ran on its own,
it introduced a new source of random failures because instead of
registering callbacks after callbacks until a limit was reached, commit
893a762c2f changed the test logic to push the assertions right up to
the theoretical limit.

More precisely when registering and unregistering PendingIntents in a
loop, not introducing some delay for checking that previous
PendingIntents have been effectively unregistered can cause the test to
fail. This patch fixes this issue.

Bug: 32561414
Bug: 62918393
Test: runtest frameworks-net
      testNetworkCallbackMaximum now succeeds 100 in a row on sailfish

Change-Id: I086817a738ab99fd53ba76ca8faada6151f46472
2017-10-12 23:15:14 +09:00
Hugo Benichi
96ba9c4422 Merge "Migrate most of core networking tests to junit4" am: 9d456cd9c6 am: 7d9588c836 am: c40687f85a
am: 550de399d7

Change-Id: I44024c6cfe2bcb66f00a39ac9d97182ff62a23d1
2017-10-12 09:52:28 +00:00
Hugo Benichi
550de399d7 Merge "Migrate most of core networking tests to junit4" am: 9d456cd9c6 am: 7d9588c836
am: c40687f85a

Change-Id: Ic59ca37bbb31ba091c8b6d31170584b946c2527a
2017-10-12 09:43:11 +00:00
Hugo Benichi
7d9588c836 Merge "Migrate most of core networking tests to junit4"
am: 9d456cd9c6

Change-Id: Ib124efb327bfbacd5a637753f9c9724e27a218cb
2017-10-12 09:24:40 +00:00
Hugo Benichi
4a0c5d7ef7 Migrate most of core networking tests to junit4
This patch is a batch of mechanical changes to test classes to migrate
away from AndroidTestCase and TestCase.

Bug: 62918393
Test: runtest frameworks-net
Change-Id: I74134609e511f22c4d9ecd65780e981f9ba7ae3f
2017-10-12 15:26:09 +09:00
nharold
19d69c61fa Merge changes from topic "ipsec-svc-cleanup" am: 9778c7884f am: ae61e0c6e8 am: 4e793fd0b5
am: b87c060ec7

Change-Id: I7418f23141b26f23555397d231e8a73692c04085
2017-10-04 21:14:17 +00:00
nharold
b87c060ec7 Merge changes from topic "ipsec-svc-cleanup" am: 9778c7884f am: ae61e0c6e8
am: 4e793fd0b5

Change-Id: Ib7eae5c9e223493281524e862979e16d25984dde
2017-10-04 20:53:04 +00:00
nharold
ae61e0c6e8 Merge changes from topic "ipsec-svc-cleanup"
am: 9778c7884f

Change-Id: Ide81ae76bd05ba3a2cc7c06c072306d30a489057
2017-10-04 20:24:10 +00:00
Nathan Harold
2e9a520024 Split IpSecServiceTest to add IPv6 Tests
-Split IpSecServiceTest into parameterized
 and single tests.
-Add IPv6 parameters

Bug: 66954381
Test: this
Change-Id: Ib98c112560014f73bccc3d2842c31d297c7a07ef
2017-10-03 19:45:59 -07:00
Nathan Harold
a10003d5de Input Validation for IpSecService
All of the input to IpSecService over the Binder
interface needs to be validated both for sanity
and for safety.

-Sanity check all the parameters coming from binder.
-Added setters for IpSecConfig to decouple the test
 from the IpSecManager. This was needed because the
 input validation caused the tests to fail due to a
 null parameter that was previously un-tested.
-Added the mode flag to the IpSecConfig bundle this
 oversight was found during testing.
-Expose the getResourceId() methods for testing in
 UdpEncapsulationSocket, SecurityParameterIndex, and
 IpSecTransform classes.
-Remove the unneeded getIpSecConfig() from
 IpSecTransform: unneeded now that we can synthesize
 configs.

Bug: 38397094
Test: runtest frameworks-net
Change-Id: I5241fc7fbfa9816d54219acd8d81a9f7eef10dd4
2017-10-03 19:45:55 -07:00
Hugo Benichi
c9a261a9f7 Merge "ConnectivityServiceTest: fix flaky testNetworkRequestMaximum" am: 1211941aa0 am: 0d506fc4f4 am: eced6cd14a
am: 6833a8dde7

Change-Id: Ifab1ace2ddf79f611d1f05080e2c31a4992810b7
2017-10-02 10:58:58 +00:00
Hugo Benichi
6833a8dde7 Merge "ConnectivityServiceTest: fix flaky testNetworkRequestMaximum" am: 1211941aa0 am: 0d506fc4f4
am: eced6cd14a

Change-Id: I53d0d6755c8e0be34db66da56efa483006e538ac
2017-10-02 10:51:21 +00:00
Hugo Benichi
0d506fc4f4 Merge "ConnectivityServiceTest: fix flaky testNetworkRequestMaximum"
am: 1211941aa0

Change-Id: I169e1d48bffab3326dd61011b7747c1400b9bc74
2017-10-02 10:36:22 +00:00
Hugo Benichi
893a762c2f ConnectivityServiceTest: fix flaky testNetworkRequestMaximum
Registered requests are not keyed by PendingIntents in
ConnectivityService, which means that unregistering a request with a
PendingIntent causes a linear search in all registered requests.

testNetworkRequestMaximum was registering too many PendingIntents
simultaneously, causing the unregistration loop to have n^2
complexity and to take a long time to take effect.

To make the unregistering loop less likely to trigger a timeout on
waitForIdle, this patch changes the test to not register MAX_REQUEST
number of PendingIntent, but instead mixes a small number of
PendingIntents with NetworkCallbacks to reach MAX_REQUEST number of
simultaneously registered requests.

When unregistering these requests, callbacks are unregistered first.

Bug: 32561414
Test: runtest frameworks-net
Change-Id: I48b882c884abe20b388190b7f28baee293446f37
2017-10-02 17:37:57 +09:00
Hugo Benichi
888033207b Merge "Fix NPE in NsdServiceTest" am: 60d5390f7a am: f9422cc65b am: a5d620ae92
am: a838fcfa75

Change-Id: I5a4837078a7506b30497bba1cceb416ab37e82d9
2017-09-28 12:40:44 +00:00
Hugo Benichi
a838fcfa75 Merge "Fix NPE in NsdServiceTest" am: 60d5390f7a am: f9422cc65b
am: a5d620ae92

Change-Id: Ieb299771438fe55566b76271815e52d02da799c8
2017-09-28 12:35:03 +00:00
Hugo Benichi
f9422cc65b Merge "Fix NPE in NsdServiceTest"
am: 60d5390f7a

Change-Id: Ic9b7aaec14066d18247cc1efbdc06be1e6a79f29
2017-09-28 12:22:34 +00:00
Hugo Benichi
60d5390f7a Merge "Fix NPE in NsdServiceTest" 2017-09-28 12:13:18 +00:00
Hugo Benichi
d9e551957b Fix NPE in NsdServiceTest
Continuous test dashboards report that quit() can crash sometimes
due to mThread being null.

This patch adds a null guard in tearDown().

Bug: 32561414
Test: runtest frameworks-net
Change-Id: If66fb47e31e77d25b4741a786f12eb78f0b9102e
2017-09-28 15:22:13 +09:00
Lorenzo Colitti
6fb1658fbb Merge "Delete the legacy framework code for manipulating ND offload." am: d1ae268081 am: 53eb9d359a am: bb21618a86
am: c34d05691d

Change-Id: Ie442b73e9130aaeb5b46d4e2789521a508df6221
2017-09-27 11:13:15 +00:00
Lorenzo Colitti
c34d05691d Merge "Delete the legacy framework code for manipulating ND offload." am: d1ae268081 am: 53eb9d359a
am: bb21618a86

Change-Id: I07d9753e214af311d3dcab6f8016442f60388700
2017-09-27 11:05:29 +00:00
Lorenzo Colitti
53eb9d359a Merge "Delete the legacy framework code for manipulating ND offload."
am: d1ae268081

Change-Id: I060bd7632b809d89224d250c697ac9d2e89d5c2d
2017-09-27 10:53:05 +00:00
Lorenzo Colitti
ed961bb82a Merge "Declare support for Ethernet if the service is running." am: 0d3d35b30b am: 5ada8e56f8 am: a6648cc90b
am: 85aa652492

Change-Id: I38791cf8b26a49dd8bd210ea3e0284dece9f0719
2017-09-27 09:08:08 +00:00
Lorenzo Colitti
85aa652492 Merge "Declare support for Ethernet if the service is running." am: 0d3d35b30b am: 5ada8e56f8
am: a6648cc90b

Change-Id: Iafd9807ab76ce4e4ab1fd506d7b0e2b2b7017751
2017-09-27 08:51:51 +00:00
Lorenzo Colitti
5ada8e56f8 Merge "Declare support for Ethernet if the service is running."
am: 0d3d35b30b

Change-Id: Ie0a0190da53571c6f4b466840b7878eb54b5e136
2017-09-27 08:32:43 +00:00
Lorenzo Colitti
59da962b9f Delete the legacy framework code for manipulating ND offload.
This only worked on broadcom devices, and was superseded in
M by a wifi HAL call made by IpManager.

Test: bullhead builds, boots
Change-Id: I711cae7dafe171c2c8b4e84a229adbcad27f3d14
2017-09-27 16:47:36 +09:00
Lorenzo Colitti
7bbe3eee52 Declare support for Ethernet if the service is running.
On some devices, support for TYPE_ETHERNET is not specified in
the networkAttributes config resource, even though the device is
capable of supporting Ethernet (e.g., via USB host adapters).
This leads to Ethernet working but various connectivity APIs
behaving as if it was not - for example, no CONNECTIVITY_ACTION
broadcasts will be issues when it connects or disconnects.

Ensure that ConnectivityService always treats Ethernet as
available if the service is running. Currently the service is
started if the device supports FEATURE_ETHERNET or
FEATURE_USB_HOST.

Bug: 37359230
Test: bullhead builds, boots
Test: ConnectivityServiceTest passes
Test: Ethernet is available even if removed from networkAttributes resource
Test: ConnectivityManagerTest CTS test passes
Change-Id: I58801bf4f0bbdc3ff6345ec6bfdc911ce045c8ab
2017-09-27 13:03:10 +09:00
Erik Kline
6498a4b82d Merge "Also support 464xlat on SUSPENDED networks" am: 995a28d334 am: 69a28066bd am: 1347ac8109
am: 5739596659

Change-Id: Iacc209990bd7be57578bc52c9f57c63e0540209e
2017-09-21 12:10:40 +00:00
Erik Kline
5739596659 Merge "Also support 464xlat on SUSPENDED networks" am: 995a28d334 am: 69a28066bd
am: 1347ac8109

Change-Id: I83ae39a2e36bc036dce419c80dd476d2358b4537
2017-09-21 12:06:05 +00:00
Erik Kline
69a28066bd Merge "Also support 464xlat on SUSPENDED networks"
am: 995a28d334

Change-Id: Iab87bfcb66e7932d61beec38bcbda366262eab46
2017-09-21 11:55:35 +00:00
Treehugger Robot
995a28d334 Merge "Also support 464xlat on SUSPENDED networks" 2017-09-21 11:47:33 +00:00
Erik Kline
3c18216c26 Also support 464xlat on SUSPENDED networks
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 65684232

Change-Id: I1b10aab01554b1f926ec7157dba78645fdaff90f
2017-09-21 18:06:29 +09:00
Erik Kline
7a5dd80c95 Merge "have OffloaderController store and re-push more state"
am: 69efc596af

Change-Id: I468b9d774bb273c765ee6ff597ff207d047e1cc6
2017-09-21 08:47:43 +00:00
Erik Kline
bc8b2eec19 have OffloaderController store and re-push more state
Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 29337859
Bug: 32163131
Bug: 64976634
Merged-In: If3a859736a1b3730e4e3d0d2685f3e5432927796
Merged-In: If9afc160fa2f8b5da66cb0a6a35dfcb4f1839d36
Change-Id: Ib1421438a1e748722fc41f1fbfb01ada187bb1c8
(cherry picked from commit 7334b0e2cc)
2017-09-21 15:41:53 +09:00
Erik Kline
2b2dfc328b Merge "have OffloaderController store and re-push more state" into oc-mr1-dev am: 1dd52a8017
am: 48db1fb74f

Change-Id: If9afc160fa2f8b5da66cb0a6a35dfcb4f1839d36
2017-09-21 04:42:58 +00:00
Erik Kline
48db1fb74f Merge "have OffloaderController store and re-push more state" into oc-mr1-dev
am: 1dd52a8017

Change-Id: If3a859736a1b3730e4e3d0d2685f3e5432927796
2017-09-20 23:39:11 +00:00