Commit graph

51,742 commits

Message SHA1
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
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
[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
Use completeExceptionally instead of second future
The onError callback can use the same future as the onResult callback by
calling completeExceptionally.
This change is also removing the test for a specific exception message.
Testing for a specific exception message would mean that tests break if we
ever were to update them. If we decide that there is value to
distinguish between different types of
EthernetNetworkManagementException we should probably subclass it
internally.

Test: atest EthernetNetworkFactoryTest
Change-Id: Ib6f8cf79fc26e0f856c880cbe505b101f12aa187

Patrick Rohr   commited 2022-04-04 14:59:42 +02:00
fd87fb65fb
Address EthernetManager javadoc review comments
Test: TH
Change-Id: Iafa8979d8e96ea4d078b017e56ee61334d33b5f5

Patrick Rohr   commited 2022-04-04 14:59:42 +02:00
50c470e308
Update javadoc to match expectation for UnsupportedOperationException
Test: builds
Change-Id: I44eac15972ed099fc12599a78a71557a7b16d593

Patrick Rohr   commited 2022-04-04 14:59:42 +02:00
0f2cbe92f1
Fix linter errors
Test: TH
Change-Id: I27ad329811a4794050b25976e79909ce8c57d7a3

Patrick Rohr   commited 2022-04-04 14:59:31 +02:00
ddc2622ec7
Merge "Merge EthernetServiceTests into FrameworksNetTests"
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2022-04-04 08:02:04 +00:00
82ef475266
Remove unused empty filegroups from connectivityT package.
connectivity-tiramisu-sources filegroup in the framework-t and service
folder is useless after moving all source files to updatable-sources
filegroup, delete them from f/b/packages/connectivityT.

Bug: 210586283
Test: m
Change-Id: I22e9a70a04929144488380d1530cd7baa78ce056

Xiao Ma   commited 2022-04-04 07:00:59 +00:00
f90f1efff4
Increase the temp-allowlist duration in tests
It is possible there is a delay in app getting to
the background state and then initiating network
activity. We need the app to stay in the
temp allowlist until then.

Fixes: 227418169
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I6a98cc17a40cfb54bf3e12f51b5584159e69be0c

Sudheer Shanka   commited 2022-04-02 21:05:51 +00:00
5b63b6c107
Merge changes from topic "block_port"
* changes:
  Add connectivity_native_test to Presubmit
  Vendor AIDL interface for port blocking via eBPF

Lorenzo Colitti   authored and   Gerrit Code Review   commited 2022-04-01 21:46:37 +00:00
6de87582c1
Merge EthernetServiceTests into FrameworksNetTests
As per the TODO, merge EthernetServiceTests into the larger
FrameworksNetTests suite.

Similarly to NetworkStats, NSD or IpSec tests, the tests are also marked
as "non-connectivity-module-test", where "module" actually refers to
modules being built for release (from an S-based branch) today. This is
necessary as the tests and associated code cannot build without T APIs.

Also add FrameworksNetTests to presubmit as non-connectivity-module
tests are not run in presubmit without this.

Test: TH
Merged-In: Id533cdb4ac184b963f570af299dea04754ba88e9
Change-Id: I9950fcb49fdc2217134a59e993941cbe5da0b556

Remi NGUYEN VAN   commited 2022-04-01 15:12:18 +09:00
40da62da48
Merge "Adding Tethering proto"
Wayne Ma   authored and   Gerrit Code Review   commited 2022-03-31 16:24:16 +00:00
075dd6f8ff
Add config_p2p_leases_subnet_prefix_length configuration
Add new rro configuration which can be used to make the p2p dhcp
prefix length larger to reserve the address range outside of leases
subnet prefix length for EAPOL-Key feature. This configuration only
valid if its value larger than dhcp server address prefix length and
config_tether_enable_legacy_wifi_p2p_dedicated_ip is true.
E.g.:leaseSubnetPrefixLength = 25, p2p static address = 192.168.49.1/24
dhcp range: 192.168.49.0 ~ 192.168.49.127 (192.168.49.1/25), reserved
192.168.49.128 ~ 192.168.49.255 for EAPOL-Key feature.

Bug: 170056953
Test: atest TetheringTests

Change-Id: I1319efd871796da7234383a29ab64a1623101ae7

markchien   commited 2022-03-31 16:32:55 +08:00
fb65dfeb8d
Update test for new IkeTunnelConnectionParams field
Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: Iab55eba74b94f295a358c6e8474ebf9230c9b019

Chiachang Wang   commited 2022-03-31 14:45:59 +08:00
69aa988090
Remove connectivity-tiramisu-updatable-sources
The filegroup is now unnecessary as files are all in the service-t/src
directory.

This change allows building all sources including ethernet by
referencing src/**. This is done by using a general filegroup
service-connectivity-tiramisu-sources, so that branches that cannot
build the T+ code can change its contents without introducing merge
conflicts in the rest of the build rules.

Also change visibility rules to allow building the moved ethernet code,
and add a filegroup to allow building its tests.

Bug: 222234190
Test: TH
Merged-In: I770bf8db3f4c18467934eb2184f5dc2408fc28ec
Merged-In: I3e5df1bd44defbb9dd0c382c625a21e176368f2a
Change-Id: I8f23a45800b1086cc5a765fd24d734ca82c339a8

Remi NGUYEN VAN   commited 2022-03-31 15:14:39 +09:00
86bbfe9271
Merge history of opt/net/ethernet
Renamed files/directories:
java/ --> service-t/src/
tests/ --> tests/ethernet/
Android.bp --> (removed)
OWNERS --> (removed)
.gitignore --> (removed)

BUG: 222234190
TEST: TH
Merged-In: I770bf8db3f4c18467934eb2184f5dc2408fc28ec
Merged-In: I3e5df1bd44defbb9dd0c382c625a21e176368f2a
Change-Id: Ifc02784499d114e12d8ad64ba011dd23b97fb78b

Remi NGUYEN VAN   commited 2022-03-31 15:14:28 +09:00
e99dcfd4dd
Merge "Revert "Use RECEIVER_NOT_EXPORTED in CarrierPrivilegeAuthenticator.""
Michael Groover   authored and   Gerrit Code Review   commited 2022-03-31 01:39:28 +00:00
3e712761a4
Merge "Support QosCallback with UDP socket"
Sewook Seo   authored and   Gerrit Code Review   commited 2022-03-30 20:01:45 +00:00
2304205a58