Commit Graph

1890 Commits

Author SHA1 Message Date
Treehugger Robot
22da660983 Merge "Test legacy tether/untether API and onError callback" am: c31694df4c am: b8e44e87b3
Change-Id: I8a6b617bd1e43e8689b92c00349bf72e155fd94d
2020-04-24 16:00:43 +00:00
Treehugger Robot
c31694df4c Merge "Test legacy tether/untether API and onError callback" 2020-04-24 15:29:44 +00: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
Yan Yan
f2d50ece98 Merge "Add CTS for EapSessionConfig" am: c7afaba688 am: b15c228d88
Change-Id: I3d2ee1aeba0c8473c71a41f3202da663707724f1
2020-04-24 00:39:39 +00:00
Yan Yan
b15c228d88 Merge "Add CTS for EapSessionConfig" am: c7afaba688
Change-Id: I51e89a5604d78c325a8a985b3144ae49734f9eb3
2020-04-24 00:25:31 +00:00
Yan Yan
c7afaba688 Merge "Add CTS for EapSessionConfig" 2020-04-24 00:00:43 +00:00
Yan Yan
8d5985e738 Merge "Create base class that sets up test network" am: c921e5075f am: a1c71f705b
Change-Id: I750675c3eafb2a28d554df163826b8ec86f03ca0
2020-04-23 22:52:51 +00:00
Yan Yan
1020e90c9a Merge "Make a copy of TunUtils and PacketUtils" am: dbe2adf308 am: 755a4b59b7
Change-Id: I42e2ccd1d5a884d0992f3f75468904799d4f3ec6
2020-04-23 22:52:40 +00:00
Yan Yan
a1c71f705b Merge "Create base class that sets up test network" am: c921e5075f
Change-Id: Ib5f5fd2bc54ad5c4866622f74f1c1d555fee5592
2020-04-23 22:37:28 +00:00
Yan Yan
755a4b59b7 Merge "Make a copy of TunUtils and PacketUtils" am: dbe2adf308
Change-Id: I8a268a878c089a98a1d9b73190ab0db6204b0746
2020-04-23 22:37:03 +00:00
Yan Yan
c921e5075f Merge "Create base class that sets up test network" 2020-04-23 22:19:21 +00:00
Yan Yan
dbe2adf308 Merge "Make a copy of TunUtils and PacketUtils" 2020-04-23 22:18:45 +00:00
Sudheer Shanka
8d7f5f0f9a Merge changes I05285811,I782f8a06,I7c5bf823,I7bb2a7e4
* changes:
  Ensure location is enabled before getting SSID.
  Fix a regression in how required properties are collected.
  Fix Error Prone errors
  Reland "Pull service dumps to help debug test failures."
2020-04-23 17:57:10 +00:00
evitayan
8cfc634bbc Create base class that sets up test network
This class will be extended by both IkeSessionParamsTest and
IkeSessionTestBase

Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: I98979758a7a684219e35c02ded93224ea172d44f
2020-04-23 10:40:49 -07:00
Mark Chien
f7963a7f35 Merge "Test enable tethering permission and stopAllTethering" am: 34ec9b0db7 am: 39a164dfd0
Change-Id: Ie5bef87706d63f4ea2c09c2a6161290e7c5a88a3
2020-04-23 13:28:22 +00:00
Mark Chien
34ec9b0db7 Merge "Test enable tethering permission and stopAllTethering" 2020-04-23 13:02:04 +00:00
evitayan
8af9ca27a2 Make a copy of TunUtils and PacketUtils
Temporarily make copies. Eventually will statically include the
source files in CtsIkeTestCases

Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: I7dd5c8b849f0d987fa6d76bc5a0bc1a7eed49b0d
2020-04-23 00:58:44 -07:00
Paul Hu
d7ac864ef1 Merge "Add TetheringCommonTests to CtsTetheringTest" am: e3ef038b64 am: 5401e02f81
Change-Id: If81301869acf7629e060c981fe214ef75e4f7bab
2020-04-23 03:08:16 +00:00
Paul Hu
e3ef038b64 Merge "Add TetheringCommonTests to CtsTetheringTest" 2020-04-23 02:45:23 +00:00
Sudheer Shanka
0ac91b4737 Ensure location is enabled before getting SSID.
When location is disabled, Wi-Fi scan results and SSID are not available
to apps.

Fixes: 153850762
Fixes: 153396893
Test: atest hostsidetests/net/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Change-Id: I05285811d7131e116d5e1d072137ed2cf9576d05
Merged-In: I05285811d7131e116d5e1d072137ed2cf9576d05
2020-04-22 14:37:45 -07:00
Sudheer Shanka
a6a1ad183e Fix a regression in how required properties are collected.
+ Enable app standby mode before running the tests.

Fixes: 147459100
Fixes: 117169751
Test: atest hostsidetests/net/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Test: cts-tradefed run singleCommand cts-on-gsi --skip-device-info \
      --skip-preconditions -m CtsHostsideNetworkTests \
      -t com.android.cts.net.HostsideRestrictBackgroundNetworkTests

