Commit graph android_packages_modules_Co.../tests/net
Message SHA1
Merge "Support adding NATT keepalive packet filter"
Mark Chien   authored and   Gerrit Code Review   commited 2019-04-29 15:59:16 +00:00
5f62c44ea9
Merge "Add Network, NetworkCapabilities, StaticIpConfiguration common test cases"
am: 134737f3d6

Change-Id: Id469ce450ac84d967ee19ecad44dae6905187a59

Paul Hu   authored and   android-build-merger   commited 2019-04-29 08:50:18 -07:00
07672bb03e
Merge "Add Network, NetworkCapabilities, StaticIpConfiguration common test cases"
Paul Hu   authored and   Gerrit Code Review   commited 2019-04-29 15:38:48 +00:00
134737f3d6
Support adding NATT keepalive packet filter
Support adding NATT keepalive packet filter to APF
filter.
Generating APF program will be addressed in another CL.

Bug: 33530442
Test: - atest NetworkStackTests
      - atest FrameworksNetTests

Change-Id: I4961d5da343d8700600269632787c28112f0f9f1

Aaron Huang   authored and   markchien   commited 2019-04-29 19:33:45 +08:00
87cd8a7e34
Add Network, NetworkCapabilities, StaticIpConfiguration common test cases
Bug: 129200415
Bug: 129200142
Bug: 129200418
Test: atest FrameworksNetTests
Test: atest CtsNetTestCases: added tests pass
Change-Id: I568d516e1ffc9e32061ca6860224c102bdfd7445

paulhu   commited 2019-04-29 18:13:00 +08:00
ffaf7c4484
Add tests for DhcpErrorEvent
The tests are run both in unit and CTS tests.
Test: atest FrameworksNetTests NetworkStackTestCases
Bug: 129200175

Change-Id: I78d78dd421cc3ffea774ff5eaa6aa758debc9cf2
Merged-In: I9b65a2eef94567d2b79a9955619938e64906080d
Merged-In: I78d78dd421cc3ffea774ff5eaa6aa758debc9cf2
(cherry picked from commit 9e046d509a37c6f37b4757f1681846cee60cfd5c)

Paul Hu   commited 2019-04-29 01:49:17 +00:00
11029a0eb9
Merge "Move more network unit tests to common tests" into qt-dev
Paul Hu   authored and   Android (Google) Code Review   commited 2019-04-29 01:36:42 +00:00
254c92d0f7
Make DNS cache lifecycle management explicit
1. ConnectivityService calls netd binder to create/destroy network directly.
2. Call dnsresolver binder to create/destroy cache after create/destroy network.
3. Remove unused network create/destroy methods in NetworkManagementService.

Bug: 129453995
Test: atest FrameworksNetTests

Merged-In: I388e208143c38b89bcbb0589de393250024d59aa
(cherry picked from commit 204ca13e63f063f044ac4ad3b96f08b473fe59df)

Change-Id: I4d3dfd9305b60a724aa2dc38448948d8e710c932

Lorenzo Colitti   authored and   Luke Huang   commited 2019-04-26 02:13:59 +00:00
2457e268f6
Merge "Make DNS cache lifecycle management explicit" am: 8970adbc8c
am: af5b4ab4b1

Change-Id: I51cf1b7cfd49d4731d922578e8512a1326ebec63

Lorenzo Colitti   authored and   android-build-merger   commited 2019-04-25 17:50:05 -07:00
8df0f85e86
Merge "Make DNS cache lifecycle management explicit"
am: 8970adbc8c

Change-Id: Ie97fe453c89476915f3b362b6486c7d4608da2a9

Lorenzo Colitti   authored and   android-build-merger   commited 2019-04-25 17:38:23 -07:00
af5b4ab4b1
Merge "Make DNS cache lifecycle management explicit"
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2019-04-26 00:23:22 +00:00
8970adbc8c
Move more network unit tests to common tests
This adds the moved tests to CTS as well.
The moved unit tests are appropriate for CTS as they test data holder
classes that need to function properly for apps to work.

Test: atest FrameworksNetTests
Test: atest CtsNetTestCases: added tests pass
Bug: 129199900

Change-Id: I895d2b57da658d5bed28ebe128611d5d15835742
Merged-In: I9f708a252ab606b782f5f828dce8c1690c3703bf
Merged-In: I895d2b57da658d5bed28ebe128611d5d15835742
(cherry picked from commit cc21fbd483138771dae04f4d86ab411e2e88e575)

