Commit graph android_packages_modules_Co.../tests/net/java/com/android/server
Message SHA1
resolve merge conflicts of 6c3cd4449517 to oc-dev-plus-aosp
Test: make -j64 framework services FrameworksNetTests
Change-Id: Ib828e56b271cd983ef325e366418ca8db9774628

Lorenzo Colitti   commited 2017-03-28 23:49:11 +09:00
db624146ac
Merge changes If94102c7,I8d51e8e0
am: 22b829c049

Change-Id: I8aa529a05fc40241ec9664775ca0ebd8960098a8

Lorenzo Colitti   authored and   android-build-merger   commited 2017-03-28 12:33:28 +00:00
fdad5b79a2
Make ConnectivityServiceTest pass on wifi-only devices.
Test: ConnectivityServiceTest passes on ryu on internal master
Test: ConnectivityServiceTest passes on bullhead
Change-Id: If94102c7df0257ea9e69e72b07a685ae3c2c4022

Lorenzo Colitti   commited 2017-03-28 12:53:06 +09:00
cd447b2cdc
Merge "Fix NetworkNotificationManagerTest"
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2017-03-23 06:25:38 +00:00
a4213684a0
Fix NetworkNotificationManagerTest
The testNotificationsShownAndCleared test was not doing anything
because the list of notification to show was always empty.

This patch fixes this issue and actually makes the test loop on
non-empty collections, and also fixes another ordering issue in
assertions themselves, hidden until now by the first issue.

Test: runtest -x frameworks/base/tests/net/java/com/android/server/connectivity/NetworkNotificationManagerTest.java
Change-Id: I4837b1175d7c9133e9156e33acaa1e7e3341cc62

Hugo Benichi   commited 2017-03-23 12:32:27 +09:00
9eec272054
Connectivity metrics: add transports to validation probes
This patch adds transports info to ValidationProbeEvent and migrates
netId logging for this event to the topt-level netId field in
ConnectivityMetricsEvent.

Test: modified unit tests. $ runtest frameworks-net passes
Bug: 3490169
Change-Id: Ibf51049ba8901ae5ca4ea86e2f500944a4738b5c

Hugo Benichi   commited 2017-03-21 11:43:18 +09:00
7f818778a8
Connectivity metrics: change how interface names are logged
This patch deprecates the ifname field for specific metrics events of
types DhcpClientEvent, DhcpErrorEvent, IpReachabilityEvent and
IpManagerEvent.

Instead ifnames are logged in ConnectivityMetricsEvent, allowing for
link layer inference.

Test: updated unit tests, $ runtest frameworks-net passes
Bug: 34901696
Change-Id: I8bfabcb115bbd5289471d653c153a40bb48f28cd

Hugo Benichi   commited 2017-03-21 10:18:56 +09:00
075cd83383
Connectivity metrics: serialize networkId, transports, ifname
This patch adds translation from ConnectivityMetricsEvent to
IpConnectivityEvent of recently added fields:
 - top-level network id
 - top-level ifname
 - transports

Also adds inference of link layer from transports or ifname.

At the moment these new fields are not populated in
ConnectivityMetricsEvent. Follow-up patches will fill this gap for
the events of the android.net.metrics package.

Test: new unit tests, $ runtest frameworks-net passes
Bug: 34901696
Change-Id: I563a6a3183470bdfaabb7c781a1beaf6b1058bf0

Hugo Benichi   commited 2017-03-21 10:18:11 +09:00
45f6ef836d
Merge "ConnectivityMetricsEvent: add ifname, netid, transports"
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2017-03-16 02:50:23 +00:00
2dbe719d4f
ConnectivityMetricsEvent: add ifname, netid, transports
This patch adds new fields to ConnectivityMetricsEvent to make it more
symmetric to IpConnectivityEvent in ipconnectivity.proto.

Follow-up patches will start populating these fields for users of
IpConnectivityLog.

Test: unit tests updated, $ runtest frameworks-net passes
Bug: 34901696
Change-Id: I396767cdfcf38cce893c0d6e1f4524f12e3fdc64

Hugo Benichi   commited 2017-03-16 09:58:02 +09:00
cf17909273
Merge "Connectivity metrics: simplify ConnectivityMetricsEvent"
Hugo Benichi   authored and   Android (Google) Code Review   commited 2017-03-16 00:37:47 +00:00
ffafc778f7
Connectivity metrics: simplify ConnectivityMetricsEvent
Now that ConnectivityMetricsEvent is only used for core networking
metrics and is not @SystemApi anymore, remove unused fields and prepare
for additional new fields.

Test: updated unit tests, $ runtest frameworks-net passes
Bug: 34901696
Change-Id: I15abad19981d491f16f2a3afe401f1e833079907

