Commit Graph

59 Commits

Author SHA1 Message Date
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
Remi NGUYEN VAN
d01761e07f 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
2020-12-03 08:07:32 +00:00
markchien
8705535e40 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
2020-10-29 11:10:46 +08:00
markchien
2888ab7bc7 Migrate Tethering util functions to CtsTetheringUtils
Bug: 166057846
Bug: 170265597
Test: atest MtsTetheringTest
      atest CtsTetheringTest
Change-Id: I59d529cb50b4b6cdafc6be78ad61a55ee1be0404
2020-10-16 17:11:20 +08:00
Chiachang Wang
b40f760f8d 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
2020-10-05 14:11:43 +08:00
Xin Li
9d04ab0a42 Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Id9ba142af9d2da12bda66d0c376d4b8c13f1503b
Change-Id: I1a1bdaabd06f43b695ac94172a6f46d00b7f5b84
2020-08-29 01:22:07 -07:00
Chalard Jean
71b829649f Move some utils to a more appropriate package/directory
Test: builds
Change-Id: Id0f0f89c34502deb6d0e50503e5534fcc51c3f9b
2020-07-29 21:15:43 +09:00
Mark Chien
cf750de87c 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
2020-07-13 02:30:59 +00:00
Mark Chien
1129c316fd Merge "Don't run testRequestLatestEntitlementResult if not supported" 2020-07-10 07:06:56 +00:00
Jiyong Park
616e299222 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
2020-07-01 17:17:28 +09:00
markchien
b589520368 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
2020-06-30 17:04:58 +08:00
Jiyong Park
82bb526062 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
2020-06-29 22:56:28 +09:00
Treehugger Robot
174f529ce4 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
2020-06-15 10:18:21 +00:00
markchien
24d8b8391e 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
2020-06-15 13:42:40 +08:00
Treehugger Robot
b2d14f1589 Merge "Fix TetheringManagerTest failure when using entitlement required SIM" am: 1691078821 am: fbd2113de5
Original change: undetermined

Change-Id: I444f59070783f1fdf06e044bfa2a488b35a1cfdf
2020-06-02 03:07:47 +00:00
markchien
f74fce0d0c 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
2020-05-29 11:53:34 +08:00
Treehugger Robot
d827fb64b3 Merge "Fix testTetheringUpstream flaky" am: 555ca8801b am: 9b7abf01f0
Change-Id: I109ee7c2ce38152b459b65933b24058b1f4ae1f1
2020-05-28 02:06:01 +00:00
markchien
47e3788e3e 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
2020-05-27 23:03:07 +08:00
TreeHugger Robot
eded3fd9be Merge "Apply MainlineTestModuleController to tethering cts tests" into rvc-dev 2020-05-19 19:32:00 +00:00
Chen Zhu
f021c464fd 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
2020-05-19 18:04:33 +00:00
Paul Hu
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
Merged-In: I6272d7b297bdf0e641612a09ffe12942cc2b42e1
(cherry picked from commit 92133d472ffbe6301db00c93060d76d90cdd02d2, aosp/1307453)
2020-05-15 08:24:46 +00:00
paulhu
e5e8ae9e1b Address aosp/1272946 leftover comment
Verify that entitlement check bypass with TETHER_ERROR_NO_ERROR
response.

