Commit Graph

8235 Commits

Author SHA1 Message Date
Treehugger Robot
4945772ba7 Merge "ebpf offload: mark as critical for tethering not netd" 2021-02-26 05:39:07 +00:00
Maciej Żenczykowski
607d6dda0d ebpf offload: mark as critical for tethering not netd
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5bccfcbababb09a412ac1093513ad93c254b349b
2021-02-25 19:10:01 -08:00
Junyu Lai
3f134a3805 Merge "[VCN07.1] Add test for bypassing VCN for non-internet request" 2021-02-25 10:16:03 +00:00
Chalard Jean
26c11595bc Merge "Release test network in a test" 2021-02-25 08:06:15 +00:00
Chalard Jean
8a8bf7434c Release test network in a test
This causes failures in subsequent tests that expect
only one test network to be up.

Bug: 181033598
Test: this
Change-Id: I74444f4aff7750a5bbd2564e5e22714d73c72d8b
2021-02-24 23:07:13 +09:00
Daulet Zhanguzin
bb540131b7 Use unbundled version of BouncyCastle in Ike cts tests
Since BouncyCastle APIs provided by platform vary, use unbundled
BouncyCastle

Fixes: 180870458
Test: atest CtsNetTestCases
Change-Id: I78c053150bb9cf86173f869dd6e13e9a6917ffa7
2021-02-24 13:09:36 +00:00
Lorenzo Colitti
ffb0ccd04b Add a BpfMap#clear method.
A caller can mostly already do this via forEach(), but having a
specific method is faster (since the code does not need to read
the value) and easier to use.

The semantics of this method (e.g., ignore ENOENT while deleting
a key, but throw on any other error) match those of the native
BpfMap::clear method.

Test: new unit tests
Change-Id: I5cd32efd0f87c823cd2d0a2fa3a95a83093fb6f9
2021-02-24 06:09:46 +00:00
Lorenzo Colitti
2be434ab12 Make the CTS tests explicitly depend on modules-utils-build.
In AOSP master and downstream branches, this likely works via a
transitive dependency. In mainline-prod, this doesn't work. Add
the dependency explicitly, since it makes things build everywhere
and in general it's also good practice to "include what you use".

Bug: 167645754
Test: m CtsNetTestCasesLatestSdk in mainline-prod has fewer errors
Change-Id: Ie575372415a806deee9996aab7f920d2c15bff80
2021-02-24 05:43:36 +00:00
Lorenzo Colitti
56be03eb28 Move definitions used by tethering bpf code into the module.
Bug: 167645754
Test: m com.android.tethering
Change-Id: Ia4fb1201e5f4e0c35baba7865b26b4cec0945a64
2021-02-24 12:16:05 +09:00
Treehugger Robot
afa18f0256 Merge "Fix CTS test failed on R device" 2021-02-22 10:37:29 +00:00
Treehugger Robot
f754671f07 Merge "Add MUTABLE flag when creating PendingIntent" 2021-02-22 10:29:31 +00:00
Treehugger Robot
2108eada65 Merge "Fix flaky test by extending timeout" 2021-02-22 07:58:10 +00:00
junyulai
62f5117bfd Add MUTABLE flag when creating PendingIntent
By the new feature introduced in next Android release.
Any PendingIntent needs to be specified about the mutability.

While ConnectivityService would put extra info such as
network or request id before broadcasting the inner intent.
The MUTABLE flag needs to be added accordingly.

Test: this
Fix: 178121691
Change-Id: I87d0efaf51a91556ef9f8e18db38803e4861cfd7
2021-02-22 15:06:32 +08:00
junyulai
e26bbf8032 Fix CTS test failed on R device
The test failed since the API is not available on R device.
Add conditions to ignore it.

Test: atest CtsNetTestCasesLatestSdk:android.net.cts.ConnectivityManagerTest
Bug: None
Change-Id: I3cbc623a84f7313e1155fe83a44ebef042a04076
2021-02-22 14:26:27 +08:00
junyulai
607985b57f Fix flaky test by extending timeout
The asserted capabilities change callback event took 170ms
in average to fire on cuttlefish, which causes 35% of
flakiness since the event might delay up to 500ms in practice.
Extend to 30s timeout value which is the standard value
of waiting for network callback events in CTS.

