Commit graph android_packages_modules_Co.../Tethering/tests/mts
Message SHA1
Make java_sdk_library dependencies explicit
modules should specify the submodule of java_sdk_library that the module
actually depends on

Test: CI
Bug: 358613520
Change-Id: I0367068c901df98483f6cf95160d3e7801881b0a

Jihoon Kang   commited 2024-09-10 00:01:31 +00:00
8401b6a9f0
Move MtsEthernetTetheringTest back into TetheringTest
These were originally split in two, so low-level BPF could be changed
more easily. With the introduction of MCTS, updatability of CTS tests is
not a concern anymore, so these tests can be merged back together.

Test: atest TetheringIntegrationTests
Change-Id: Ia0bd91470d445e90230f7a9546de1cb56deef9cc

Patrick Rohr   commited 2024-07-03 14:30:54 +00:00
247e44b2ef
Separate Struct.java into its own lib.
* Struct.java is removed from net-utils-device-common-bpf and
  net-utils-device-common-struct's source list
* Created a lib net-utils-device-common-struct-base for Struct.java
* Updated libs that require Struct.java to include
  net-utils-device-common-struct-base.
* Replaced net-utils-multicast-forwarding-structs with
  net-utils-device-common-struct in service-connectivity

Bug: 323503345

Test: build tethering module.
Change-Id: I3f60715c3d8043b7569db7612dee9d4fa1ccba59