Hugo Benichi   commited 2017-03-15 15:12:38 +09:00
4953ce3d15
Merge "IP connectivity metrics: add new APF counters."
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2017-03-15 04:24:30 +00:00
d393e0233d
IP connectivity metrics: add new APF counters.
This patch adds a few missing counters to APF events:
 - an actual lifetime duration to ApfProgramEvent.
 - counters for total number of updates to ApfStatistics.

ApfProgramEvents are now recorded at program removal in order to
populate the actual lifetime of the program. ApfProgramEvents whose
actual lifetime was less than 1 second are filtered out.

Finally, instance fields of ApfProgramEvent and ApfStats classes are
made mutable to allow for simple record-like creation. This was not
possible when these classes were tagged @SystemApi.

Test: - manually verified output of $ dumpsys connmetrics list
      - unit tests updated.
Bug: 34901696

Change-Id: I02694ebb9421ce1c2aa757fa6aa209d19a654dcd

Hugo Benichi   commited 2017-03-15 11:49:48 +09:00
c012c253c2
IP connectivity metrics: ConnectStats additions
This patch:
  - adds a counter to ConnectStats for counting the number of successful
    connect() calls done in blocking mode. This allows to compute error
    rates for connect() in blocking mode.
  - add printing of ConnectStats when dumping NetdEventListenerService
    and/or IpConnectivityMetrics service.

Test: $ runtest frameworks-net, + manual tests verifying logged events.
Bug: 34901696
Change-Id: I889e8ccd12681b0511be487e9d2ee44290a2d7d7

Hugo Benichi   commited 2017-03-13 09:25:15 +09:00
8f3131cbcd
IP connectivity metrics: update ipconnectivity.proto
This patch adds several new fields to ipconnectivity.proto for
improving APF metrics, connect metrics, and link_layer inference.

Test: build, flashed, ran $ adb shell dumpsys connmetrics list proto
      updated metrics unit tests depending on proto schema
Bug: 34901696
Change-Id: I6f68e16f583a6b407f33f8a500133e100f3453c7

Hugo Benichi   commited 2017-03-09 15:19:02 +09:00
2de8920989
Merge "request{LinkProperties,NetworkCapabilities} no longer needed" am: 67a9265809 am: 57c8c6b5f4
am: bb54baba04

Change-Id: Id2aa8aeff6d299edb85955c12ab0a04023458597

Erik Kline   authored and   android-build-merger   commited 2017-03-07 13:42:11 +00:00
2b1df53310
Merge "request{LinkProperties,NetworkCapabilities} no longer needed"
am: 67a9265809

Change-Id: I79b9323be242ed5d2bf83962f78c613a465a20b8

Erik Kline   authored and   android-build-merger   commited 2017-03-07 13:33:29 +00:00
57c8c6b5f4
request{LinkProperties,NetworkCapabilities} no longer needed
Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
    - manual USB tethering toggling between WiFi and mobile
Bug: 32163131
Change-Id: I57edf5114b6361f320577c7870e40f8b3cdf74ce

Erik Kline   commited 2017-03-07 17:18:06 +09:00
26af1d81b3
Merge "Always send all available state when calling onAvailable()." am: 8fdbb6d6e2 am: b90963fe4d
am: 3765538bab

Change-Id: Ic82e3cb92841ea99972faad6ae004d77c725831b

Erik Kline   authored and   android-build-merger   commited 2017-03-07 06:08:40 +00:00
0fd4b155a5
Merge "Always send all available state when calling onAvailable()."
am: 8fdbb6d6e2

Change-Id: I81e70fecf060a4103b51084a60a32c78f6219f6b

Erik Kline   authored and   android-build-merger   commited 2017-03-07 06:00:09 +00:00
b90963fe4d
Always send all available state when calling onAvailable().
The state that needs to be transferred includes:
    - NetworkCapabilities
    - LinkProperties
    - whether the network is currently suspended

Additionally:
    - Rename notifyNetworkCallback() to notifyNetworkAvailable()
      in order to clarify its real function.
    - fix previous copy/paste error in unittest

Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
    - USB tethering with mobile and Wi-Fi upstream toggling
Bug: 32163131
Change-Id: Ib4460bcd5d08863a9feac9e8ab41a238897bb3ea

Erik Kline   commited 2017-03-07 12:57:26 +09:00
99f301bdfd
Merge "Also test for additional NetworkCallback calls" am: dff6c5c30d am: 6978b2427c
am: 02310829cf

Change-Id: I0264a471312423e896a1c2f479c0eeda737a1567

Erik Kline   authored and   android-build-merger   commited 2017-03-01 11:13:14 +00:00
37bb686bb7
Merge "Also test for additional NetworkCallback calls"
am: dff6c5c30d

Change-Id: I00b3f7be06bde167872d0cdefe940cda5e138846

