Commit graph

51,764 commits

Message SHA1
Filter out excluded routes in LinkProperties
Gate presence of excluded routes in LinkProperties on target sdk T.

Bug: 186082280
Test: atest LinkPropertiesTest
Change-Id: If8fdb468a0a4968c5f2a878b7aacfeb4f7d9a9e5

Taras Antoshchuk   commited 2022-04-13 01:17:56 +02:00
30d41e59bc
Merge changes Id92a2338,I38671aa2,Ic2df53f1
* changes:
  Add support for creating multiple ifaces with RA responders
  Reorder EthernetManagerTest
  Clean up permission usage in EthernetManagerTest

Patrick Rohr   authored and   Gerrit Code Review   commited 2022-04-12 12:34:49 +00:00
bebd8b0b54
Add support for creating multiple ifaces with RA responders
The RA responder is needed in order to properly provision interfaces in
the ethernet tests. This CL wraps the tap interface creation and
destruction inside a small helper class.

Test: atest CtsNetTestCases:EthernetManagerTest
Change-Id: Id92a233873f2f8a738ca563f507a2ead4478aebc

Patrick Rohr   commited 2022-04-12 12:14:10 +02:00
dcfe1937d9
Merge "Use TelephonyManagerShim factory method"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-04-12 07:42:21 +00:00
9076b0d6a4
Merge "Remove NativeDaemonConnector relevant files"
Paul Hu   authored and   Gerrit Code Review   commited 2022-04-12 07:37:16 +00:00
631c2387a6
Remove NativeDaemonConnector relevant files
NsdService is using binder call to communicate with
mdnsresponder, so there is no one to use NativeDaemonConnector
now. Thus, remove NativeDaemonConnector relevant files.

Bug: 209894875
Test: atest FrameworksNetTests
Change-Id: Ic70d9417dc85c04c537e09d8f8586a762ac9a97b

paulhu   authored and   Paul Hu   commited 2022-04-12 07:35:31 +00:00
cee953bd09
Merge "Fix teardown crash when kernel version < 5.4"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-04-12 03:43:21 +00:00
03c8a7a6a1
Add a test for startProvisionedVpnProfileSession()
startProvisionedVpnProfileWithSessionKey() is a new API which is
added in Android T, add a test for it.

Bug: 191413541
Test: atest CtsNetTestCases:Ikev2VpnTest
Change-Id: Iab49d3df2f36eb8f1d9d71473be559721d3d6536

lucaslin   authored and   Lucas Lin   commited 2022-04-12 02:48:00 +00:00
b11c913109
Fix teardown crash when kernel version < 5.4
Fix: 228821216
Test: atest android.net.cts.DscpPolicyTest
Change-Id: I341a5d7399c317dab975580b074a232976f581f2

Hongguang   authored and   Hongguang Chen   commited 2022-04-12 00:10:32 +00:00
60abccce25
Merge changes I2c3242f8,Iaa67d5ae
* changes:
  Remove unused TcUtils{, Test}, bpfhelper from libclat
  ClatCoordinator: use Java class TcUtils to detach program

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-04-11 20:47:50 +00:00
b3bf5fedab
Merge "ClatCoordinator: use Java class TcUtils to attach program"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-04-11 20:47:26 +00:00
932459748a
Merge changes from topic "access_clat_bpf_map_from_clatcoordinator"
* changes:
  ClatCoordinator: use Java class BpfMap to remove clat rule
  ClatCoordinator: use Java class BpfMap to add clat rule

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-04-11 20:46:59 +00:00
7b75c07cda
Merge "clatd bpf - add try_make_readable() of the ethernet/ip header"
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-04-11 17:43:08 +00:00
632e90b386
Merge "Remove InterruptedException from NsdService#create"
Paul Hu   authored and   Gerrit Code Review   commited 2022-04-11 09:49:09 +00:00
65a00a1fa5
Remove InterruptedException from NsdService#create
- NsdService isn't using NativeDaemonConnector to connect to
  mdnsresponder after aosp/2049246, so NsdService#create
  won't throw InterruptedException.