Change-Id: I782f8a06922622d28f9a9d5c9f2afa2b12f8aa80
Merged-In: I782f8a06922622d28f9a9d5c9f2afa2b12f8aa80
2020-04-22 13:59:46 -07:00
Sudheer Shanka
39cc315273 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/net/app/src/com/android/cts/net/hostside/RequiredPropertiesRule.java:61: error: [CollectionIncompatibleType] Argument '~requiredProperty.getValue()' should not be passed to this method; its type int is not compatible with its collection's type argument Property

Bug: 146455923
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I7c5bf823bf371902285ce3ee3929796fa40c653b
Merged-In: I48b1ccb61c807d0b41a165298ef5981258d6656e
2020-04-22 13:52:12 -07:00
Sudheer Shanka
1206400ccf Reland "Pull service dumps to help debug test failures."
+ Convert tests to use Junit4
+ Add annotations to specify required conditions for the test to run.

This reverts commit 89099548f8.

Bug: 137859686
Change-Id: I7bb2a7e4b2dca3696761e7c030f3380b9226b676
Merged-In: I93317c201a0ea06732e29154ab7e140735381f59
2020-04-22 12:27:50 -07:00
Treehugger Robot
8f4fe7b880 Merge "Update logic for checking NetworkSpecifier" am: eef8bc2050 am: 22bda590b7
Change-Id: If4ff3a3afc0385aed66ac954340b7d19f8396ccf
2020-04-22 16:36:52 +00:00
Chiachang Wang
6f63ef0e47 Update logic for checking NetworkSpecifier
We cannot test using WifiNetworkSpecifier, because the matching
behaviour for null WifiNetworkSpecifier changed between Q and R.
Replace WifiNetworkSpecifier with MatchAllNetworkSpecifier and
TelephonyNetworkSpecifier that behave the same in both Q and R
to verify.

Bug: 154451660
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkRequestTest
      on aosp and internal build
Change-Id: I14e2a5e629051e243f3b892b608cb1c6195cd8ed
2020-04-22 22:18:50 +08:00
Chiachang Wang
8167ede0fd Merge "Check target transport type for meterness change" am: ac551dff33 am: 63592fd781
Change-Id: I59bcca1b2bcbbf7991139a25350359eacba945e3
2020-04-22 06:22:55 +00:00
Lucas Lin
6ca20ffe6d Merge "Revert "Pull service dumps to help debug test failures."" 2020-04-22 05:56:52 +00:00
Chiachang Wang
6aac2067f6 Check target transport type for meterness change
When test case updates the wifi network from unmetered to
metered, test case will wait for wifi network reconnect.
However, if other metered networks are also connected at
the same time, test case may mis-take the network as the
target network. Thus, add transport type check to ensure
the transport type of the network is the expected one.

Bug: 153400606
Test: atest CtsNetTestCasesLatestSdk:\
      android.net.cts.ConnectivityManagerTest#\
      testGetMultipathPreference
Change-Id: I75dab1a00bbe1a1c75b548a6ce4ae3eacd325d92
2020-04-22 05:51:39 +00:00
Tony Huang
89099548f8 Revert "Pull service dumps to help debug test failures."
This reverts commit e3711ae317.

Reason for revert: Might cause build break on errorprone branch

Change-Id: Iddece3edf4b1e96fafb8b36282f58410a2476025
2020-04-22 04:31:43 +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
evitayan
9d364b6aea Add CTS for EapSessionConfig
Bug: 148689509
Test: atest CtsIkeTestCases
Change-Id: I54dedff0555bdfcaae390ddde7b05d24dfabe9b0
2020-04-21 11:24:41 -07:00
Sudheer Shanka
e3711ae317 Pull service dumps to help debug test failures.
+ Convert tests to use Junit4
+ Add annotations to specify required conditions for the test to run.

Bug: 137859686
Test: atest hostsidetests/net/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Test: atest hostsidetests/net/src/com/android/cts/net/HostsideNetworkCallbackTests.java
Change-Id: I93317c201a0ea06732e29154ab7e140735381f59
Merged-In: I93317c201a0ea06732e29154ab7e140735381f59
2020-04-21 14:29:19 +00:00
Remi NGUYEN VAN
26e64df41a Merge "Fix test initialization errors on Q" am: 8b5e3031fa am: 2fcbc1b8ad
Change-Id: I2df5d37f74529e0fafae7f580c0795f30ab8959f
2020-04-21 12:42:37 +00:00
Remi NGUYEN VAN
8b5e3031fa Merge "Fix test initialization errors on Q" 2020-04-21 12:07:03 +00:00
Remi NGUYEN VAN
a7f8f2d01c Fix test initialization errors on Q
ConnectivityDiagnosticsManagerTest, MultinetworkApiTest,
NetworkAgentTest crashed before the runner could start them:
 - Ignore ConnectivityDiagnosticsManagerTest on Q: it tests an API that
   was introduced in R.
 - Build JNI libraries used by MultinetworkApiTest against the NDK to
   avoid errors loading the libraries on older platforms, when
   transitive dependencies have been added.
 - Do not attempt to override Handler#getLooper() (which is final) in
   NetworkAgentTest; it appears to have been overridden by accident by
   specifying "val looper" in the TestableNetworkAgent definition, which
   generates a getter.