Erik Kline   authored and   android-build-merger   commited 2017-03-01 11:03:08 +00:00
6978b2427c
Also test for additional NetworkCallback calls
Specifcally:
    - onCapabilitiesChanged
    - onLinkPropertiesChanged
    - onNetworkSuspended

Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 32163131

Change-Id: Ie0f7c8ac21313b11980bb335c89ecde6fd8e311c

Erik Kline   commited 2017-03-01 18:24:36 +09:00
4f89af67b2
IP connectivity metrics: cleanup obsolete code
This patch cleans obsolete code related to IP connectivity metrics:
 - remove @SystemApi on android.net.metrics: now that metrics events
   are processed and serialized in the frameworks only, event classes
   should not appear in the system apis.
 - remove obsolete Logger classes: ConnectivityMetrics app was the
   unique user of ConnectivityMetricsLogger until nyc-mr1. From nyc-mr1
   the app started using dumpsys to get metrics for IpConnectivity and
   Telephony, which made ConnectivityMetricsLogger obsolete.
 - simplifications in MetricsTestUtil

Test: - runtest frameworks-net
      - manually verified $ adb shell dumpsys connmetrics
Bug: 30054585
Bug: 32648597
Change-Id: I85ef65f7f69eb9299e4636cc7af54067201d9daf

Hugo Benichi   commited 2017-02-22 12:56:38 +09:00
f3fe279f50
Add an API hint for metered multipath traffic.
This allows an application that knows how to provide seamless
network connectivity (e.g., using QUIC multipath) to find out if
doing so is desired.

Test: builds, boots, runtest frameworks-net passes.
Bug: 34630278
Change-Id: Ic7fd0b9e1cd879fdfaf84009d7125391895e9087

Lorenzo Colitti   commited 2017-02-01 17:02:29 +09:00
48a2a32bdd
ConnectivityServiceTest: remove remaining poll loops. am: aebc0598b9 am: 5f807b3b74 am: 87eab8e1c4
am: 4f71ef3f5d

Change-Id: Idc5d60f9ed5fbbb39256b9983a5b292a0302b2f1

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 03:18:46 +00:00
38aa28e2ad
Rename AvoidBadWifiTracker to MultinetworkPolicyTracker am: ee6c69ecc4 am: 49040a3d5a am: 5bbbf841eb
am: 016e4f3a23

Change-Id: I5aefc453c022286e6ee2332a53e6c9f36472e9a5

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 03:17:19 +00:00
2f8d8640f9
Attempt to make waitForIdleHandler reliable. am: 572f1a3185 am: b18bd6bd3d am: e160fe177d
am: 3c3eddc7ae

Change-Id: Ia2d7a4405ce60ca99b1ee6c80c0babf93983cf64

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 03:16:18 +00:00
b79102b25e
ConnectivityServiceTest: remove remaining poll loops. am: aebc0598b9 am: 5f807b3b74
am: 87eab8e1c4

Change-Id: I31681e1248721704a9b792962a2ef5955e375e93

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 03:01:52 +00:00
4f71ef3f5d
Remove assertEventuallyTrue as it's unnecessary. am: 4b07a883ca am: c939693265
am: c2279a09bf

Change-Id: Ib16f54aeaa783a6e26a9d80e61388cbd9ecd9bd3

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 03:00:41 +00:00
8183372be8
Rename AvoidBadWifiTracker to MultinetworkPolicyTracker am: ee6c69ecc4 am: 49040a3d5a
am: 5bbbf841eb

Change-Id: I91f1338f3488cfc60eef0c2147aa7b1d61107cdd

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 02:59:42 +00:00
016e4f3a23
Attempt to make waitForIdleHandler reliable. am: 572f1a3185 am: b18bd6bd3d
am: e160fe177d

Change-Id: I2369fbd693b467283232f47703fd471c8ff60c1f

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 02:58:24 +00:00
3c3eddc7ae
ConnectivityServiceTest: remove remaining poll loops.
am: aebc0598b9

Change-Id: I675096683c8ed4bc0e540491c0ff6aa828114313

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 02:39:30 +00:00
5f807b3b74
Remove assertEventuallyTrue as it's unnecessary.
am: 4b07a883ca

Change-Id: Id574b27b40e35fbccac49910867e9735c03118d4

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 02:38:30 +00:00
c939693265
Rename AvoidBadWifiTracker to MultinetworkPolicyTracker
am: ee6c69ecc4

Change-Id: I7615c9128deed7011eb9ab6f2efdcfe2e237a1a5

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 02:37:31 +00:00
49040a3d5a
Attempt to make waitForIdleHandler reliable.
am: 572f1a3185

Change-Id: Id7e23c3a2c885ff239efa577a8d366d3df6ca9a2

Lorenzo Colitti   authored and   android-build-merger   commited 2017-02-01 02:36:22 +00:00
b18bd6bd3d
ConnectivityServiceTest: remove remaining poll loops.
All the tests are now asynchronous. The only remaining uses of
Thread.sleep() are in the tests that check for NetworkRequest
timeouts.