- Also no need to catch InterruptedException in
  ConnectivityServiceInitializer.

Bug: 209894875
Test: atest FrameworksNetTests CtsNetTestCases
Merged-In: I1d0b973f9dac0f1d4f9d4d03faef66f05edde3fc
Change-Id: I1d0b973f9dac0f1d4f9d4d03faef66f05edde3fc

paulhu   authored and   Paul Hu   commited 2022-04-11 07:58:06 +00:00
1b35e829c6
Merge "Delete libcom_android_net_module_util_jni"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-04-11 03:46:47 +00:00
6fa4682315
Delete libcom_android_net_module_util_jni
It is not used anywhere, as the sources are included via filegroup
in other libraries.

Test: m
Bug: 222234190
Change-Id: I23efe1382892a5493b8819cf05b5852305018d70

Remi NGUYEN VAN   commited 2022-04-11 02:22:43 +00:00
8f31725a22
Merge "Clear test ethernet data when no longer enabled"
James Mattis   authored and   Gerrit Code Review   commited 2022-04-08 22:52:16 +00:00
b8a7c9bb65
Merge "Revert the addition of IPsec/IKEv2/EAP bug component ID"
Yan Yan   authored and   Gerrit Code Review   commited 2022-04-08 18:06:36 +00:00
398ecb98f0
Clear test ethernet data when no longer enabled
When test interface are no longer tracked in ethernet, clear out
associated data. Besides polluting the dumpsys and taking up
memory, unexpected results could happen if other CTS tests or
the like were to use a test interface which happened to have an
existing configuration for it (i.e., the tests could fail). This is more
problematic since IP configuration data is written to disc, therefore
test data was being persisted across reboots.

Bug: 210485380
Bug: 210487893
Test: atest EthernetServiceTests
atest CtsNetTestCases

Change-Id: If85c625ebbf8da27b226d9ae3651c4fb83a9a8da

James Mattis   commited 2022-04-08 10:53:55 -07:00
53d2a2c414
Reorder EthernetManagerTest
Putting setUp() / tearDown() methods to the top and tests next to each
other.

Test: atest CtsNetTestCases:EthernetManagerTest
Change-Id: I38671aa28f03b8f1de8f6689f17d7c051529d9c5

Patrick Rohr   commited 2022-04-08 16:24:13 +02:00
03d18df93d
Clean up permission usage in EthernetManagerTest
Wrap all functions that require adapting shell permissions in a private
helper function.

Test: atest CtsNetTestCases:EthernetManagerTest
Change-Id: Ic2df53f184bd0f83767d6dff3c47a53b0b7442e2

Patrick Rohr   commited 2022-04-08 16:24:13 +02:00
284888ea6a
Merge "Move network permission cts tests to module"
Paul Hu   authored and   Gerrit Code Review   commited 2022-04-08 07:28:49 +00:00
903dab6a21
Merge "Remove services.connectivity-netstats-sources"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-04-08 03:26:30 +00:00
7e8831bc3f
Move network permission cts tests to module
CtsNetTestCasesUpdateStatsPermission and
CtsNetTestCasesInternetPermission are used to verify
PermissionMonitor relevant permissions.

CtsNetTestCasesInternetPermission: One app does not have INTERNET
permission so it should not be able to create network socket.

CtsNetTestCasesUpdateStatsPermission: The other one specify the
UPDATE_DEVICE_STATS in the AndroidManifest file but it is not a
privileged app so it should not have UPDATE_DEVICE_STATS
permission granted.

Bug: 228253498
Test: atest CtsNetTestCasesUpdateStatsPermission \
      CtsNetTestCasesInternetPermission
Original-Change: https://android-review.googlesource.com/926255
Merged-In: I380307fe0a5bc6aac6d9f836f03f0d043b99ccf5
Change-Id: I380307fe0a5bc6aac6d9f836f03f0d043b99ccf5