Test: atest CtsNetTestCasesLatestSdk:ConnectivityDiagnosticsManagerTest
      atest CtsNetTestCasesLatestSdk:MultinetworkApiTest
      atest CtsNetTestCasesLatestSdk:NetworkAgentTest
Bug: 150918852
Change-Id: I262b54c6897ed755adaeb2b118c638320634f7a1
2020-04-21 15:16:44 +09:00
Junyu Lai
fd43b2d3e8 Merge "Remove upper bound check of getTotal* APIs in TrafficStatsTest" am: 9eba1b2c1b am: e331edcd23
Change-Id: I22edc46039bf35e544d9ce8a9f3a00b713478e05
2020-04-21 03:46:08 +00:00
Junyu Lai
9eba1b2c1b Merge "Remove upper bound check of getTotal* APIs in TrafficStatsTest" 2020-04-21 03:07:58 +00:00
Remi NGUYEN VAN
a8b5e991f0 Merge "Skip new UrlQuerySanitizer tests on Q" into rvc-dev am: f9a56e671b
Change-Id: Id256409f395859b010ca09bcf8e91737f22eeac9
2020-04-21 01:42:18 +00: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
Chiachang Wang
b14bd1af58 Merge "Update network object when wifi meterness is changed" am: db0b1c13e5 am: 7c111f53bf
Change-Id: I7ec9f0b04fa8b5a77cc7856359171134b9ec7e35
2020-04-20 14:13:04 +00:00
Chiachang Wang
db0b1c13e5 Merge "Update network object when wifi meterness is changed" 2020-04-20 13:35:54 +00:00
Remi NGUYEN VAN
958e8d1ceb Skip new UrlQuerySanitizer tests on Q
The tests verify behavior that was only fixed on R, but
UrlQuerySanitizerTest is part of MTS which needs to pass on Q.

Test: atest CtsNetTestCasesLatestSdk:UrlQuerySanitizerTest
Bug: 150904735
Change-Id: I214b2fd8a45732a41e8604db70c83a8e3f4a45e4
2020-04-20 18:51:17 +09:00
junyulai
5cfd8d6bb1 Remove upper bound check of getTotal* APIs in TrafficStatsTest
Currently, this cause flakiness since some background traffic
was counted when performing tests, or the traffic generated by
adb over network. While there is no good way to filter out all
reasonable cases, disable the upper bound checks.

Test: atest TrafficStatsTest
Bug: 142978584
Change-Id: I8140310c9caeff6069d1f55590bf40f83bf211e4
2020-04-20 15:44:32 +08:00
Chiachang Wang
21ec1de1ff Update network object when wifi meterness is changed
The new wifi disconnect behavior is introduced. When wifi
network is changed from unmetered to metered, the wifi
network will disconnect and reconnect. Update the test to
verify the same SSID wifi is connected and also update the
target network to verfiy the metered preference.

Bug: 153400606
Test: atest CtsNetTestCases:android.net.cts.ConnectivityManagerTest\
      #testGetMultipathPreference
Change-Id: Ic298d3d85d8c6b77c8df7614a945f2c22dcdff38
2020-04-20 09:50:17 +08:00
Aaron Huang
02c5d57e96 Merge "Move DhcpInfoTest to FrameworksNetCommonTests" am: 12b24407cf am: 4685ca6b06
Change-Id: Ic293c1af3f90f1e1224fc12289c984786814db80
2020-04-17 15:18:30 +00:00
Aaron Huang
12b24407cf Merge "Move DhcpInfoTest to FrameworksNetCommonTests" 2020-04-17 14:35:41 +00:00
Aaron Huang
d1e528ae9c Add test for NetworkRequest#getRequestorUid()
Add test for new API.

Bug: 151110379
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkRequestTest
Change-Id: I9602cac142b3e45d12e66a6f3f35ab594e6590c1
Merged-In: I9602cac142b3e45d12e66a6f3f35ab594e6590c1
2020-04-17 14:32:26 +00:00
Aaron Huang
dacbdaa378 Add tests for NetworkRequest API
This change inculdes coverage of NetworkRequest#Builder().clearCapabilities()
and NetworkRequest#getRequestorPackageName()

Bug: 153614623
Test: atest CtsNetTestCasesLatestSdk:android.net.cts.NetworkRequestTest
Change-Id: Id4e31013cfae78c25abd27b557da4e3e9487870c
Merged-In: Id4e31013cfae78c25abd27b557da4e3e9487870c
2020-04-17 14:31:31 +00:00
Aaron Huang
48e0812796 Move DhcpInfoTest to FrameworksNetCommonTests
Move to frameworks/base/tests/net/common so that it can
be run in cts test and presubmit test.

Bug: 154299158
Test: atest CtsNetTestCasesLatestSdk:android.net.DhcpInfoTest
Change-Id: I8d70565fe3388fd8351002f2ed87c43343879e57
2020-04-17 17:48:53 +08:00
TreeHugger Robot
301d2c4f10 Merge "Add EntitlementResult CTS tests" into rvc-dev 2020-04-17 08:02:21 +00:00