Commit graph android_packages_modules_Co.../tests/cts/tethering
Message SHA1
Add CtsTetheringTest to MTS
Similar to aosp/2963602, move to CtsTetheringTest instead of
CtsTetheringTestLatestSdk.

Bug: b/325564242
Test: m, aapt dump badging, verify (min)sdkVersion=30, targetSdk=10000
Change-Id: I4159448686455c988a1b9cd233af5e411e1cc7ad

Quang Anh Luong   authored and   Quang Luong   commited 2024-02-29 00:48:30 +00:00
1f1357b0ef
Make TetheringRequest parcelable
Make TetheringRequest parcelable so we can pass it via Wifi APIs and map
Soft AP state changes to the correct request.

Bug: 216524590
Test: build
Change-Id: I63a45b14e9abc288b353159dfdcbe96fde485cb7

Quang Anh Luong   commited 2024-02-15 10:15:05 +09:00
1252f7f428
[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
Add CtsTetheringTestLatestSdk into mainline-presubmit
Also test CtsTetheringTestLatestSdk on physical devices
physical SIM in mainline-post

Test: TH

Change-Id: Ia9806c46fbe49282017011ea6ca414e2c58fe00b

Mark Chien   authored and   Mark   commited 2023-05-31 03:50:26 +00:00
f8870fa7af
Update ConnectivityCheckTargetPreparer references
Use the new ConnectivityTestTargetPreparer name instead, as the preparer
is being made more generic.

Bug: 263665773
Test: m
Merged-In: I520e92c449f366c51cda2f8b33fe9a354a8c0445
Change-Id: I520e92c449f366c51cda2f8b33fe9a354a8c0445

Remi NGUYEN VAN   commited 2023-05-16 15:15:55 +09:00
89570aca44
Use ConnectivityCheckTargetPreparer in tethering cts
This can make sure test device have wifi and mobile data connectivity before running tethering test.

Bug: 264785877
Change-Id: Iac416ca4aaccf3936134aa878b49160ca07f0486
Test: TH

Mark Chien   commited 2023-03-14 05:55:21 +00:00
9bfe8578a2
Update tests/cts/tethering/AndroidManifest.xml
Remove:
<meta-data android:name="listener" android:value="com.android.cts.runner.CtsTestRunListener" />

Bug: 267766325
Test: TH
Change-Id: I4f5614114d5afab3044d608066b23e302db44ec8

Frank Feng   commited 2023-02-24 07:52:41 -08:00
66f855657a
Merge "Stop using adoptShellPermissionIdentity in setUp"
Mark Chien   authored and   Gerrit Code Review   commited 2022-07-23 03:38:14 +00:00
ad3eab1c8b
Use the same target SDK in ConnectivityCoverageTests and CTS.
Currently, ConnectivityCoverageTests is manually set to target
SDK 31. This is different from CtsNetTestCasesLatestSdk, and
CtsTetheringTestLatestSdk, which are set to 33 and 31
respectively. Set all of them to 33 via a defaults clause.

ConnectivityCoverageTests must have the same target SDK as CTS
because it includes many of the CTS tests (e.g., everything in
common/).

Bug: 236087258
Test: atest ConnectivityCoverageTests
Test: atest CtsNetTestCasesLatestSdk
Test: atest CtsTetheringTestLatestSdk
Change-Id: I88c16dc28d9b73557def25d7f669ed14ae9d360a

Lorenzo Colitti   commited 2022-07-22 13:08:39 +09:00
cc5054bfe3
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
Merge "Revert "[Tethering] Add MTS method to TetheringManagerTest.""
Mark Chien   authored and   Gerrit Code Review   commited 2022-06-10 10:38:21 +00:00
16a9c43b37
Revert "[Tethering] Add MTS method to TetheringManagerTest."
Revert submission 2046446-tethering_entitlement_MTS

Reason for revert: This test never pass. Now tethering module release is blocked by MTS fail. TH don't catch this probably because b/234680138 cause this test don't actually run at the moment.

Reverted Changes:
Ica95c0d5b:Add a test BroadCastReceiver to receive carrier Co...
I5f758fe0c:[Tethering] Add MTS method to TetheringManagerTest...

Change-Id: I0d94debb5c573bd41617adb48d6e81ae7ff1a0da

Mark Chien   commited 2022-06-10 06:41:56 +00:00
7890972309
Merge "[Tethering] Add MTS method to TetheringManagerTest."
Tom Hsu   authored and   Gerrit Code Review   commited 2022-06-06 02:11:09 +00:00
9424810659
[Tethering] Add MTS method to TetheringManagerTest.
Bug: 225092753
Test: atest TetheringManagerTest
Change-Id: I5f758fe0c6916fde61ffe8aec63b85e03fd57fcb

tom hsu   commited 2022-06-02 15:00:40 +08:00
c8eb6bc970
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
Do not apply jarjar rules on intermediate libs
Using jarjar on intermediate libraries causes issues when they are
combined with other libraries that use different jarjar rules, as the
resulting binary may contain multiple incompatible copies of the
classes. Instead, jarjar should be used on the final artifact, after
combining the libraries.

Ensure NetworkStackJarJarRules is not applied on intermediate libraries
like TetheringIntegrationTestsLib, but instead apply it on
TetheringIntegrationTests or CtsTetheringTest.

Bug: 192535368
Test: atest TetheringCoverageTests TetheringIntegrationTests \
          CtsTetheringTest
Change-Id: I248a533651984de81f676336c0e74e3788610bbb

Remi NGUYEN VAN   commited 2021-08-02 19:13:09 +09:00
0015f04ec7
Test Entitlement when telephony is present
bug: 187331752
Test: atest android.tethering.test.TetheringManagerTest
Change-Id: I9fbb7141691fbbf8685b46359c050e0385928805

Gaurav Sarode   commited 2021-06-11 13:53:38 -07:00
e0e656c9b3
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 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
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
Set noparent in connectivity CTS owners
Also reorganize the files to have one toplevel CTS owners file, and only
additional owners in subdirectories.

Change-Id: I28ce193896e1ade2034589327805870774a4d608
Test: m

Remi NGUYEN VAN   commited 2020-12-03 08:07:32 +00:00
d01761e07f
Don't run hotspot related tests if Soft AP is not supported
Also explicitly hold ACCESS_WIFI_STATE permission to avoid
no permission problem when using WifiManager#getScanResults
without shell identity.

Fix: 169219565
Test: "atest CtsTetheringTest" in cuttlefish and phyical device

Change-Id: I3d8fa7e8882bf96f61f3316a70efdf991addbcb2

markchien   commited 2020-10-29 11:10:46 +08:00
8705535e40
Migrate Tethering util functions to CtsTetheringUtils
Bug: 166057846
Bug: 170265597
Test: atest MtsTetheringTest
      atest CtsTetheringTest
Change-Id: I59d529cb50b4b6cdafc6be78ad61a55ee1be0404

markchien   commited 2020-10-16 17:11:20 +08:00
2888ab7bc7
Don't wait for unnecessary disconnect broadcast
testTetheringUpstream does not require WIFI to be default
network since the test disconnects WIFI and verifies that
tethering use cellular network to be its upstream. Test only
needs to ensure WIFI is disconnected so the broadcast is not
necessary. Change to alternative method that does not wait for
disconnect broadcast to prevent flaky caused by unvalidated
wifi network.

Bug: 168217651
Test: atest TetheringManagerTest
Change-Id: If74fcad192cb4d4947ac2c99cd9ea2d3971d2cac

Chiachang Wang   commited 2020-10-05 14:11:43 +08:00
b40f760f8d
Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Id9ba142af9d2da12bda66d0c376d4b8c13f1503b
Change-Id: I1a1bdaabd06f43b695ac94172a6f46d00b7f5b84

Xin Li   commited 2020-08-29 01:22:07 -07:00
9d04ab0a42
Move some utils to a more appropriate package/directory
Test: builds
Change-Id: Id0f0f89c34502deb6d0e50503e5534fcc51c3f9b

Chalard Jean   commited 2020-07-29 21:15:43 +09:00
71b829649f
Merge "Don't run testRequestLatestEntitlementResult if not supported" am: 1129c316fd am: 793308371d
Original change: https://android-review.googlesource.com/c/platform/cts/+/1352284

Change-Id: I46d2d005d1a26c45f36cb387faa079a09ce708e4

Mark Chien   authored and   Automerger Merge Worker   commited 2020-07-13 02:30:59 +00:00
cf750de87c
Merge "Don't run testRequestLatestEntitlementResult if not supported"
Mark Chien   authored and   Gerrit Code Review   commited 2020-07-10 07:06:56 +00:00
1129c316fd
Drop .stubs from android.test.[base|runner|mock].stubs
The .stubs library refer to the stub library of a java_sdk_library.
Since the name of the stub library is the implementation detail of the
build system, direct use of the name should be prohibited. Actually,
clients don't need to use the stub name directly because the build
system automatically redirects <name> to <name>.stubs.

Exempt-From-Owner-Approval: too many owners are involved. This is a
simple build script change.

Bug: 157007292
Test: m
Merged-In: I32502de3d87c5cfdbbcfe5545dd7db5e9bb551a7
(cherry picked from commit 89c4e06853f7ea4b5a62a3b02b4f5113617b2c60)
Change-Id: I32502de3d87c5cfdbbcfe5545dd7db5e9bb551a7

Jiyong Park   commited 2020-07-01 17:17:28 +09:00
616e299222
Don't run testRequestLatestEntitlementResult if not supported
If tethering is not supported, skip testRequestLatestEntitlementResult
which test TetheringManager#requestLatestTetheringEntitlementResult
API.

Bug: 159869957
Test: atest CtsTetheringTest
Change-Id: I65c32d5bc26f18f8c9d91593ab0c178e69e75c39

markchien   commited 2020-06-30 17:04:58 +08:00
b589520368
Drop .stubs from android.test.[base|runner|mock].stubs
The .stubs library refer to the stub library of a java_sdk_library.
Since the name of the stub library is the implementation detail of the
build system, direct use of the name should be prohibited. Actually,
clients don't need to use the stub name directly because the build
system automatically redirects <name> to <name>.stubs.

Exempt-From-Owner-Approval: too many owners are involved. This is a
simple build script change.

Bug: 157007292
Test: m
Merged-In: I32502de3d87c5cfdbbcfe5545dd7db5e9bb551a7
(cherry picked from commit 4072d4d5d4)
Change-Id: I32502de3d87c5cfdbbcfe5545dd7db5e9bb551a7

Jiyong Park   commited 2020-06-29 22:56:28 +09:00
82bb526062
Merge "Fix CtsTetheringTest on devices without permanent softAp interfaces." am: 10f23078c1 am: 9d3ae2e188
Original change: https://android-review.googlesource.com/c/platform/cts/+/1331096

Change-Id: I0eb4c872456981e346d95d57bc2e69cc327342bf

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-06-15 10:18:21 +00:00
174f529ce4
Fix CtsTetheringTest on devices without permanent softAp interfaces.
Normally stop wifi tethering flow would be:
Tethering#stopTethering -> WifiManager#stopSoftAp -> softAp disabled,
then have WIIF_AP_STATE_CHANGED intent -> stop IpServer and broadcast
TETHER_STATE_CHANGED intent. SoftAp is disabled before tethering stop.

Because tethering would shutdown the corresponding IpServer if it
observed the interface is removed. For those devices that softAp
interface would be removed when stop tethering, the flow may be
Tethering#stopTethering -> WifiManager#stopSoftAp -> softAp disabing,
softAp interface is removed -> tethering trigger stop IpServer and
broadcast TETHER_STATE_CHANGED intent -> -> softAp disabled, then wifi
broadcast WIIF_AP_STATE_CHANGED intent. In this case, tethering is
stopped ready before softap is disabled.
For this case, CtsTeteringTest would have race between two test cases.
If two case need to start wifi tethering for testing and stop wifi
tethering after finish testing.
The second test may suffer from startTethering fail problem due to
softAP is not disabled yet.
    E WifiService: Tethering is already active.

Bug: 157806780
Test: atest CtsTetheringTest

Change-Id: I0ba6bc9dcbf7829dcad5561c707d5f5c5540f10b

markchien   commited 2020-06-15 13:42:40 +08:00
24d8b8391e
Merge "Fix TetheringManagerTest failure when using entitlement required SIM" am: 1691078821 am: fbd2113de5
Original change: undetermined

Change-Id: I444f59070783f1fdf06e044bfa2a488b35a1cfdf

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-06-02 03:07:47 +00:00
b2d14f1589
Fix TetheringManagerTest failure when using entitlement required SIM
If run tethering cts with entitlement required SIM, the test would
failure due to no tethering upstream. Tethering would default start
with UI base entitlement check which would have interfactive UI pop
up. Tethering's upstream is blocked because entitlement UI is keep
waiting for action till timeout.
To avoid UI interaction, start tethering with silent entitlement
check.

Bug: 156714671
Test: atest CtsTetheringTest
Change-Id: I85299841d60afba97ffcc4ae908a85e51139319b

markchien   commited 2020-05-29 11:53:34 +08:00
f74fce0d0c
Merge "Fix testTetheringUpstream flaky" am: 555ca8801b am: 9b7abf01f0
Change-Id: I109ee7c2ce38152b459b65933b24058b1f4ae1f1

Treehugger Robot   authored and   Automerger Merge Worker   commited 2020-05-28 02:06:01 +00:00
d827fb64b3
Fix testTetheringUpstream flaky
testTetheringUpstream test case need cellular network. So it disable
wifi and getActiveNetwork to check whether current network is cellular.
But there is a race that call getActiveNetwork right away after
disconnect wifi. getActiveNetwork may return null because switching
network is not ready yet.

Bug: 156314879
Test: atest CtsTetheringTest

Change-Id: I6b433560fb27a3b4bd80c4198ccdb58a5be701b6

markchien   commited 2020-05-27 23:03:07 +08:00
47e3788e3e
Merge "Apply MainlineTestModuleController to tethering cts tests" into rvc-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2020-05-19 19:32:00 +00:00
eded3fd9be
Apply MainlineTestModuleController to tethering cts tests
to only run them when com.google.android.tethering is

installed on device. This does not change any existing CTS run.

The logic only applies when the test triggered by mts-tradefed

to make sure it runs appropriate set of tests against the device.

For example, the test will be skipped when running MTS on Q because

tethering and wifi are not on Q devices.

Bug: 154845935
Test: m mts && mts-tradefed run mts-tethering
Change-Id: I9e6bd60982d4ef67538ad506e7008366bbf35363

Chen Zhu   commited 2020-05-19 18:04:33 +00:00
f021c464fd
Address aosp/1272946 leftover comment
Verify that entitlement check bypass with TETHER_ERROR_NO_ERROR
response.

Bug: 152829363
Test: atests CtsTetheringTest
Change-Id: I6272d7b297bdf0e641612a09ffe12942cc2b42e1
Merged-In: I6272d7b297bdf0e641612a09ffe12942cc2b42e1
(cherry picked from commit 92133d472ffbe6301db00c93060d76d90cdd02d2, aosp/1307453)

Paul Hu   commited 2020-05-15 08:24:46 +00:00
30e4e9a202
Address aosp/1272946 leftover comment
Verify that entitlement check bypass with TETHER_ERROR_NO_ERROR
response.

Bug: 152829363
Test: atests CtsTetheringTest
Change-Id: I6272d7b297bdf0e641612a09ffe12942cc2b42e1

paulhu   commited 2020-05-11 15:27:35 +08:00
e5e8ae9e1b
Tag CtsTetheringTest for sim card required
Bug: 155598732
Test: atest CtsTetheringTest
Merged-In: I79f841682049707d7cc26bf1ecc3e5affc86d196
Change-Id: I79f841682049707d7cc26bf1ecc3e5affc86d196

Mark Chien   commited 2020-05-07 10:32:38 +00:00
a25d852b12
Tag CtsTetheringTest for sim card required
Bug: 155598732
Test: atest CtsTetheringTest
Change-Id: I79f841682049707d7cc26bf1ecc3e5affc86d196

markchien   commited 2020-05-06 14:55:29 +08:00
f941ae9c03
Add testTetheringUpstream cts test
If cellular is the mobile network, tethering should select it as
upstream. If DUN is required, tethering should use DUN as its upstream.

Bug: 153614366
Bug: 150644305
Test: atest CtsTetheringTest

Change-Id: Ief9c745322e8705c0e50185e749a81c5a9d20743
Merged-In: Ief9c745322e8705c0e50185e749a81c5a9d20743

markchien   commited 2020-04-24 22:31:01 +08:00
668dfa5998
Add testTetheringUpstream cts test
If cellular is the mobile network, tethering should select it as
upstream. If DUN is required, tethering should use DUN as its upstream.

Bug: 153614366
Bug: 150644305
Test: atest CtsTetheringTest

Change-Id: Ief9c745322e8705c0e50185e749a81c5a9d20743

markchien   commited 2020-04-24 22:29:43 +08:00
0420e692a7
Test legacy tether/untether API and onError callback
Test legacy tether/untether API behavior. tether() rely on downstream
setup ready for tethering. Currently the only user is bluetooth
tethering. For other tetherings, there is no guaranteed that calling
tether() can always switch given interface to tethered. Tethering
may callback with onError depend on the interface status. Caller
should use startTethering/stopTethering API instead of these
legacy APIs.

This change also change the precondition verification of startTethering.
If tethering interface got error last time, such interface would not
be reported as tetherable.

Bug: 150632712
Test: atest CtsTetheringTest
Change-Id: Ifb3a0618208ffd0ff224c60f377036bc22ba0565
Merged-In: Ifb3a0618208ffd0ff224c60f377036bc22ba0565

markchien   commited 2020-04-24 22:23:23 +08:00
a6b3b70278
Test legacy tether/untether API and onError callback
Test legacy tether/untether API behavior. tether() rely on downstream
setup ready for tethering. Currently the only user is bluetooth
tethering. For other tetherings, there is no guaranteed that calling
tether() can always switch given interface to tethered. Tethering
may callback with onError depend on the interface status. Caller
should use startTethering/stopTethering API instead of these
legacy APIs.

This change also change the precondition verification of startTethering.
If tethering interface got error last time, such interface would not
be reported as tetherable.

Bug: 150632712
Test: atest CtsTetheringTest
Change-Id: Ifb3a0618208ffd0ff224c60f377036bc22ba0565

markchien   commited 2020-04-24 21:16:06 +08:00
1a54afc5b1
Test enable tethering permission and stopAllTethering
1. Test whether start tethering is gated by suitable permission.
2. Test stopAllTethering

Bug: 153613718
Test: atest CtsTetheringTest

Merged-In: I38702886ea355e1aec8eb8ac404fdd46a44582e3
Change-Id: I38702886ea355e1aec8eb8ac404fdd46a44582e3

Mark Chien   commited 2020-04-23 14:48:03 +00:00
f46d6a1e8d
Merge "Test enable tethering permission and stopAllTethering"
Mark Chien   authored and   Gerrit Code Review   commited 2020-04-23 13:02:04 +00:00
34ec9b0db7