Commit Graph

3837 Commits

Author SHA1 Message Date
Erik Kline
1794c97316 Merge "Support "dumpsys connectivity tethering"" am: df8b274a65 am: 06e6033327
am: ff8b93f815

Change-Id: I68ff0810e4109c52e1d594a4b75fc768570ef59d
2017-05-29 08:55:13 +00:00
Erik Kline
df8b274a65 Merge "Support "dumpsys connectivity tethering"" 2017-05-29 08:33:10 +00:00
Joel Scherpelz
0d727b6f6e Merge "Support requesting and receiving wakeup events" am: 10a2e83a7e am: 4971745cf4
am: 880974f111

Change-Id: I98aa768cf47938aa0996ddabbbc9feb9dae96f1e
2017-05-29 03:51:25 +00:00
Joel Scherpelz
10a2e83a7e Merge "Support requesting and receiving wakeup events" 2017-05-29 03:28:02 +00:00
Erik Kline
91b6cca3ff Support "dumpsys connectivity tethering"
Also print current upstream interface in tethering dump output.

Test: as follows
    - build
    - flashed
    - booted
    - runtest frameworks-net passes
    - "dumpsys connectivity tethering" shows just tethering info
Bug: 32163131
Bug: 36504926
Bug: 36988090
Bug: 38152109
Bug: 38186915
Bug: 38218697
Change-Id: I7f185fd71946a032e7f815207016294892df135d
2017-05-29 11:51:28 +09:00
Joel Scherpelz
a235a8199f Support requesting and receiving wakeup events
Test: as follows
    - built
    - flashed
    - booted
    - ConnectivityServiceTest passes
Bug: 28806131

Change-Id: Ifc45260d5315479393da2c859ba4afed4e0e8c85
2017-05-29 11:19:16 +09:00
Hugo Benichi
7cabb60411 Merge changes If4deb106,Ib25d7658 am: 0388f0e47b am: 41a57af66a
am: ae278410f5

Change-Id: I4fa34b647e7b2408d4493cfb148ae7d8c24bd6e8
2017-05-26 00:58:27 +00:00
Hugo Benichi
79614aee12 @Ignore ConnectivityServiceTest#testRequestBenchmark
Ignore the last remaining test in ConnectivityServiceTest with spurious
failures. testRequestBenchmark has some intrinsic chances of failure due
to the fact it attempts to assert elapsed time durations against a
reference target.

Bug: 32561414
Test: no functional change
Change-Id: Ib25d76581b47997b2ef84df3e6a9fd9224b85d92
2017-05-26 07:18:15 +09:00
Erik Kline
c3d0beaf2e Merge "Expand logging capabilities of Tethering subsystem" into oc-dev
am: fc6e6d1372  -s ours

Change-Id: I44c8ac70d0d3c53e52807697e62c40474d5fa356
2017-05-25 09:14:17 +00:00
Hugo Benichi
6cd853a362 Merge "NsdServiceInfo: move test to tests/net" am: 48859e01d5 am: 1b0f4bf606
am: e8c2700519

Change-Id: I44cae417fcddad72c13938b6fb751de6ed784046
2017-05-25 01:12:51 +00:00
Erik Kline
14ec7c7a2b Expand logging capabilities of Tethering subsystem
Introduce a SharedLog that can be shared among all Tethering
components.  All log entries go to the same log, and each includes
its subsystem name.  Additionally, all entries emitted to the
system log shared the same tag, so can easily be watched.

More subsystems can inherit a SharedLog, but to minimize cherry-pick
conflicts we limit ourselves to these changes only.

Test: as follows
    - built
    - flashed
    - booted
    - log output observed via dumpsys
    - runtest frameworks-net passes
Bug: 32163131
Bug: 36988090
Bug: 38218697
Merged-In: Ia9d15f0dcc49ce070f8684eb8c8481310859faa5
Merged-In: I2644f518304a03da469fb9c2aa01a6d8f1a97901
Change-Id: I1229d4c55987402d84b0d4a2c8a595e0c829aa3e
(cherry picked from commit 7747fd4ce055e8e1f6381062a58b867728f57d85)
2017-05-24 19:52:51 +09:00
Hugo Benichi
f0fdd9a831 Merge "Move NsdServiceTest to correct directory" am: 6a5c978605 am: ca9fcb79f6
am: ecf4267889