This change also ignore the test up to Android R since the API
is not available for R devices or below.

Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest#testRequestBackgroundNetwork \
      --rerun-until-failure 500
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.ConnectivityManagerTest
      on R device
Bug: 179694867

Change-Id: Ic5e11d4a4f326150848bc48038fa01cde39f7661
2021-02-22 14:26:05 +08:00
junyulai
651a95f126 [VCN07.1] Add test for bypassing VCN for non-internet request
This is a re-upload that combines aosp/1550755 and aosp/1579872.

Test: atest NetworkRequestTest#testBypassingVcnForNonInternetRequest
Test: atest CtsNetTestCasesLatestSdk on R device
Bug: 175662146
Change-Id: I2fdc2418339bef30c9f816d63418bba218abf4a1
2021-02-20 19:22:25 +08:00
Bob Badour
f5b346ed1d Merge "[LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity" 2021-02-19 06:23:22 +00:00
Sudheer Shanka
ddcfa071ab Merge "Add TEST_MAPPING to run CtsHostsideNetworkTests in presubmit." 2021-02-19 00:33:15 +00:00
Tomasz Wasilczyk
736f8ec55a Merge "Don't crash Tethering service when WiFi feature is missing" 2021-02-18 18:20:28 +00:00
Treehugger Robot
319064f284 Merge "Use networkstack_client instead of aidl_interface" 2021-02-18 13:31:54 +00:00
Remi NGUYEN VAN
1a16358c36 Merge "Deflake CaptivePortalTest mobile data usage" 2021-02-18 13:11:25 +00:00
Treehugger Robot
c4127ef16c Merge "Add tethering-module-sdk build target." 2021-02-18 12:05:46 +00:00
Sudheer Shanka
be82d7d77a Add TEST_MAPPING to run CtsHostsideNetworkTests in presubmit.
We already run these tests when platform code affecting these tests
change. Now enabling these too to also run when these tests are being
changed.

Fixes: 154344933
Test: atest --test-mapping packages/modules/Connectivity/tests/cts/hostside
Change-Id: Ie3ea67670ccd028815936d30189146c25ba87e28
2021-02-18 11:39:09 +00:00
Remi NGUYEN VAN
6d190abfe2 Deflake CaptivePortalTest mobile data usage
The test did not verify that mobile networks were validated before
starting, which could cause them to validate during the test and pick up
the test URLs. Verify that mobile data is validated before the test.

Also shorten test URL expiration, so in case of hard-interrupt of the
test (without calling tearDown) it does not affect other tests for a
long time.

Bug: 178630586
Test: atest CtsNetTestCases
Change-Id: I03f346bcc231f869f50ca9c7e84bfac319bcc871
2021-02-18 18:36:34 +09:00
Treehugger Robot
c72a6cae30 Merge "Set updateable:false explicitly in apex rules." 2021-02-18 09:30:33 +00:00
Maciej Żenczykowski
e982f091e1 ebpf offload - rename PUNT/DROP to TC_PUNT/TC_DROP
because it is not appropriate for use in XDP programs

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibd5dac9676bae7aa5f10fbcfd777291f72bec819
2021-02-18 06:40:33 +00:00
Maciej Żenczykowski
e4a726a5c6 ebpf offload - add support for tethering of ipv4 udp
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I6229e33cb219e9acd14f5b880cfa2ea0a34442f4
2021-02-18 06:38:36 +00:00
Maciej Żenczykowski
2c0edb112f Merge "ebpf offload - do L4 header present check earlier" 2021-02-18 06:24:39 +00:00
Maciej Żenczykowski
82ee26be75 ebpf offload - do L4 header present check earlier
and more importantly unconditionally.  This requires less effort
on the part of the in-kernel bpf verifier.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ibaa94bf096fc81c4d984dfabf515131b1c81ef09
2021-02-18 06:23:32 +00:00
Remi NGUYEN VAN
561c31906e Merge "Skip NetworkAgentTest via its runner on R-" 2021-02-18 01:30:58 +00:00
Tomasz Wasilczyk
3cbccdb6c3 Don't crash Tethering service when WiFi feature is missing
Bug: 175430552
Test: disable WiFi feature on device with wlan0