Paul Hu   authored and   paulhu   commited 2019-04-25 23:16:13 +08:00
3bfccf31ed
Merge changes from topic "niap-vpn" into qt-dev
* changes:
  Reinstate new VPN uid filtering unit tests
  Revert new tests and PackageManager mock
  Block incoming non-VPN packets to apps under fully-routed VPN

Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2019-04-25 04:23:01 +00:00
5fd9ef13f2
Reinstate new VPN uid filtering unit tests
Mock out PackageManager and returns correct information corresponding
to the test app package itself.

Test: atest --generate-new-metrics 10 com.android.server.ConnectivityServiceTest
Bug: 114231106
Bug: 130397860

Merged-In: Ic2faef44831575b2d03bc00ef2553d5c549adc95
Change-Id: Ic2faef44831575b2d03bc00ef2553d5c549adc95
(cherry picked from commit 4469b1d8a543613d91a58a88488fd2022a0696b9)

Rubin Xu   commited 2019-04-24 14:10:21 +00:00
65e2962333
Merge "Backwards-incompatible resolv module API change for making setResolverConfiguration take a parcelable." into qt-dev
Wayne Ma   authored and   Android (Google) Code Review   commited 2019-04-24 13:05:59 +00:00
e1754842b8
Revert new tests and PackageManager mock
A mocked PackageManager caused test failures in existing tests.
Revert that for now to make tests pass again.

Bug: 114231106
Bug: 130397860
Test: atest FrameworksNetTests

Merged-In: Ib59e211d4329f885108de9ea0a74669ffb144e17
(cherry picked from commit c18f4b5f6f)

Change-Id: I603a0b0dfb67a942679a668c182aa650774c80b2

Lorenzo Colitti   authored and   Rubin Xu   commited 2019-04-24 13:55:48 +01:00
0ecd05e7c6
Block incoming non-VPN packets to apps under fully-routed VPN
When a fully-routed VPN is running, we want to prevent normal apps
under the VPN from receiving packets originating from any local non-VPN
interfaces. This is achieved by using eBPF to create a per-UID input
interface whitelist and populate the whitelist such that all
non-bypassable apps under a VPN can only receive packets from the VPN's
TUN interface (and loopback implicitly)

This is the framework part of the change that build the whitelist.
The whitelist needs to be updated in the following cases:
* When a VPN is connected and disconnected
    This will cover the change to allowBypass bit, since that can't be
    changed without reconnecting.
* When a VPN's NetworkCapabilites is changed (whitelist/blacklist app changes)
* When a new app is installed
* When an existing app is removed
* When a VPN becomes fully-routed or is no longer fully-routed

New user/profile creation will automatically result in a whitelist app change
transition so it doesn't need to be handled specially here.

Due to the limitation of the kernel IPSec interacting with eBPF (sk_buf->ifindex
does not point to the virtual tunnel interface for kernel IPSec), the whitelist
will only apply to app VPNs but not legacy VPN connections, to prevent breaking
connectivity with kernel IPSec entirely.

Test: atest PermissionMonitorTest
Test: atest android.net.RouteInfoTest
Test: atest com.android.server.ConnectivityServiceTest
Test: atest HostsideVpnTests
Bug: 114231106

Merged-In: I5af81bc80dadd086261ba4b1eb706cc873bb7cfa
Change-Id: I5af81bc80dadd086261ba4b1eb706cc873bb7cfa
(cherry picked from commit c81642f1a1)

Rubin Xu   commited 2019-04-24 11:56:46 +01:00
4158c568b8
Merge "Reinstate new VPN uid filtering unit tests" am: 5dd56f3e47
am: 5df955cc01

Change-Id: Ic2faef44831575b2d03bc00ef2553d5c549adc95

Rubin Xu   authored and   android-build-merger   commited 2019-04-24 03:05:12 -07:00
07ad31c3ec
Merge "Reinstate new VPN uid filtering unit tests"
am: 5dd56f3e47

Change-Id: Ib76c2cf319377141a374b3bdcf5e6606aaf9c06b

Rubin Xu   authored and   android-build-merger   commited 2019-04-24 02:53:44 -07:00
5df955cc01
Reinstate new VPN uid filtering unit tests
Mock out PackageManager and returns correct information corresponding
to the test app package itself.

Test: atest --generate-new-metrics 10 com.android.server.ConnectivityServiceTest
Bug: 114231106
Bug: 130397860
Change-Id: Ib921700eda417f411d7a2c77c1140fba9ab50bbb

Rubin Xu   commited 2019-04-23 18:04:14 +01:00
ad26ff3fa1
Merge "Add tests for DhcpErrorEvent" am: 7e025f750a
am: a5f171ca27

Change-Id: I9b65a2eef94567d2b79a9955619938e64906080d