Change-Id: Ib4e100fc8219b58ab7850407735a444dad3ec153
2017-05-24 07:15:09 +00:00
Hugo Benichi
f56aa32b2b NsdServiceInfo: move test to tests/net
This patch also
  - adds a license plate to NsdServiceInfoTest
  - fixes some formatting and style issues
      package name
      uses of canonical junit asserts
  - update NsdServiceInfoTest to not use the deprecated AndroidTestCase

Bug: 62044295
Bug: 32561414
Test: $ runtest frameworks-net passes
Change-Id: Ie5ebb00172aef4eec19e6ecd2b41c4467901b93d
2017-05-24 16:03:43 +09:00
Treehugger Robot
6a5c978605 Merge "Move NsdServiceTest to correct directory" 2017-05-24 06:47:30 +00:00
Hugo Benichi
168489b45d Move NsdServiceTest to correct directory
Test: no functional change
Bug: 62044295
Change-Id: Iad3af646e8d252f84978d1a367878a78c2869982
2017-05-24 14:18:48 +09:00
Hugo Benichi
15dcccb4a1 Merge "Fix NetworkStatsObserversTest" am: bec71d8f9b am: 25282c3e38
am: 814351c843

Change-Id: Ice4bb8de4267cba7a15a60838e165fab5ebade72
2017-05-23 14:18:30 +00:00
Hugo Benichi
bec71d8f9b Merge "Fix NetworkStatsObserversTest" 2017-05-23 11:29:48 +00:00
Hugo Benichi
ce5380e12c Merge "Fix NetworkStatsAccessTest" am: d8d4bcd3bc am: cdb75d321b
am: 85afabc4ec

Change-Id: I60f9d8867655a6aa24ee192c772d4c26a96c9bcd
2017-05-23 07:02:54 +00:00
Hugo Benichi
d8d4bcd3bc Merge "Fix NetworkStatsAccessTest" 2017-05-23 06:43:07 +00:00
Hugo Benichi
0b379f7f69 Merge "ConnectivityManager: simplify callback handler" am: 5e6af581e4 am: 7bce658dd6
am: a67fb638fa

Change-Id: I3934666df4a02101351993f7f83fb0a42124a2f5
2017-05-23 06:37:24 +00:00
Treehugger Robot
5e6af581e4 Merge "ConnectivityManager: simplify callback handler" 2017-05-23 06:16:49 +00:00
Hugo Benichi
2d2b500068 Merge "ConnectivityServiceTest: fix flakyness" am: 8222ec90c6 am: 004f36d5bc
am: eb9d0f16aa

Change-Id: Ic792060aafb5aa8b485054be18c3dba82bb15a3b
2017-05-23 04:56:41 +00:00
Hugo Benichi
8222ec90c6 Merge "ConnectivityServiceTest: fix flakyness" 2017-05-23 04:35:11 +00:00
Hugo Benichi
ea0c83ccb7 Merge "ConnectivityManager: improve argument validation" am: 3ca6c89b37 am: 0187514f74
am: b800e8520e

Change-Id: Idfc0938025c633c89f5bfddd88b3721876d085ef
2017-05-23 03:41:52 +00:00
Treehugger Robot
3ca6c89b37 Merge "ConnectivityManager: improve argument validation" 2017-05-23 03:14:29 +00:00
Hugo Benichi
b6c2406c4c ConnectivityManager: simplify callback handler
Bug: 36701874
Test: $ runtest frameworks-net
Change-Id: I4d5f08903a54f8dced7cb6ae86703847b908b784
2017-05-23 10:39:46 +09:00
Hugo Benichi
bc1104b465 ConnectivityManager: improve argument validation
Using Preconditions and dedicated static methods for checking arguments
to improve error stack traces without error messages.

Test: covered by previously added unit test
Bug: 36701874
Change-Id: Id872b2c887a4bca43a8c3644622add1c2ee57c6d
2017-05-23 10:39:45 +09:00
Hugo Benichi
a2a3380def Fix NetworkStatsObserversTest
This patch fixes several spurious unit tests in
NetworkStatsObserversTest by using the updated waitForIdleHandler of
ConnectivityServiceTest. More specifically this fixes the following
tests:
  - testUnregister_knownRequest_releasesCaller
  - testUpdateStats_deviceAccess_notifies
  - testUpdateStats_userAccess_usageSameUser_notifies
  - testUpdateStats_defaultAccess_notifiesSameUid

