Commit graph android_packages_modules_Co.../tests/cts/tethering
Message SHA1
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
Add TetheringCommonTests to CtsTetheringTest
Bug: 153614365
Bug: 153613717
Test: atest CtsTetheringTest
Change-Id: I26c06d522ef2935deb2b1abbd3c5b6be97a48a27
Merged-In: I26c06d522ef2935deb2b1abbd3c5b6be97a48a27
(cherry picked from commit 9903c8a61b, aosp/1292434)

Paul Hu   commited 2020-04-23 05:44:02 +00:00
11fec376f5
Add TetheringCommonTests to CtsTetheringTest
Bug: 153614365
Bug: 153613717
Test: atest CtsTetheringTest
Change-Id: I26c06d522ef2935deb2b1abbd3c5b6be97a48a27

paulhu   commited 2020-04-22 10:25:11 +08:00
6f203abeab
Test enable tethering permission and stopAllTethering
1. Test whether start tethering is gated by suitable permission.
2. Test stopAllTethering

Bug: 153613718
Test: atest CtsTetheringTest

Change-Id: I38702886ea355e1aec8eb8ac404fdd46a44582e3

markchien   commited 2020-04-20 22:44:43 +08:00
257cad8052
Merge "Add EntitlementResult CTS tests" into rvc-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2020-04-17 08:02:21 +00:00
301d2c4f10
Add more tests to CtsTetheringTest
Add TetheringIntegrationTests into CtsTetheringTest

Bug: 148636687
Test: atest CtsTetheringTest
      atest TetheringIntegrationTests
Change-Id: I606097a8db9ed3d2b3eaf933bb1d904e437ab27d
Merged-In: I606097a8db9ed3d2b3eaf933bb1d904e437ab27d
(cherry picked from commit 1f7305c9740a7a1a724c4023f8c55ce827391f73, aosp/1280233)

Treehugger Robot   authored and   Paul Hu   commited 2020-04-17 07:22:24 +00:00
685f072bfd
Add EntitlementResult CTS tests
Test APIs below:
requestLatestTetheringEntitlementResult(int, boolean,
  java.util.concurrent.Executor,
  android.net.TetheringManager.OnTetheringEntitlementResultListener)
requestLatestTetheringEntitlementResult(int,
  android.os.ResultReceiver, boolean)
OnTetheringEntitlementResultListener.onTetheringEntitlementResult(int)

Bug: 152829363
Test: atests CtsTetheringTest
Change-Id: Icf0d9cacd97eeaa7ceb78f4924c5a6be6e588b30
Merged-In: Icf0d9cacd97eeaa7ceb78f4924c5a6be6e588b30
(cherry picked from commit 4bed8dff67d4a6824098188cd9602668d8705a7e, aosp/1272946)

Treehugger Robot   authored and   Paul Hu   commited 2020-04-17 07:20:06 +00:00
8d10ebe3d7
Merge "Add more tests to CtsTetheringTest"
Treehugger Robot   authored and   Gerrit Code Review   commited 2020-04-17 05:04:53 +00:00
d9b892c147
Add more tests to CtsTetheringTest
Add TetheringIntegrationTests into CtsTetheringTest

Bug: 148636687
Test: atest CtsTetheringTest
      atest TetheringIntegrationTests
Change-Id: I606097a8db9ed3d2b3eaf933bb1d904e437ab27d

paulhu   commited 2020-04-16 20:20:08 +08:00
85f0fca1f0
Add EntitlementResult CTS tests
Test APIs below:
requestLatestTetheringEntitlementResult(int, boolean,
  java.util.concurrent.Executor,
  android.net.TetheringManager.OnTetheringEntitlementResultListener)
requestLatestTetheringEntitlementResult(int,
  android.os.ResultReceiver, boolean)
OnTetheringEntitlementResultListener.onTetheringEntitlementResult(int)

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

paulhu   commited 2020-04-16 11:12:56 +08:00
3936e08f65
Add TetheringEventCallback CTS test
Test APIs below:
onOffloadStatusChanged(int)

Bug: 153619369
Test: atests CtsTetheringTest
Change-Id: Ia7edd0d3d8184e30373ac8b657299107ff9b4c1e
Merged-In: Ia7edd0d3d8184e30373ac8b657299107ff9b4c1e
(cherry picked from commit c1153b7348dac9d4f0b0ad89acf17e52d00e83b9, aosp/1284554)

Paul Hu   commited 2020-04-16 01:37:31 +00:00
1e16d9862c
Merge "Add TetheringEventCallback CTS test"
Paul Hu   authored and   Gerrit Code Review   commited 2020-04-15 10:32:27 +00:00
ca10520cbf
Merge "Add tethering CTS owners." into rvc-dev
Chalard Jean   authored and   Android (Google) Code Review   commited 2020-04-14 15:41:12 +00:00
b8fb9028ce
Add TetherableInterfaceRegexps CTS tests
Test APIs below:
getTetherableWifiRegexs()
getTetherableUsbRegexs()
getTetherableBluetoothRegexs()
TetheringInterfaceRegexps.getTetherableWifiRegexs()
TetheringInterfaceRegexps.getTetherableUsbRegexs()
TetheringInterfaceRegexps.getTetherableBluetoothRegexs()

Bug: 152737526
Test: atest CtsTetheringTest
Change-Id: Icb7d8718d0aa6574b4c9dd1e17d7feb300fad2aa
Merged-In: Icb7d8718d0aa6574b4c9dd1e17d7feb300fad2aa
(cherry picked from commit 9f11d903a1d8cc6705481360bae4fb97cfbb966d, aosp/1271822)

Paul Hu   commited 2020-04-14 11:23:49 +00:00
9849d899e8
Add TetheringEventCallback CTS test
Test APIs below:
onOffloadStatusChanged(int)

Bug: 153619369
Test: atests CtsTetheringTest
Change-Id: Ia7edd0d3d8184e30373ac8b657299107ff9b4c1e

paulhu   commited 2020-04-14 19:12:46 +08:00
7f1975092f