Paul Hu   authored and   android-build-merger   commited 2019-04-23 09:50:28 -07:00
b547b7b4df
Merge "Add tests for DhcpErrorEvent"
am: 7e025f750a

Change-Id: I7e6271e9becc974ea38d405914a87859ab700877

Paul Hu   authored and   android-build-merger   commited 2019-04-23 09:12:25 -07:00
a5f171ca27
Merge "Add tests for DhcpErrorEvent"
Paul Hu   authored and   Gerrit Code Review   commited 2019-04-23 11:31:03 +00:00
7e025f750a
Merge "[KA11] Verify fd ownership and allocate resource for NattKeepalive" am: 123eb11c48
am: c47cd94455

Change-Id: I410acc19ceb13e32c65cbdf3095da9db0802470c

Junyu Lai   authored and   android-build-merger   commited 2019-04-23 01:18:54 -07:00
74da4671c4
Merge "[KA11] Verify fd ownership and allocate resource for NattKeepalive"
am: 123eb11c48

Change-Id: I2f5e0e11494866b054668c9224a8732cd8c035f9

Junyu Lai   authored and   android-build-merger   commited 2019-04-23 01:08:39 -07:00
c47cd94455
Merge "Fix an argument to the legacy broadcast" into qt-dev
Chalard Jean   authored and   Android (Google) Code Review   commited 2019-04-23 07:04:26 +00:00
587d6cb141
[KA11] Verify fd ownership and allocate resource for NattKeepalive
Since socket keepalive APIs for UDP encapsulation sockets are
public to generic app. In order to ensure the given fd is valid,
this change verifies the resource id inside the UDP
encapsulation socket by using methods provided by IpSecService.

Bug: 125517194
Fix: 123968920
Test: 1. atest FrameworksNetTests --generate-new-metrics 10
      2. atestcom.android.server.ConnectivityServiceTest \
         #testNattSocketKeepalives --generate-new-metrics 100
Change-Id: I408aacc19b364683854d15a095c34e72389a6e5b

junyulai   commited 2019-04-23 10:47:19 +08:00
8368fe9fe0
Fix an argument to the legacy broadcast
Test: new test for this
Fixes: 62650382
Change-Id: I918b8271d3c3c058553ca888cb54cd36a6efba66
Merged-In: I0fc408d546ae9d72b7dd9415e502252b484d4329
Merged-In: I9282930106d1eee3274d9e5c4e89de60e929a0e6

Chalard Jean   commited 2019-04-23 02:36:32 +00:00
55cd1a323e
Merge "Fix an argument to the legacy broadcast" am: 5036127856
am: 182fe69f50

Change-Id: I0fc408d546ae9d72b7dd9415e502252b484d4329

Chalard Jean   authored and   android-build-merger   commited 2019-04-22 18:12:27 -07:00
fe8c062223
Merge "Fix an argument to the legacy broadcast"
am: 5036127856

Change-Id: I76149167598a862a2cc519fbf0b08df0887b27f0

Chalard Jean   authored and   android-build-merger   commited 2019-04-22 18:00:01 -07:00
182fe69f50
Merge "Fix an argument to the legacy broadcast"
Chalard Jean   authored and   Gerrit Code Review   commited 2019-04-23 00:38:10 +00:00
5036127856
Merge "Add NATT keepalive resources and methods into IpSecService" am: 4d31a792fa
am: 535187424f

Change-Id: I3affb5bdbb0c3f980b6606d728668e74c31646d0

Benedict Wong   authored and   android-build-merger   commited 2019-04-22 13:44:20 -07:00
37c1d5c0d8
Merge "Add NATT keepalive resources and methods into IpSecService"
am: 4d31a792fa

Change-Id: I97e7451959d619f42d68a5c29cca410bf0740852

Benedict Wong   authored and   android-build-merger   commited 2019-04-22 13:31:52 -07:00
535187424f
Merge "Add smoke test for jni library" into qt-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2019-04-22 20:14:31 +00:00
30096e070d
Merge "Add NATT keepalive resources and methods into IpSecService"
Benedict Wong   authored and   Gerrit Code Review   commited 2019-04-22 20:03:54 +00:00
4d31a792fa
Add tests for DhcpErrorEvent
The tests are run both in unit and CTS tests.
Test: atest FrameworksNetTests NetworkStackTestCases
Bug: 129200175

Change-Id: I52976bbbaca26fb317836e8461e372c25df02a22

Remi NGUYEN VAN   authored and   paulhu   commited 2019-04-23 00:19:06 +08:00
fb574ef02d
Merge "Move more network unit tests to common tests" am: 77492e48c4
am: 8347b1da4b