Test: ConnectivityServiceTest passes 100 times in a row
Bug: 32561414
Change-Id: If420bd66c692a90d5031ee06a888a8cc3b4398a8

Lorenzo Colitti   commited 2017-01-31 15:44:23 +09:00
aebc0598b9
Remove assertEventuallyTrue as it's unnecessary.
The calls in testAvoidBadWifi are no longer necessary now that
waitForIdle is reliable, and the calls in testPacketKeepalives
are replaced with a wait for the NetworkAgent to disconnect.

Test: ConnectivityServiceTest passes 100 times in a row.
Bug: 32561414
Change-Id: Icbb161ca6e343bd14764a1c9ccfdd14b6cd6803f

Lorenzo Colitti   commited 2017-01-31 15:42:58 +09:00
4b07a883ca
Rename AvoidBadWifiTracker to MultinetworkPolicyTracker
Rename the class and ensure that all code related to bad wifi
avoidance has names that reflect its purpose.  This will allow us
to reuse most of the the code for other purposes in future CLs.

Test: runtest frameworks-net passes
Bug: 34630278
Change-Id: Ida190e5a79e7a12f4eec07e1a3e4d9d138e83bcd

Lorenzo Colitti   commited 2017-01-31 15:42:57 +09:00
ee6c69ecc4
Attempt to make waitForIdleHandler reliable.
The current implementation of IdleableHandlerThread is based on
the assumption that MessageQueue#isIdle will return true iff the
message loop has finished processing its messages.

Unfortunately, this is incorrect: isIdle returns true iff are no
more messages waiting in the queue; thus, it will also return
true while it is processing the last message before going idle.

Instead of using idle handlers, take the simpler approach of
posting a runnable to the message loop and waiting for it to
be processed.

Test: see other CLs in this patch series
Bug: 31479480
Change-Id: Iae75781f067b762c8653a488a5e4d5ee0c789e01

Lorenzo Colitti   commited 2017-01-31 15:42:17 +09:00
572f1a3185
Merge "ConnectivityServiceTest: fix flaky tests" am: ee4f8f30eb am: 96a8a237b0 am: 1adc6c2054
am: ad488d0158

Change-Id: I3a16ff459b8f702249f14e9becbb2630ce7471fd

Lorenzo Colitti   authored and   android-build-merger   commited 2017-01-27 10:04:15 +00:00
76b0452e73
Merge "ConnectivityServiceTest: remove flaky waitForIdle test." am: be80577f5b am: cdbf1e7545 am: 9d250413a0
am: 822ca7bd3e

Change-Id: Iebafbf438ee4efcd53b3e6d5c71b34c0ca4e2c6b

Lorenzo Colitti   authored and   android-build-merger   commited 2017-01-27 10:00:14 +00:00
495016e658
Merge "ConnectivityServiceTest: fix flaky tests" am: ee4f8f30eb am: 96a8a237b0
am: 1adc6c2054

Change-Id: Iaa1ab50a323133cadfa4f39440fce982cde8d1fe

Lorenzo Colitti   authored and   android-build-merger   commited 2017-01-27 10:00:06 +00:00
ad488d0158
Merge "ConnectivityServiceTest: remove flaky waitForIdle test." am: be80577f5b am: cdbf1e7545
am: 9d250413a0

Change-Id: I1d3707b4bc2ae00ca0fad1c3ec7e6ca859fcdd16

Lorenzo Colitti   authored and   android-build-merger   commited 2017-01-27 09:55:36 +00:00
822ca7bd3e
Merge "ConnectivityServiceTest: fix flaky tests"
am: ee4f8f30eb

Change-Id: I0577f6b48de8a95e7d12e58a672fb0374ced9403

Lorenzo Colitti   authored and   android-build-merger   commited 2017-01-27 09:51:32 +00:00
96a8a237b0
Merge "ConnectivityServiceTest: remove flaky waitForIdle test."
am: be80577f5b

Change-Id: I444746af6adc7be4a3f69243379f65aadf29ea19

Lorenzo Colitti   authored and   android-build-merger   commited 2017-01-27 09:47:05 +00:00
cdbf1e7545
Merge "ConnectivityServiceTest: fix flaky tests"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2017-01-27 09:40:47 +00:00
ee4f8f30eb
frameworks-test: adding missing @SmallTest
This activates all frameworks-test tests in runs of the continuous
platform tests.

Test: $ runtest frameworks-net passes (expect Tether
Bug: 32561414
(cherry picked from commit 3664598601)

Change-Id: I7b0706a7e3368f971d508388e8ad4afc5de9d646

Hugo Benichi   authored and   Lorenzo Colitti   commited 2017-01-26 18:52:45 +09:00
621d836cbb