This patch also removes the dummy message with type -1 sent at the end
of tests in NetworkStatsObserversTest and the associated assert, because
nothing is exercised or asserted immediately after.

This patch also updates NetworkStatsObserversTest to not depend on the
deprecated junit.framework.TestCase.

Bug: 32561414
Test: runtest -x frameworks/base/tests/../NetworkStatsObserversTest.java
Change-Id: I4fc909ee9bacc964c859fa7a3db34f9dc86b89cf
2017-05-23 10:18:41 +09:00
Hugo Benichi
de08c23dc9 Fix NetworkStatsAccessTest
This patch fixes NetworkStatsAccessTest by taking into account
DEVICESUMMARY which was added in commit
3a8b343ce5220086c4f71e63f5d42f2d28434c4b.

Doing $ git revert 3a8b343ce5220086c4f71e63f5d42f2d28434c4b shows that
the existing assertions of NetworkStatsAccessTest passed before that
commit.

This patch also changes NetworkStatsAccessTest to use up-to-date testing
style and not depend on the deprecated junit.framework.TestCase.

Bug: 32561414
Test: runtest -x frameworks/base/../NetworkStatsAccessTest.java
Change-Id: Ib78f137578cf35e1c766b377b7f812a09173c49e
2017-05-23 10:18:41 +09:00
Hugo Benichi
ea4148caa3 ConnectivityServiceTest: fix flakyness
This patch attempts to fix the remaining spurious failures in
ConnectivityServiceTest, which have two causes:
 - waitForIdle() does not take into account the NetworkAgents handlers.
 - the deadlines in testRequestBenchmark are sometimes exceeded.

To fix the first issue, waitForIdle() is moved to a test level instance
method and also calls waitForIdleHandler on any non null
MockNetworkAgent. This is expected to fix spurious errors for the
following tests:
  - testMobildeDataAlwaysOn
  - testLingering
  - testPacketKeepAlive
  - testMMSonWiFi

To fix the second issue, the deadlines for testRequestBenchmark are
extended by 10ms. Also, the failure message is made more actionable by
providing the total time it took for the operation, instead of printing
the number of dispatches that were achieved before the deadline.

Bug: 32561414
Test: tests pass many times in a row (~500).
Change-Id: Id33c6ac1edfb0b89634fa7789dccb2da237e2709
2017-05-23 10:18:41 +09:00
Hugo Benichi
85c5572cc2 Merge "Address ConnectivityManager API comments." am: 37c09c96b9 am: b57db6ef97
am: 08ab9ea526

Change-Id: I8e5e44043bb7efde3e21650e7edf3f121aff1e6e
2017-05-19 23:36:09 +00:00
Hugo Benichi
37c09c96b9 Merge "Address ConnectivityManager API comments." 2017-05-19 23:05:57 +00:00
Hugo Benichi
b1dfaef01b Merge "Add a method to start the captive portal login app." am: a4876e64b8 am: f238a96172
am: 6246ddc338

Change-Id: I0f5d39394d35d2977c81b704ded1d1119bcf47a7
2017-05-19 02:56:58 +00:00
Lorenzo Colitti
4f58f0cde4 Merge "Add test coverage for explicitlySelected networks." am: f6db1c5889 am: 3d55c5539c
am: b7535c86a0

Change-Id: I4caf9f55edeb51365293558db9d7d028b61c501c
2017-05-19 02:34:58 +00:00
Hugo Benichi
a4876e64b8 Merge "Add a method to start the captive portal login app." 2017-05-19 02:29:21 +00:00
Lorenzo Colitti
f6db1c5889 Merge "Add test coverage for explicitlySelected networks." 2017-05-19 02:05:55 +00:00
Lorenzo Colitti
de1e515306 Add a method to start the captive portal login app.
Bug: 36203355
Bug: 36656914
Test: ConnectivityServiceTest (including new test) passes
Change-Id: Ide82858af67024623560ab79beea27c201b63447
Merged-In: I82a9a9a8da47870ba3f1bbef5941b37e970c844f