Change-Id: I9f708a252ab606b782f5f828dce8c1690c3703bf

Paul Hu   authored and   android-build-merger   commited 2019-04-22 07:30:55 -07:00
42272ed304
Merge "Move more network unit tests to common tests"
am: 77492e48c4

Change-Id: Id130368cd87ed262ef8eb926adf7b80fc3d7c2e3

Paul Hu   authored and   android-build-merger   commited 2019-04-22 07:20:08 -07:00
8347b1da4b
Merge "Move more network unit tests to common tests"
Paul Hu   authored and   Gerrit Code Review   commited 2019-04-22 13:59:25 +00:00
77492e48c4
Fix an argument to the legacy broadcast
Test: new test for this
Fixes: 62650382
Change-Id: I918b8271d3c3c058553ca888cb54cd36a6efba66

Chalard Jean   commited 2019-04-22 22:26:16 +09:00
24a433a538
Make DNS cache lifecycle management explicit
1. ConnectivityService calls netd binder to create/destroy network directly.
2. Call dnsresolver binder to create/destroy cache after create/destroy network.
3. Remove unused network create/destroy methods in NetworkManagementService.

Bug: 129453995
Test: atest FrameworksNetTests
Change-Id: I15660d27f735e33d621d4af8972cdf115bf76dfa

Luke Huang   commited 2019-04-22 17:43:37 +08:00
135c5261ec
Make LegacyTypeTracker testable
...and add basic trivial tests for it.

Test: this, and ConnectivityServiceTest
Bug: 62650382
Change-Id: Ie7ca938e6f66f1b15feb6ed93afa0aebb20884ae

Chalard Jean   commited 2019-04-22 15:44:23 +09:00
865ec929f9
Merge changes Id598ae1d,I475bd011
am: eefe399495

Change-Id: Ic02f8d900b6b430dc1a8bbfdc03297ad52157390

Chalard Jean   authored and   android-build-merger   commited 2019-04-21 19:29:00 -07:00
70d1b3b3fb
Merge changes Id598ae1d,I475bd011
* changes:
  Fix a possible crash when the listener is null
  Straighten AIDL interface for the memory store

Chalard Jean   authored and   Gerrit Code Review   commited 2019-04-22 02:15:04 +00:00
eefe399495
Straighten AIDL interface for the memory store
Some names were still wrong somehow, and the wrappers were
missing.

Test: NetworkStack & FrameworkNetTests
Change-Id: I475bd011ad9bc714a07021a9dfd85c4876f8e9ad
Merged-In: I475bd011ad9bc714a07021a9dfd85c4876f8e9ad

Chalard Jean   commited 2019-04-22 00:40:28 +00:00
2b73c58736
Merge "Make LegacyTypeTracker testable" am: 54cedaca89
am: 8bacdf6e64

Change-Id: I53457ad6af430c551c6909a7e68127a3667efde9

Chalard Jean   authored and   android-build-merger   commited 2019-04-21 17:25:03 -07:00
bc6e9e7478
Merge "Make LegacyTypeTracker testable"
am: 54cedaca89

Change-Id: I7dd63d9676862d3416ff75b43f2f8bdbce07134a

Chalard Jean   authored and   android-build-merger   commited 2019-04-21 17:13:47 -07:00
8bacdf6e64
Add NATT keepalive resources and methods into IpSecService
This change adds a new NATTKeepalive resource type, along with the
associated allocation/deallocation. Additionally, this change allows
ReferenceCountedResource(s) to not be binder-linked, to allow the
ConnectivityService to verify ownership and allocate a NattKeepalive
without double-registering for binder-death notifications.

Bug: 125517194
Test: IpSecService frameworks tests ran
Change-Id: I8293f79940ad57dabb6f2b9de5e334d06b869443

Benedict Wong   commited 2019-04-19 11:17:21 -07:00
cece56e3ce
Make LegacyTypeTracker testable
...and add basic trivial tests for it.

Test: this, and ConnectivityServiceTest
Bug: 62650382
Change-Id: Ie7ca938e6f66f1b15feb6ed93afa0aebb20884ae

Chalard Jean   commited 2019-04-19 15:33:44 +09:00
8cc4e876cd
Backwards-incompatible resolv module API change for making setResolverConfiguration take a parcelable.
Test: built, flashed, booted
      atest FrameworksNetTests

Bug: 130788363
Change-Id: I3b4e8672f5273c3baa9378025bfaef2e6514df64
Merged-In: I6dc9029af0df0d3b391210bd315516bdf1b5e4c9
(cherry picked from commit 1ada8cb328)

Wayne Ma   commited 2019-04-18 11:06:51 +00:00
9ba0569882