Yang Sun   commited 2024-03-27 20:15:17 +08:00
3aa62e6773
[DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 12:34:50 +00:00
01b5ede2b2
offload.c - adjust bytes for l2 header
Bug: 263884894
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I5c7bca4e005302a91368d22b9683db5b16d73b3a

Maciej Żenczykowski   commited 2023-04-04 06:18:28 +00:00
bab0c1ad95
Merge "Update Tethering/tests/mts/AndroidManifest.xml"
Frank Feng   authored and   Gerrit Code Review   commited 2023-03-01 13:02:24 +00:00
a257cc976c
Update Tethering/tests/mts/AndroidManifest.xml
Remove:
<meta-data android:name="listener" android:value="com.android.cts.runner.CtsTestRunListener" />

Bug: 267766325
Test: TH
Change-Id: I8f2e834581a6d0f89558b9a5f0a40fa2eead11e4

Frank Feng   commited 2023-02-24 07:53:12 -08:00
596752b740
Test: separate BPF tethering offload tests to MTS
Needed because CTS release interval is longer than mainline module
release. Newer mainline module release may change low level BPF
offload related code (struct, path, ..). The existing CTS will be
broken. This situation blocks that we want to change low level BPF
offload code after Android CTS has been public released.

The test targets have been changed as follows.
1. CTS/TetheringTests verifies high level tethering functions.
   No matter what data path is.
2. MTS verifies low level tethering functions. It can always test the
   latest BPF codes.

Change list:
1. Add class MtsEthernetTetheringTest for MTS.

Before:
  [base class]                      [derived class]

  EthernetTetheringTestBase +--+--+ EthernetTetheringTest

After:
  [base class]                      [derived class]

                               +--+ EthernetTetheringTest
  EthernetTetheringTestBase +--+
                               +--+ MtsEthernetTetheringTest (new)

2. Separate BPF tethering offload tests to MTS.
Before:
  - TetheringTests (19 tests)
  EthernetTetheringTest#testIcmpv4Echo
  EthernetTetheringTest#testIcmpv6Echo
  EthernetTetheringTest#testVirtualEthernet
  EthernetTetheringTest#testLocalOnlyTethering
  EthernetTetheringTest#testTetherConfigBpfOffloadEnabled
  EthernetTetheringTest#testTetherClatTcp
  EthernetTetheringTest#testTetherClatUdp
  EthernetTetheringTest#testIsUdpOffloadSupportedByKernel
  EthernetTetheringTest#testTetherClatIcmp
  EthernetTetheringTest#testTetherTcpV4
  EthernetTetheringTest#testTetherTcpV6
  EthernetTetheringTest#testTetherUdpV4
  EthernetTetheringTest#testTetherUdpV6
  EthernetTetheringTest#testStaticIpv4
  EthernetTetheringTest#testKernelSupportBpfOffloadUdpV4
  EthernetTetheringTest#testVirtualEthernetAlreadyExists
  EthernetTetheringTest#testPhysicalEthernet
  EthernetTetheringTest#testTetherUdpV4_VerifyBpf
  EthernetTetheringTest#testTetherUdpV4Dns

After:
  - TetheringTests (15 tests)
  EthernetTetheringTest#testIcmpv4Echo
  EthernetTetheringTest#testIcmpv6Echo
  EthernetTetheringTest#testVirtualEthernet
  EthernetTetheringTest#testLocalOnlyTethering
  EthernetTetheringTest#testTetherClatTcp
  EthernetTetheringTest#testTetherClatUdp
  EthernetTetheringTest#testTetherClatIcmp
  EthernetTetheringTest#testTetherTcpV4
  EthernetTetheringTest#testTetherTcpV6
  EthernetTetheringTest#testTetherUdpV4
  EthernetTetheringTest#testTetherUdpV6
  EthernetTetheringTest#testStaticIpv4
  EthernetTetheringTest#testVirtualEthernetAlreadyExists
  EthernetTetheringTest#testPhysicalEthernet
  EthernetTetheringTest#testTetherUdpV4Dns

  - MTS (4 tests)
  MtsEthernetTetheringTest#testTetherConfigBpfOffloadEnabled
  MtsEthernetTetheringTest#testIsUdpOffloadSupportedByKernel
  MtsEthernetTetheringTest#testTetherBpfOffloadUdpV4
  MtsEthernetTetheringTest#testKernelSupportBpfOffloadUdpV4

  Note that MtsEthernetTetheringTest#testTetherBpfOffloadUdpV4 is
  renamed from EthernetTetheringTest#testTetherUdpV4_VerifyBpf

Bug: 250552545
Bug: 258637850
Test: atest ConnectivityCoverageTests
Test: atest CtsTetheringTest
Test: atest CtsTetheringTestLatestSdk
Test: atest MtsTetheringTestLatestSdk
Test: atest TetheringIntegrationTests
Change-Id: Ica3b7008b33b1a0ddc5789d8ef12122a38544d57

Hungming Chen   commited 2023-02-15 18:37:17 +08:00
31eab2fd76
Add SkDestroyListenerTest
SkDestroyListener monitors the destroy of IPv4/IPv6 TCP/UDP sockets and
removes CookieTagMap entries.
SkDestroyListenerTest closes 100 sockets at once and check all the
entries are removed from the CookieTagMap.

Bug: 217624062
Test: atest MtsTetheringTestLatestSdk

Change-Id: I161006f4ae5bd83085e68bf8de260f04f3da0ea0

Motomu Utsumi   commited 2022-09-06 11:23:09 +09:00
116af0d892
Manual start tethering if it doesn't restart automatically
Because of race condition inside tethering module, restart tethering is
not reliable when address conflict. Manual start it for testing if it
doesn't restart automatically.

Bug: 176048959
Bug: 240878641
Bug: 178560045
Bug: 178116595

Test: atest MtsTetheringTestLatestSdk
Change-Id: Id1473b968cd20afde70bca1903114df6f0b510a8

Mark   authored and   Mark Chien   commited 2022-08-16 13:17:54 +08:00
b8d1afd408
Stop using adoptShellPermissionIdentity in setUp
Using adoptShellPermissionIdentity in setUp to use the shell permission
idnetity in whole test make the test not easy to
development. If the test want to use the library which would also
start/stop shell permission identity, this let the test lose shell
identify unexpectly after using that library. Only adopt shell permission
idnetity when necessary instead.

Test: atest CtsTetheringTest
Change-Id: I6cf24e6cbf227944bc914446337a247dc350562a

Mark   commited 2022-07-05 11:24:20 +00:00
ee2699379f
Bump tethering target sdk to 33
Note: to avoid missing some dependeices change only happen in T+, below
testing verification is perform by internal branch.

Test: atest TetheringTests
      atest TetheringIntegrationTests
      atest CtsTetheringTest
      atest MtsTetheringLatestSdk
      manually change entitlement check recheck period to 1 min and
      monitor schedule alarm works.
      Dogfood this change personally 7 days, major use hotspot sharing network to notebook to work.
Bug: 232193147
Change-Id: I3cba98f42ac1a9c0c1db4b2ad036aff714a428f3

Mark Chien   commited 2022-05-31 03:31:18 +00:00
d25a1e05ae
Remove tether_enable_select_all_prefix_ranges flag
The tether_enable_select_all_prefix_ranges is added from M2020-12
for quick roll back the feature. Since feature is landed over a year
without any problem, remove the flag now.

Bug: 171269957
Test: atest TetheringTests
Change-Id: I3ef414a47dd0a1f80ea2d378601ccd7c14067318

markchien   commited 2022-03-02 21:58:50 +08:00
23a5f18adb
Bump tethering target sdk version to 31
Also add BLUETOOTH_CONNECT permission which is needed for access
PanService if target sdk 31+. The permission would be granted to
privilege application without prompt.

Also remove the min_sdk_version 29 from AndroidManifest because it is
useless that the Android.bp already define min_sdk_version 30.

$aapt dump xmltree TetheringNext.apk AndroidManifest.xml
N: android=http://schemas.android.com/apk/res/android
  E: manifest (line=19)
    A: android:sharedUserId(0x0101000b)="android.uid.networkstack" (Raw: "android.uid.networkstack")
    A: android:versionCode(0x0101021b)=(type 0x10)0x1f
    A: android:versionName(0x0101021c)="Tiramisu" (Raw: "Tiramisu")
    A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1f
    A: android:compileSdkVersionCodename(0x01010573)="Tiramisu" (Raw: "Tiramisu")
    A: package="com.android.networkstack.tethering" (Raw: "com.android.networkstack.tethering")
    A: platformBuildVersionCode=(type 0x10)0x1f
    A: platformBuildVersionName="Tiramisu" (Raw: "Tiramisu")
    E: uses-sdk (line=23)
      A: android:minSdkVersion(0x0101020c)=(type 0x10)0x1e
      A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1f
    ....
    E: uses-permission (line=35)
      A: android:name(0x01010003)="android.permission.BLUETOOTH_CONNECT" (Raw: "android.permission.BLUETOOTH_CONNECT")

Bug: 204265450
Test: manual testing bluetooth tethering and TH
Change-Id: I6f821020679b9379cada29f6f0816187545a24fb

markchien   authored and   Mark Chien   commited 2022-01-12 07:24:16 +00:00
bf62258f8c
Merge "Fix ConnectivityManagerTest initialization on Q" am: 72f59b3019 am: 82a32e3f4a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1740779

Change-Id: I40abcac7db563480fe3c13fb5e0178d7a3629652

Remi NGUYEN VAN   authored and   Automerger Merge Worker   commited 2021-06-28 07:40:27 +00:00
9f4a31af59
Fix ConnectivityManagerTest initialization on Q
The test can't have TetheringManager as an argument to methods or a
field, otherwise the test runner will crash when scanning the class for
tests because TetheringManager did not exist in Q. Although
testFactoryReset is already skipped on Q, the test runner would fail
at initialization time, before starting the run.

Use CtsTetheringUtils instead. This ensures that TetheringManager does
not have method signatures or members that reference classes that do not
exist on Q, so the test runner can scan the class successfully before
starting the run.

Bug: 188851796
Test: atest ConnectivityManagerTest on Q
Change-Id: I87488d0f23628a1ef2d7af0242513fcc5401d598

Remi NGUYEN VAN   commited 2021-06-28 11:24:27 +09:00
0d54d7992d
Merge changes I5d3e448e,Id69ac1d3 am: 02eea987c0 am: b675eba4c1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1711429

Change-Id: Iede15400f50e5e0f37a95f59b924d8b7dd698509

Chiachang Wang   authored and   Automerger Merge Worker   commited 2021-06-03 09:22:36 +00:00
a3df1ed5f1
Correct the logic for CtsTetheringUtils.isWifiTetheringSupported
The existing isWifiTetheringSupported only check if tethering side
supports wifi tethering or not but not wifi side. A expected
behavior should include both of them, so add the wifi side check
into the helper function. Also update in the existing caller side
due to a new parameter added.

Bug: 186061922
Test: atest MtsTetheringTestLatestSdk
Change-Id: Id69ac1d30ab2bbf23e870193335b139f54672636

Chiachang Wang   commited 2021-06-01 15:08:48 +08:00
4f5c4c4323
Test tethered callback with TetheringInterface
The old callback only report interface list, new callback could provide
the mapping of interface and type. Replace old callback usage in cts
with new callback and check whether old callback could get the correct
interface list by comparing the result between old and new callback.

Bug: 162920185
Bug: 152203943
Test: atest CtsTetheringTest on S
      atest CtsTetheringTestLatestSdk on R
      atest MtsTetheringTestLatestSdk on S and R
Merged-In: I2a0b8c43fb340c3eaed7f0f90464199222a24280
Change-Id: I2a0b8c43fb340c3eaed7f0f90464199222a24280

markchien   authored and   Chiachang Wang   commited 2021-06-01 14:36:09 +08:00
3a23d2e2a6
Test tethered callback with TetheringInterface
The old callback only report interface list, new callback could provide
the mapping of interface and type. Replace old callback usage in cts
with new callback and check whether old callback could get the correct
interface list by comparing the result between old and new callback.

Bug: 162920185
Bug: 152203943
Test: atest CtsTetheringTest on S
      atest CtsTetheringTestLatestSdk on R
      atest MtsTetheringTestLatestSdk on S and R
Ignore-AOSP-First: Its dependences CL is not in aosp currently.

Change-Id: I2a0b8c43fb340c3eaed7f0f90464199222a24280

markchien   authored and   Mark Chien   commited 2021-05-20 09:02:39 +00:00
82f99f95b7
Merge "Test mts against last stable api level" am: a59a146b36 am: 9015e276aa am: 726b814899
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1686012

Change-Id: I9d2d08b9c9397c247e2afd54b25a21631233c585

Mark Chien   authored and   Automerger Merge Worker   commited 2021-05-14 10:26:06 +00:00
540f0d3ce3
Fix MtsTetheringTest fail to access hidden tethering api problem
E.g. Accessing hidden method
Landroid/net/TetheringManager$TetheringInterfaceRegexps;
->getTetherableWifiRegexs()Ljava/util/List; (blacklist, linking, denied)

Bug: 183459282
Test: atest MtsTetheringTest on both R and S platform
Ignore-AOSP-First: change already in AOSP.

Change-Id: I3c5f08615fcf897fac59f2493be5337f78c2fdc7

markchien   authored and   Mark Chien   commited 2021-05-13 15:44:18 +00:00
ac3e0bb7fc
Test mts against last stable api level
Create *LatestSdk variant build target which have target sdk specify
to allow test apk install to released platform.

Bug: 182211575
Test: test S MtsTetheringTest in R device
Change-Id: I4d5c5e8c3d74993a67380e0211da31884cbf8792

markchien   commited 2021-05-12 22:11:04 +08:00
7193a1b30e
Allow connectivity tests to use hidden APIs
The tests have been building against hidden APIs to provide additional
coverage.

Test: m TetheringCoverageTests CtsNetTestCases
Bug: 182859030
Ignore-AOSP-First: needs manual cherry-picks
Change-Id: I37d748411a34f25834214a2412c49aed1423e526

Remi NGUYEN VAN   commited 2021-04-01 06:37:53 +00:00
eeeed136e0
Enable networking tests to be included in partial MTS files as well as
full mts.

Test: built locally and verified contents.
Bug: 170318013
Change-Id: Idea798841c067002d7b1f47da73a34052a8ab32c

Kimberly Kreider   commited 2021-02-22 14:59:54 -08:00
6413dd84cf
[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

Bob Badour   commited 2021-02-16 04:09:58 -08:00
97e6be27f6
Add the flag and default enable selectAllPrefixRange
Also add MtsTetheringTest which only run if tethering mainline
module is installed.

Bug: 166057846
Bug: 170265597
Test: atest TetheringTests
Change-Id: I434dda81eb5fab700d873a8ff3429b4222f0c7e6

markchien   commited 2020-10-19 16:50:29 +08:00
4607c5535b