Change-Id: Ie8b422ed6e0a0a98eb1c7e6072464859d9083ba5
2021-02-17 15:36:05 -08:00
Mathew Inwood
adfc933979 Set updateable:false explicitly in apex rules.
Currently, this is the default so this is a no-op,
But the default is changing to true.

Bug: 180375550
Test: Treehugger
Change-Id: Ib841e474ab2b2ff2b54c160bb06c3bbbeea92675
2021-02-16 14:58:27 +00:00
Bob Badour
97e6be27f6 [LSC] Add LOCAL_LICENSE_KINDS to packages/modules/Connectivity
Added SPDX-license-identifier-Apache-2.0 to:
  Tethering/Android.bp
  Tethering/apex/Android.bp
  Tethering/bpf_progs/Android.bp
  Tethering/common/TetheringLib/Android.bp
  Tethering/tests/Android.bp
  Tethering/tests/integration/Android.bp
  Tethering/tests/mts/Android.bp
  Tethering/tests/privileged/Android.bp
  Tethering/tests/unit/Android.bp
  tests/cts/hostside/Android.bp
  tests/cts/hostside/aidl/Android.bp
  tests/cts/hostside/app/Android.bp
  tests/cts/hostside/app2/Android.bp
  tests/cts/hostside/certs/Android.bp
  tests/cts/net/Android.bp
  tests/cts/net/api23Test/Android.bp
  tests/cts/net/appForApi23/Android.bp
  tests/cts/net/jni/Android.bp
  tests/cts/net/native/dns/Android.bp
  tests/cts/net/native/qtaguid/Android.bp
  tests/cts/net/util/Android.bp
  tests/cts/tethering/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I8534c580f0e2a17be146300b67b3604817b64507
2021-02-16 04:09:58 -08:00
Jeongik Cha
d05f990649 Use networkstack_client instead of aidl_interface
Bug: 150578172
Test: m
Change-Id: Ib5f28db973eb80942faafe1c1c5ddcaab54bf980
2021-02-16 08:20:12 +00:00
Maciej Żenczykowski
36867351ec offload ebpf - introduce 4.14+ ipv4 forwarding programs
We've backported the necessary support to all 4.14+ ACK kernels,
but we can't actually enforce that these changes will be picked
up by all devices.  Thus we can only make the full featured
implementations optional on [4.14..5.8) kernels, with a tcp-only
version for those 4.14+ devices where the full featured version
fails to load.

Note: there's still a fair bit of implementation work left
in the do_forward4() function itself.  This is really just
the skeleton.

Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: If78123e00d55a77f2ecd7da1547581797e23f9b2
2021-02-16 05:48:55 +00:00
Maciej Żenczykowski
d74918c6d2 Merge "offload ebpf - do_forward4() - introduce updatetime argument" 2021-02-15 12:35:16 +00:00
Maciej Żenczykowski
aefa0950b5 offload ebpf - do_forward4() - introduce updatetime argument
This will facilitate providing a tcp-only version of the programs
which due to TCP's very long timeouts will not need to use the
Linux 5.8+ bpf_ktime_get_boot_ns() helpers.

Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1e49b6758d3754782ac6f8820e0c15aa20e4c61d
2021-02-15 12:33:01 +00:00
Remi NGUYEN VAN
edc9b873d3 Merge changes from topic "revert-1579872-vcn07-WIQQMUVMTJ"
* changes:
  Revert "[VCN07.1] Add test for bypassing VCN for non-internet re..."
  Revert "Address comments on aosp/1550755"