Bug: 152829363
Test: atests CtsTetheringTest
Change-Id: I6272d7b297bdf0e641612a09ffe12942cc2b42e1
2020-05-11 15:27:35 +08:00
Mark Chien
a25d852b12 Tag CtsTetheringTest for sim card required
Bug: 155598732
Test: atest CtsTetheringTest
Merged-In: I79f841682049707d7cc26bf1ecc3e5affc86d196
Change-Id: I79f841682049707d7cc26bf1ecc3e5affc86d196
2020-05-07 10:32:38 +00:00
markchien
f941ae9c03 Tag CtsTetheringTest for sim card required
Bug: 155598732
Test: atest CtsTetheringTest
Change-Id: I79f841682049707d7cc26bf1ecc3e5affc86d196
2020-05-06 14:55:29 +08:00
markchien
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
Merged-In: Ief9c745322e8705c0e50185e749a81c5a9d20743
2020-04-24 22:31:01 +08:00
markchien
0420e692a7 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
2020-04-24 22:29:43 +08:00
markchien
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
Merged-In: Ifb3a0618208ffd0ff224c60f377036bc22ba0565
2020-04-24 22:23:23 +08:00
markchien
1a54afc5b1 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
2020-04-24 21:16:06 +08:00
Mark Chien
f46d6a1e8d 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
2020-04-23 14:48:03 +00:00
Mark Chien
34ec9b0db7 Merge "Test enable tethering permission and stopAllTethering" 2020-04-23 13:02:04 +00:00
Paul Hu
11fec376f5 Add TetheringCommonTests to CtsTetheringTest
Bug: 153614365
Bug: 153613717
Test: atest CtsTetheringTest
Change-Id: I26c06d522ef2935deb2b1abbd3c5b6be97a48a27
Merged-In: I26c06d522ef2935deb2b1abbd3c5b6be97a48a27
(cherry picked from commit 9903c8a61b, aosp/1292434)
2020-04-23 05:44:02 +00:00
paulhu
6f203abeab Add TetheringCommonTests to CtsTetheringTest
Bug: 153614365
Bug: 153613717
Test: atest CtsTetheringTest
Change-Id: I26c06d522ef2935deb2b1abbd3c5b6be97a48a27
2020-04-22 10:25:11 +08:00
markchien
257cad8052 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
2020-04-20 22:44:43 +08:00
TreeHugger Robot
301d2c4f10 Merge "Add EntitlementResult CTS tests" into rvc-dev 2020-04-17 08:02:21 +00:00
Treehugger Robot
685f072bfd 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)
2020-04-17 07:22:24 +00:00
Treehugger Robot
8d10ebe3d7 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)
2020-04-17 07:20:06 +00:00
Treehugger Robot
d9b892c147 Merge "Add more tests to CtsTetheringTest" 2020-04-17 05:04:53 +00:00
paulhu
85f0fca1f0 Add more tests to CtsTetheringTest
Add TetheringIntegrationTests into CtsTetheringTest

Bug: 148636687
Test: atest CtsTetheringTest
      atest TetheringIntegrationTests
Change-Id: I606097a8db9ed3d2b3eaf933bb1d904e437ab27d
2020-04-16 20:20:08 +08:00
paulhu
3936e08f65 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
2020-04-16 11:12:56 +08:00
Paul Hu
1e16d9862c 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)
2020-04-16 01:37:31 +00:00
Paul Hu
ca10520cbf Merge "Add TetheringEventCallback CTS test" 2020-04-15 10:32:27 +00:00
Chalard Jean
b8fb9028ce Merge "Add tethering CTS owners." into rvc-dev 2020-04-14 15:41:12 +00:00
Paul Hu
9849d899e8 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)
2020-04-14 11:23:49 +00:00
paulhu
7f1975092f Add TetheringEventCallback CTS test
Test APIs below:
onOffloadStatusChanged(int)

Bug: 153619369
Test: atests CtsTetheringTest
Change-Id: Ia7edd0d3d8184e30373ac8b657299107ff9b4c1e
2020-04-14 19:12:46 +08:00
Paul Hu
b647a5b483 Merge "Add TetherableInterfaceRegexps CTS tests" 2020-04-14 08:18:27 +00:00
Treehugger Robot
5eaf009a92 Add tethering CTS owners.
Test: none
Bug: 153921802
Change-Id: I0651e7fa2a705b553f2d24ca573936c28591bb84
Merged-In: I552b3bf8d79c4e4480396edc201b51ec5901b87b
(cherry picked from commit 7f210a41827742b1448a82d093a651898f40ad2e)
2020-04-14 03:05:22 +00:00
Chalard Jean
9e5d061d73 Add tethering CTS owners.
Test: none
Change-Id: I552b3bf8d79c4e4480396edc201b51ec5901b87b
2020-04-13 17:40:32 +09:00
Mark Chien
bbd10f21a0 Add testRegisterTetheringEventCallback for CtsTetheringTest
Bug: 150632712
Bug: 150631563
Test: atest CtsTetheringTest

Merged-In: I55895c8b26acb7ec905d75d1f4b2a8964b13187a
Change-Id: I55895c8b26acb7ec905d75d1f4b2a8964b13187a
2020-04-10 10:09:26 +00:00
paulhu
ed041b098a Add TetherableInterfaceRegexps CTS tests
Test APIs below:
getTetherableWifiRegexs()
getTetherableUsbRegexs()
getTetherableBluetoothRegexs()
TetheringInterfaceRegexps.getTetherableWifiRegexs()
TetheringInterfaceRegexps.getTetherableUsbRegexs()
TetheringInterfaceRegexps.getTetherableBluetoothRegexs()

Bug: 152737526
Test: atest CtsTetheringTest
Change-Id: Icb7d8718d0aa6574b4c9dd1e17d7feb300fad2aa
2020-04-10 09:21:41 +08:00
markchien
64522ba4ea Add testRegisterTetheringEventCallback for CtsTetheringTest
Bug: 150632712
Bug: 150631563
Test: atest CtsTetheringTest

Change-Id: I55895c8b26acb7ec905d75d1f4b2a8964b13187a
2020-04-07 12:14:03 +08:00