Commit Graph

23 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
Paul Hu
a268611629 Add TetheringRequest CTS tests
Test APIs below:
TetheringRequest.getClientStaticIpv4Address()
TetheringRequest.getLocalIpv4Address()
TetheringRequest.getShouldShowEntitlementUi()
TetheringRequest.getTetheringType()
TetheringRequest.isExemptFromEntitlementCheck()
TetheringRequest.Builder(int)
TetheringRequest.Builder.build()
TetheringRequest.Builder.setExemptFromEntitlementCheck(boolean)
TetheringRequest.Builder.setShouldShowEntitlementUi(boolean)
TetheringRequest.Builder.setStaticIpv4Addresses( \
  android.net.LinkAddress, android.net.LinkAddress)

Bug: 150632842
Test: atest CtsTetheringTest
Change-Id: Ice5aefa1bacc1a635a7a79ce91d5d30ec5dcf335
Merged-In: Ice5aefa1bacc1a635a7a79ce91d5d30ec5dcf335
(cherry picked from commit 3780b3720ca19063e0d4c0372422f3105dc5bb86)
2020-04-03 14:18:15 +00:00
markchien
938c385872 Clean up for TetheringManager API change
Bug: 149858697
Bug: 151243337
Test: atest CtsTetheringTest
Change-Id: I817cb62f0f41d72e861952394ac8fbbfdc360f11
2020-03-19 12:43:34 +08:00
markchien
cdd2b36062 Fix testStartTetheringWithStateChangeBroadcast flaky
Before this change the test assume one active state event is followed by
zero or one availabe event:
AVAIALBE(wlan1) -> ACTIAVE(wlan1) -> AVAILALE(wlan1)

But actually Multiple tetherable wifi interfaces may be avaialbe during
the test:
AVAILABLE(wlan1) -> AVALIABLE(wlanX) -> .... -> ACTIVE(wlan1) ->
AVAIALBE(wlan1)

Additional, replacing ConnectivityManager usage to TetheringManager.

Bug: 148095484
Test: atest CtsTetheringTest
Change-Id: Id5db970c02f63f61802a18b599bf6905db619b42
2020-02-14 18:22:43 +08:00
jovanak
72a8efb9c0 CtsTetheringTest secondary_user
Marks this CTS test module as supporting secondary_user, meaning that
the tests are eligible to be run from a regular Android user other
than the system user (i.e. other than user 0).

Note that 'user' here refers to the concept of users in Android
Multiuser; it is NOT the same as a uid.

Bug: 141773058
Test: module passed with secondary_user params
 (--enable-optional-parameterization --module-parameter secondary_user)

Change-Id: I92d97cae99418dac3cd6e1cbb625b12f0c2cc60a
2020-01-14 16:18:41 -08:00
Colin Cross
284371356c Fix Error Prone errors
Soong wasn't including android_app or android_test sources in the
javac-check target used for the Error Prone build, which allowed
some Error Prone errors to get in.  Fix them so Error Prone can be
re-enabled for these targets.

Fixes:
cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/LockTaskHostDrivenTest.java:50: error: [JUnitAmbiguousTestClass] Test class inherits from JUnit 3's TestCase but has JUnit 4 @Test annotations.
cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/LockTaskTest.java:51: error: [JUnitAmbiguousTestClass] Test class inherits from JUnit 3's TestCase but has JUnit 4 @Test annotations.
cts/tests/tests/telephony/current/src/android/telephony/cts/CarrierServiceTest.java:34: error: [JUnitAmbiguousTestClass] Test class inherits from JUnit 3's TestCase but has JUnit 4 @Test annotations.
cts/tests/tests/tethering/src/android/tethering/cts/TetheringManagerTest.java:166: error: [ArrayToString] Calling toString on an array does not provide useful information
cts/tests/tests/tethering/src/android/tethering/cts/TetheringManagerTest.java:172: error: [ArrayToString] Calling toString on an array does not provide useful information

Bug: 146455923
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I949e409fd7ba80ab8937db1c08eaaaf9608b17ed
2019-12-18 14:08:48 -08:00
markchien
9ccf3d87fb Add mts tag to the build file for MTS testing
Bug: 145490751
Test: build, atest CtsTetheringTest
Change-Id: I993ce5ec89ab98de7eadaf6624a30a37851ca716
2019-12-18 11:55:32 +08:00
markchien
fb904c36de Create new CTS test for tethering
Initial CTS test for tethering.
This change test startTethering/stopTethering and check
status of TETHER_STATE_CHANGE intent.

Bug: 145490751
Test: atest CtsTetheringTest
Change-Id: Ia1ae3b6c2b68b009ca4deef840945186d472d99e
2019-12-16 19:53:15 +08:00