paulhu   commited 2022-04-08 10:45:50 +08:00
fd4deb3e9e
clatd bpf - add try_make_readable() of the ethernet/ip header
We now rely on the skb->mark = 0xDeadC1a7 setting side effect
for non offloadable packets, but for this to work reliably,
we *must* be able to read the ip header.

Test: TreeHugger, and on a gs101-based pixel
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ic2b15335099404047d136a92ce7aeeb1f11ccfa3

Maciej Żenczykowski   commited 2022-04-07 18:00:42 -07:00
4b1e0f8bcf
[LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity
Added SPDX-license-identifier-Apache-2.0 to:
  tests/native/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I0f883fa9c9d922766976c939565c6b368629915d

Bob Badour   commited 2022-04-07 10:36:04 -07:00
03465246f6
Merge "Set mark on non-offloaded ingress clat traffic"
Treehugger Robot   authored and   Gerrit Code Review   commited 2022-04-07 15:14:52 +00:00
49bcf60592
Merge "Use completeExceptionally instead of second future"
Patrick Rohr   authored and   Gerrit Code Review   commited 2022-04-07 12:12:32 +00:00
da294fc886
Merge "Update test for new IkeTunnelConnectionParams field"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-04-07 10:24:03 +00:00
5850372963
Set mark on non-offloaded ingress clat traffic
As Maze@'s advice, we add a clat mark to clat packet in ingress bpf
and drop the duplicate packets in iptables via mark match.

Bug: 218407445
Test: manual test with unmerged aosp/1951099

0. Connect to IPv6-only wifi

1. Clatd test: ping 5 times and check that iptables drop 5 packets by
   mark 0xdeadc1a7.

$ adb shell ping 8.8.8.8
..
64 bytes from 8.8.8.8: icmp_seq=4 ttl=120 time=14.3 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=120 time=67.4 ms

$ adb shell ip6tables -t raw -L bw_raw_PREROUTING -v
Chain bw_raw_PREROUTING (1 references)
 pkts bytes target     prot opt in     out     source               destination
    5   520 DROP       all      any    any     anywhere             anywhere             mark match 0xdeadc1a7
    0     0 RETURN     all      ipsec+ any     anywhere             anywhere
    0     0 RETURN     all      any    any     anywhere             anywhere             policy match dir in pol ipsec
 1661 1239K            all      any    any     anywhere             anywhere            match bpf pinned /sys/fs/bpf/prog_netd_skfilter_ingress_xtbpf

2. Bpf test: run iperf to an IPv4 server and iptables doesn't see
   offloaded packet with mark 0xdeadc1a7. Drop packet count (5) is
   unchanged.

$ adb shell iperf3 -4 -c 117.102.109.186 -t1
Connecting to host 117.102.109.186, port 5201
[  5] local 192.0.0.4 port 56242 connected to 117.102.109.186 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   622 KBytes  5.09 Mbits/sec    0   44.0 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-1.00   sec   622 KBytes  5.09 Mbits/sec    0             sender
[  5]   0.00-1.00   sec   201 KBytes  1.64 Mbits/sec                  receiver

$ adb shell ip6tables -t raw -L bw_raw_PREROUTING -v
Chain bw_raw_PREROUTING (1 references)
 pkts bytes target     prot opt in     out     source               destination
    5   520 DROP       all      any    any     anywhere             anywhere             mark match 0xdeadc1a7
    0     0 RETURN     all      ipsec+ any     anywhere             anywhere
    0     0 RETURN     all      any    any     anywhere             anywhere             policy match dir in pol ipsec
 1804 1280K            all      any    any     anywhere             anywhere            match bpf pinned /sys/fs/bpf/prog_netd_skfilter_ingress_xtbpf

3. Enable USB tethering. Do ping and iperf on tethered client.

4. Clatd test: ping 5 times and check that iptables drop 5 packets
   (count from 5 to 10) by mark 0xdeadc1a7.

$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
..
64 bytes from 8.8.8.8: icmp_seq=4 ttl=119 time=13.7 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=119 time=15.9 ms

$ adb shell ip6tables -t raw -L bw_raw_PREROUTING -v
Chain bw_raw_PREROUTING (1 references)
 pkts bytes target     prot opt in     out     source               destination
   10  1040 DROP       all      any    any     anywhere             anywhere             mark match 0xdeadc1a7
    0     0 RETURN     all      ipsec+ any     anywhere             anywhere
    0     0 RETURN     all      any    any     anywhere             anywhere             policy match dir in pol ipsec
 1900 1298K            all      any    any     anywhere             anywhere            match bpf pinned /sys/fs/bpf/prog_netd_skfilter_ingress_xtbpf

5. Bpf test: run iperf to an IPv4 server and iptables doesn't see
   offloaded packet with mark 0xdeadc1a7. Drop packet count (10) is
   unchanged.

$ iperf3 -4 -c 117.102.109.186 -t1
Connecting to host 117.102.109.186, port 5201
[  5] local 192.168.235.233 port 41602 connected to 117.102.109.186 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  3.19 MBytes  26.8 Mbits/sec    0    369 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-1.00   sec  3.19 MBytes  26.8 Mbits/sec    0             sender
[  5]   0.00-1.00   sec  2.58 MBytes  21.7 Mbits/sec                  receiver

$ adb shell ip6tables -t raw -L bw_raw_PREROUTING -v
Chain bw_raw_PREROUTING (1 references)
 pkts bytes target     prot opt in     out     source               destination
   10  1040 DROP       all      any    any     anywhere             anywhere             mark match 0xdeadc1a7
    0     0 RETURN     all      ipsec+ any     anywhere             anywhere
    0     0 RETURN     all      any    any     anywhere             anywhere             policy match dir in pol ipsec
 1978 1320K            all      any    any     anywhere             anywhere            match bpf pinned /sys/fs/bpf/prog_netd_skfilter_ingress_xtbpf

Change-Id: I180206bb15a1362c678f42fb980b60dfed6ce1ab

Hungming Chen   commited 2022-04-07 11:49:59 +08:00
6c0b1e85e9
Merge "Remove unused empty filegroups from connectivityT package."
Xiao Ma   authored and   Gerrit Code Review   commited 2022-04-07 03:45:45 +00:00
8e13391915
Remove services.connectivity-netstats-sources
The filegroup is unused and can be cleaned up.

Bug: 222234190
Test: m
Change-Id: I7239ed89b2bbf7f1a50bae7257a4911c64d5c84a

Remi NGUYEN VAN   commited 2022-04-07 12:29:56 +09:00
29b75348d7
Merge changes from topic "MDns_AIDL"
* changes:
  Use MDns aidl on NsdService
  Add MDnsManager

Paul Hu   authored and   Gerrit Code Review   commited 2022-04-07 02:06:35 +00:00
09475308b7
Merge "ConnectivityCoverageTests refactoring"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-04-07 01:22:17 +00:00
1ae9c4ad07
add OWNERS for connectivity_native_test
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibb7bcf272a2ff258d2518b60589ecb8e16823777

Maciej Żenczykowski   commited 2022-04-06 23:25:10 +00:00
189577cd8b
ConnectivityCoverageTests refactoring
ConnectivityCoverageTests is a combination of several test libs, which
are jarjared differently. It causes duplicated classes not to be counted
for coverage properly. Build the test suite directly and apply jarjar
only once on top of everything.

Bug: 227694415
Test: atest ConnectivityCoverageTests

Change-Id: I4350ebdbf98030944ec3857e1ef67d76f26c3b16

markchien   authored and   Remi NGUYEN VAN   commited 2022-04-06 19:35:28 +09:00
e59f5e36e5
Merge "Add config_p2p_leases_subnet_prefix_length configuration"
Mark Chien   authored and   Gerrit Code Review   commited 2022-04-06 09:14:19 +00:00
60f25d6c5b
Merge "Allow the bluetooth UID to register network factories."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-04-06 09:08:47 +00:00
a79559084b
Remove tabs that have been removed downstream
Change https://r.android.com/2020995 was a cherry pick of a downstream
change that was updated to remove these tabs. Unfortunately, the
cherry pick was not updated to match making this change necessary to
ensure consistency.

Bug: 194063708
Test: m out/soong/hiddenapi/hiddenapi-flags.csv
Change-Id: Id03bbbb749eb91a4f26b5c12b77eed03a72a83c4
Merged-In: Iaa1207799a44ab892dc30b55f363c6e7deb94d86

Paul Duffin   commited 2022-04-06 08:01:23 +01:00
7327f2cc1f
Merge "Remove implementation details from tethering hidden api flags"
Paul Duffin   authored and   Gerrit Code Review   commited 2022-04-06 06:51:07 +00:00
a2e04105bb
Merge "Add test for Ikev2VpnProfile.getIkeTunnelConnectionParams"
Chiachang Wang   authored and   Gerrit Code Review   commited 2022-04-06 05:28:56 +00:00
ed714f4d17
Allow the bluetooth UID to register network factories.
This ensures that bluetooth can register bluetooth tethering
NetworkAgents without having to make NETWORK_FACTORY a privileged
or role permission.

Test: m
Bug: 221949454
Change-Id: I24a5da444b10dde740c1e449c8630de56946d4e1

Lorenzo Colitti   commited 2022-04-06 11:15:12 +09:00
d12af7ebfe
Merge changes Iafa8979d,I44eac159,I27ad3298
* changes:
  Address EthernetManager javadoc review comments
  Update javadoc to match expectation for UnsupportedOperationException
  Fix linter errors

Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2022-04-06 00:39:28 +00:00
6097358382
Merge "data saver test exception for wear"
Andriy Naborskyy   authored and   Gerrit Code Review   commited 2022-04-05 23:46:28 +00:00
f900a64af4
Revert the addition of IPsec/IKEv2/EAP bug component ID
This commit reverts the addition of "Bug component: 685852" line
to work around the ATOS bug which causes all test bugs in
CtsNetTestCases assigned to the IPsec/IKEv2/EAP component (685852).

Bug: 219544194
Test: Owners file changes only; no code changes
Change-Id: If6bff57078e10e1589bbb2369f03cb1adeb14f3c

Yan Yan   commited 2022-04-04 16:17:38 -07:00
3bc025bc40
Merge "Increase the temp-allowlist duration in tests"
Sudheer Shanka   authored and   Gerrit Code Review   commited 2022-04-04 21:39:03 +00:00
63ef37647e
Use MDns aidl on NsdService
- Use MDns aidl to communicate with mdns service and register
  event listener to receive callback.
- Remove all NDC relevant code on NsdService.
- Use MDns aidl on NsdServiceTest.

Bug: 209894875
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I65929dee3838fef753396e86c665abd66b6fec81

paulhu   commited 2022-04-04 15:18:27 +00:00
2b9ed95ae5
Remove implementation details from tethering hidden api flags
Ran the following to compute the set of split_packages and
package_prefixes properties.
    m analyze_bcpf &&
    analyze_bcpf --bcpf com.android.tethering-bootclasspath-fragment --apex framework-tethering --sdk tethering-module-sdk

Bug: 194063708
Test: m out/soong/hiddenapi/hiddenapi-flags.csv
Change-Id: Iaa1207799a44ab892dc30b55f363c6e7deb94d86
Merged-In: Iaa1207799a44ab892dc30b55f363c6e7deb94d86

Paul Duffin   commited 2022-04-04 16:17:51 +01:00
a0c49bcc2c
Add MDnsManager
- Have MDnsManager to manage mdns native service binder call.
- Register it as a system service for NsdService.
- NsdService will use aidl to communicate with mdns, so add the
  relevant lib to framework-connectivity
- Add jarjar rule for mdns-aidl-interface classes.

Bug: 209894875
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: Ibc8b726c01a15015b450caf94d0afed570117b7f

paulhu   commited 2022-04-04 15:02:17 +00:00
541b72d03b