(cherry picked from commit 500dbae1b5)
2017-05-19 00:58:41 +00:00
Erik Kline
4d8918ea55 Merge "Expand logging capabilities of Tethering subsystem" am: 29f9f2d546 am: 96f9371a66
am: 945ff184c2

Change-Id: Ia9d15f0dcc49ce070f8684eb8c8481310859faa5
2017-05-18 03:54:30 +00:00
Hugo Benichi
e229dc8bca Merge "Fix NetworkNotificationManagerTest" am: c13a80deee am: 13f0d10115
am: 31c566037b

Change-Id: Ib880777290f74eaa565839632eb7518642fcc4f3
2017-05-18 03:44:20 +00:00
Treehugger Robot
29f9f2d546 Merge "Expand logging capabilities of Tethering subsystem" 2017-05-18 03:25:30 +00:00
Hugo Benichi
304db7129a Merge "Move NetworkNotificationManagerTest to tests/net" am: d44389ec64 am: 9fdc903af7
am: 777bf77c2c  -s ours

Change-Id: I0f63e4f29228a404ec0dac3571b2474806e4c8d6
2017-05-18 02:40:26 +00:00
Hugo Benichi
343091956d 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.

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

(cherry picked from commit 9eec272054)
2017-05-18 11:08:31 +09:00
Hugo Benichi
d44389ec64 Merge "Move NetworkNotificationManagerTest to tests/net" 2017-05-18 02:01:40 +00:00
Hugo Benichi
67615a5906 Merge "Finish moving NetworkStats tests to tests/net" am: e1a0562a3f am: cd821b231a
am: 544bcbe78e

Change-Id: I5d9a01a5804a7cc6289253db09078ede00fc0dc5
2017-05-18 00:48:14 +00:00
Erik Kline
d364a24856 Expand logging capabilities of Tethering subsystem
Introduce a SharedLog that can be shared among all Tethering
components.  All log entries go to the same log, and each includes
its subsystem name.  Additionally, all entries emitted to the
system log shared the same tag, so can easily be watched.

More subsystems can inherit a SharedLog, but to minimize cherry-pick
conflicts we limit ourselves to these changes only.

Test: as follows
    - built
    - flashed
    - booted
    - log output observed via dumpsys
    - runtest frameworks-net passes
Bug: 32163131
Bug: 36988090
Bug: 38218697
Change-Id: I1229d4c55987402d84b0d4a2c8a595e0c829aa3e
2017-05-18 09:46:45 +09:00
Hugo Benichi
e1a0562a3f Merge "Finish moving NetworkStats tests to tests/net" 2017-05-18 00:09:54 +00:00
Erik Kline
06310ff3c6 Merge "Add tethering offload HAL call via JNI" am: 043ad49e0f am: f421d60824
am: c967d56ad7  -s ours

Change-Id: Ic1c1ab0a51459e390e8607217be8f0c6ef0c2bde
2017-05-17 17:37:25 +00:00
Lorenzo Colitti
0bd6e3b946 Add test coverage for explicitlySelected networks.
Also, make all tests start with mobile data always on disabled.

This is because some tests only pass when mobile data always on
is disabled. This doesn't cause any problems when running all
the tests in the file, because these tests are always run after
one or more calls to tearDown, which disables mobile data always
on. However, it does cause issues when those tests are run alone.

Test: new test passes 50 times in a row
Test: ConnectivityServiceTest passes
Change-Id: I1eef5d7f5ec5464e0f9a1d7f1130d9ba6dea4557
2017-05-18 00:46:14 +09:00
Hugo Benichi
e9a6b0e100 Move NetworkNotificationManagerTest to tests/net
Bug: 32561414
Test: no functional change
Change-Id: Iad17e3336a4a589da5cf88fd6359323e34b747e1
2017-05-17 22:24:05 +09:00
Hugo Benichi
b9693f313b Finish moving NetworkStats tests to tests/net
Follow-up of commit 4ff3a778ab.

Also add @SmallTest annotation to classes moved to tests/net.

Test: no functional change
Bug: 32561414
Change-Id: I0a0e8865d37ba7bae06ce352d3fc385989adc300
2017-05-17 22:24:05 +09:00