2021-02-15 11:39:25 +00:00
Maciej Żenczykowski
b0ac41f0cd tethering offload ebpf - lower requirement from 5.9 to 5.8
As this is the actual version that is required,
ie. the version that supports bpf_ktime_get_boot_ns() helper.

Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I2ea4830597a0bed53950a5d0c483a47208959f35
2021-02-14 22:24:34 -08:00
Hai Zhang
6d71f109bc Add tethering-module-sdk build target.
Bug: 177884752
Test: m tethering-module-sdk
Change-Id: Idd4e6743001a6402f6a5dd6832601b08d7cc0236
2021-02-14 06:38:26 +00:00
Remi NGUYEN VAN
075da46909 Revert "[VCN07.1] Add test for bypassing VCN for non-internet re..."
Revert "[VCN07] Bypass VCN for non-internet app accessible cellu..."

Revert submission 1579872-vcn07

Reason for revert: Possible culprit for b/179768816, broken ConnectivityControllerTest
Reverted Changes:
Id09b19c13:Address comments on aosp/1550755
I245bd69e0:[VCN07.1] Add test for bypassing VCN for non-inter...
I9936894b9:[VCN07] Bypass VCN for non-internet app accessible...

Change-Id: I7902a221c8597427e48d3e32fa5668b9c1a47420
2021-02-12 06:28:17 +00:00
Remi NGUYEN VAN
f77bed6d95 Revert "Address comments on aosp/1550755"
Revert "[VCN07] Bypass VCN for non-internet app accessible cellu..."

Revert submission 1579872-vcn07

Reason for revert: Possible culprit for b/179768816, broken ConnectivityControllerTest
Reverted Changes:
Id09b19c13:Address comments on aosp/1550755
I245bd69e0:[VCN07.1] Add test for bypassing VCN for non-inter...
I9936894b9:[VCN07] Bypass VCN for non-internet app accessible...

Change-Id: I3fded28691e05a3dbf25bb7361c72acaa61b29c7
2021-02-12 06:27:44 +00:00
Lorenzo Colitti
af97e51c01 Merge "Load JNI in all classes that have native methods." 2021-02-12 03:19:00 +00:00
Treehugger Robot
6fc8229f16 Merge "fix TetheringCoverageTests" 2021-02-12 03:17:51 +00:00
Lorenzo Colitti
fd710547b2 Merge changes I71a37663,Ib2010b38
* changes:
  Improve testing of registerSystemDefaultNetworkCallback.
  Remove buggy ConnectivityManagerTest#ensureWifiConnected.
2021-02-12 02:45:02 +00:00
Maciej Żenczykowski
c92e8ce636 fix TetheringCoverageTests
Test: atest TetheringCoverageTests now passes, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0d83de14784f323400a83ce282cae1a3e7b4b396
2021-02-11 16:06:46 -08:00
Daulet Zhanguzin
e1f96f3c35 Merge "Run Connectivity cts tests against unbundled version of BouncyCastle" 2021-02-11 14:44:06 +00:00
Sudheer Shanka
37c10a2252 Update the way we change meteredness of cellular networks in tests.
SubscriptionManager.setSubscriptionOverrideUnmetered() has been updated
to add NET_CAPABILITY_TEMPORARILY_NOT_METERED instead of
NET_CAPABILITY_NOT_METERED. So, we can't rely on that for changing the
meteredness.

Bug: 179664982
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideNetworkCallbackTests.java
Change-Id: I4163b2f9c6f80b4e639d9977ef7e2b444ab12e81
Merged-In: I4163b2f9c6f80b4e639d9977ef7e2b444ab12e81
2021-02-10 14:05:09 +00:00
Lorenzo Colitti
baea700554 Improve testing of registerSystemDefaultNetworkCallback.
Addresses comments on aosp/1570840.

Bug: 179774433
Test: test-only change
Change-Id: I71a376631503e5b50ada3f7bb3dca6dbae9ebc27
2021-02-10 22:41:48 +09:00
Lorenzo Colitti
bf5c2979dd Remove buggy ConnectivityManagerTest#ensureWifiConnected.
This method does not behave correctly when wifi is connected but
the last CONNECTIVITY_ACTION broadcast was not for wifi. This
could happen due to another network connecting or disconnecting,
such as VPN.

Bug: 179774433
Test: test-only change
Change-Id: Ib2010b3871133c38b6d508bf508134dd9b814ce2
2021-02-10 15:58:18 +09:00