Commit Graph

1053 Commits

Author SHA1 Message Date
Jeff Vander Stoep
ff39f3fa71 Move tests requiring /proc/sys/net access to hostside
This access is going away for apps. Move these tests to hostside
tests to be executed by the shell domain.

Test: atest cts/hostsidetests/net/src/com/android/cts/net/ProcNetTest.java
Test: atest android.net.cts.ConnectivityManagerTest
Test: atest android.net.cts.IpSecSysctlTest
Test: atest android.net.cts.MultinetworkSysctlTest
Bug: 116053204
Change-Id: Id7e867184dd344a2d877515956e76019d627788b
2018-09-28 10:29:01 -07:00
Jeff Vander Stoep
ab53484d7b VpnTest: test getConnectionOwnerUid API
Test connection->UID resolution for both UDP and TCP connections.

Bug: 9496886
Bug: 109758967
Test: atest HostsideVpnTests
Change-Id: Ic17c64df74f65d788fd3d95a25af3c5b44946881
2018-09-18 15:40:32 -07:00
Xin Li
8bf03f3725 Merge pie-cts-dev into master.
Bug: 112051819
Merged-In: I904b9b00a6ef206e75a67a6374fc71d00f64be43
Change-Id: I474fc4c2cc2d4a57b3c781d4b2ac666ebe261450
2018-08-08 19:32:29 +00:00
Xin Li
f8c5b15037 Merge "Merge Android Pie into master" 2018-08-07 16:51:29 +00:00
Adam Vartanian
679ee7cbe7 CTS test for SslCertificate.getX509Certificate
Bug: 111696337
Bug: 36984840
Test: cts -m CtsNetTestCases -t android.net.http
Change-Id: I778a18fd3636efc1e60d61e6d2b78685635c07f8
2018-07-30 11:01:43 +01:00
Chenbo Feng
ac8ef7ce5c Merge "Skip the test if cannot open ctrl file"
am: 2ab9867d51

Change-Id: I813c36ecd545ee73cb05c28e1f444fc229084985
2018-07-26 21:06:31 -07:00
Chenbo Feng
cc7747d2de Skip the test if cannot open ctrl file
The shell access to the proc/xt_qtaguid/ctrl file is blocked in next
android release since no apps or users should directly read/write to
those proc files anymore. This CTS test is checking some critical kernel
behavior to make sure the xt_qtaguid module have specific kernel fixes.
So if the ctrl file is not accessible, there is no way to verify those
critical fixes, we can only skipped the test. These testcases are also
added in VTS qtaguid test so we can still check the devices have those
kernel fixes.

Bug: 110906349
Test: atest CtsNativeNetTestCases
Change-Id: Iae0512bb37f8b93577a134f15affb4f2a448be18
2018-07-26 18:53:23 -07:00
Neil Fuller
71286682ce Merge "Extend Uri tests"
am: 58f6083027

Change-Id: I659a205aeaea9910115ce48e98cd858e8e8423b7
2018-07-24 09:12:19 -07:00
Neil Fuller
d8eb370a89 Extend Uri tests
The internal UriCodec class is being removed from libcore/ and the
associated CTS tests are being removed. This change adds equivalent
URI decoding tests to the UriTest CTS test class.

Test: make droid && make cts
Test: run cts-dev -m CtsNetTestCases -t android.net.cts.UriTest
Bug: 111055375
Change-Id: Ided15d5abf8478064d193034e84c4dbe0689c6f0
2018-07-23 19:49:24 +01:00
Sudheer Shanka
841d4711be Use a different key for signing networkpolicy test app.
One of the preparation steps for running cts involves loading up the sim
card with the key used to sign CtsCarrierApiTestCases.apk. It
means if the same key is used for signing networkpolicy test app too,
then the app is considered as carrier privileged by the system and can't
be forced into app standby state.

Fixes: 80077890
Test: cts-tradefed run singleCommand cts-dev -m CtsHostsideNetworkTests -t \
      com.android.cts.net.HostsideRestrictBackgroundNetworkTests#testDataSaverMode_disabled

Change-Id: Iaa9f4fabe83430fa42b6f67c1025db41a5e1d938
2018-06-19 19:35:00 -07:00
Etan Cohen
eeea3d5510 [RTT][CTS] Add information to assert to help debug failures
Modify the assert message to print out the # of failures and the total
number of iterations. Will help diagnose scope of test failures.

Bug: 109836816
Test: atest WifiRttTest
Change-Id: Ic4d5b6844225edbd9704694c539e31754b7a340c
2018-06-14 08:51:43 -07:00
Lorenzo Colitti
78f8585339 Wait a few seconds for IPv6 connectivity to appear.
Currently, DnsTest immediately executes a DNS lookup as soon as
it starts. If the device has just connected to a network - as it
might if the test framework has just enabled wifi - and IPv6
connectivity is not yet available, the test will fail with little
proof that the network doesn't have IPv6.

Fix this by waiting for IPv6 connectivity and by adding the
active LinkProperties to the failure message.

Bug: 109670546
Test: DnsTest passes on dual-stack network
Test: DnsTest fails on IPv4-only network
Change-Id: I88b8d001f08fe41af666bccf8094c67729dda9c2
2018-06-05 16:12:41 +09:00
Sudheer Shanka
cd670e7957 Update charge level too when turning battery off.
BATTERY_CHARGING which triggers the parole state
will only be sent if the level is > 90.

Change-Id: I1073e473c27eb5d29744f4a967771392729b4e1a
Fixes:80534062
Test: Verified that updating the level activates the parole mode.
2018-05-31 11:43:40 -07:00
Sudheer Shanka
4ca791b07b Merge "Update turnBatteryOff to include changing charging status too." into pi-dev 2018-05-23 01:42:05 +00:00
Sudheer Shanka
b3c2dad1eb Merge "CtsHostsideNetworkTests: Skip unsupported tests." into pi-dev 2018-05-23 01:33:08 +00:00
Sudheer Shanka
1b3cc387bf Update turnBatteryOff to include changing charging status too.
AppStandbyController is now listening to BatteryManager.ACTION_CHARGING
for starting parole state and this broadcast won't be sent immediately
after plugging in the device. So, update the charging status too which is
going to trigger this broadcast and parole state can be started
immediately.

Bug: 80109076
Test: cts-tradefed run singleCommand cts-dev -m CtsHostsideNetworkTests -t \
      com.android.cts.net.HostsideRestrictBackgroundNetworkTests

Change-Id: I6f19f7a509ec48e96eaea4b188262d5a9735edf1
2018-05-22 14:18:10 -07:00
Sudheer Shanka
926a3cb026 CtsHostsideNetworkTests: Skip unsupported tests.
If appStandby is not enabled, then
testAppIdleAndBatterySaver_tempPowerSaveWhitelists is not supported.

Fixes: 79942156
Test: cts-tradefed run singleCommand cts-dev -m CtsHostsideNetworkTests -t \
      com.android.cts.net.HostsideRestrictBackgroundNetworkTests

Change-Id: I2f4012ff2cf42481e089d7fc33930258e501ddbf
2018-05-22 13:10:50 -07:00
Etan Cohen
13c598050a [RTT] Add sanity checks for RTT ranging results
Add checks to validate that the reported number of measurements and
of successes is reasonable: non-zero for successful results.

Bug: 79879905
Test: 'atest WifiRttTest' passes
Change-Id: Ie79b10edacb660dd8c5d116539a4ee5cc32a779d
2018-05-16 15:44:42 -07:00
Etan Cohen
346856ab46 Revert "[RTT] Disable RTT CTS"
This reverts commit 14c32a88c15f2e00647a226c1e670967a683dcf7.

Enable Wi-Fi RTT CTS in production.

Bug: b/74457054
Test: atest CtsNetTestCases:WifiRttTest
Change-Id: Ia60776dbf60406d3665b01c7fecb3c9cd1a6c8ee
2018-05-16 15:31:57 -07:00
Etan Cohen
01d63b603e [RTT] Update CTS to auto-select test AP
Update CTS to select a test AP:
- Scan for APs
- Select the APs supporting IEEE 802.11mc
- Pick the AP with the highest RSSI

Bug: 74518964
Test: atest WifiRttTest (and pick the CTS test)
Change-Id: I6467c75eedcc8260703d2a99214154c9e888cce9
2018-05-16 15:31:57 -07:00
Etan Cohen
b58779a4e1 Revert "[RTT] Modify CTS tests to use associated AP information"
This reverts commit 47d58e2a69.

The revert restores the older method of test AP selction: hard
code the name of the test AP. Subsequent CLs will update to
preferred test AP selection method.

Bug: 74518964
Test: atest WifiRttTest (with rest of CL stack)
Change-Id: Iab71978607aeaf37babdb1afdaeca5c114ccdbf7
2018-05-16 15:31:57 -07:00
Sudheer Shanka
6dea1b7567 Set stable_charging_threshold app idle constant to 0 during tests.
Tests need the parole state to get started immediately after device
starts charging, so update stable_charging_threshold constant to 0.

Also simplify the logic to update the global setting as the tests only rely
on a couple of constants.

Fixes: 79319040
Test: Test: cts-tradefed run singleCommand cts-dev -m CtsHostsideNetworkTests -t \
      com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: Ie9ef67bb1544dd0179980d537365d13e6b6020c1
2018-05-08 15:02:37 -07:00
Benedict Wong
9d623ccbba Merge "Add CTS support for eBPF" into pi-dev 2018-05-08 17:13:45 +00:00
Rebecca Silberstein
d8752ba525 WifiManagerTest: allow for multiple modes
Now that WifiService can/will support dual simultaneous mode operation, make
sure the tests allow for it as well.

Bug: 31346104
Test: atest android.net.wifi.cts
Change-Id: Id3aaacb3651568c18850a0fdf3832c0f52218cf2
2018-05-02 10:41:18 -07:00
Chenbo Feng
012d53ba16 Directly test xt_qtaguid module without libcutls
The libcutls library is no longer directly writing to the xt_qtaguid
module proc file. Instead, all the qtaguid related helper function is
moved to libqtaguid in P release. So the cts should directly call into
libqtaguid instead of using libcutils to do that, otherwise it will
faill on devices that using new traffic stats tools.

Bug: 78788976
Test: atest CtsNativeNetTestCases
Change-Id: I1169f598b6e558acf1d7724416b2b70abe2f5878
Merged-In: I1169f598b6e558acf1d7724416b2b70abe2f5878
(cherry picked from aosp commit 7d9870466bc5d57769fccf43ec3d1b2716f54b81)
2018-05-01 11:46:07 -07:00
android-build-prod (mdb)
106fbc7f49 Merge "Directly test xt_qtaguid module without libcutls" 2018-05-01 15:36:19 +00:00
Chenbo Feng
a82f259492 Directly test xt_qtaguid module without libcutls
The libcutls library is no longer directly writing to the xt_qtaguid
module proc file. Instead, all the qtaguid related helper function is
moved to libqtaguid in P release. So the cts should directly call into
libqtaguid instead of using libcutils to do that, otherwise it will
faill on devices that using new traffic stats tools.

Bug: 78788976
Test: atest CtsNativeNetTestCases
Change-Id: I1169f598b6e558acf1d7724416b2b70abe2f5878
2018-04-27 16:16:05 -07:00
Benedict Wong
27d1957bee Add CTS support for eBPF
Addition of eBPF requires tweaks regarding packet counting of
UDP-encapsulated-ESP packet bytes. This patch conditions the expected
number of bytes received based on eBPF being enabled

Bug: 74113670
Test: Ran CTS tests, passing on 3.18, 4.4, 4.9 kernels
Merged-In: If02a4bb6ebfdf949fdb58b5816aa9d252d9eef52
Change-Id: If02a4bb6ebfdf949fdb58b5816aa9d252d9eef52
(cherry picked from commit e061f54d7215729309e9e977743f5b28813878b0)
2018-04-25 13:58:14 -07:00
Roshan Pius
7457ee7eb8 WifiManagerTest: Fetch scan results only on scan success
When wifi location scans are off, the scan is expected to fail. But,
WifiManager.getScanResults() could still return results from the last
scan. This was causing the test to fail because it was relying on
|mScanResults| being null to detect scan failure.

Also, changed the scan done internal state name in the test to more accurately
reflect that scan has been completed (could be success or failure).

Bug: 77601152
Test: Ran `atest android.net.wifi.cts.WifiManagerTest#
testWifiManagerScanWhenWifiOffLocationTurnedOn` with location turned on,
but wifi scans turned off.

Change-Id: I6d5203a836d86d03fbb8e9af0035fe951a6b9db8
2018-04-24 13:56:43 -07:00
Benedict Wong
fe9b0a791e Add CTS support for eBPF
Addition of eBPF requires tweaks regarding packet counting of
UDP-encapsulated-ESP packet bytes. This patch conditions the expected
number of bytes received based on eBPF being enabled

Bug: 74113670
Test: Ran CTS tests, passing on 3.18, 4.4, 4.9 kernels
Change-Id: If02a4bb6ebfdf949fdb58b5816aa9d252d9eef52
2018-04-20 02:02:51 +00:00
Roshan Pius
e549804b9d WifiManagerTest: Don't assert for isScanAlwaysAvailable
This may not be true on all platforms (Android wear for example don't
want to support this functionality)

Bug: 78242827
Test: atest android.net.wifi.cts
Change-Id: I73ab8cd31a9b4a29bd47f8e47957c921a0b16fa3
2018-04-18 15:48:33 -07:00
Etan Cohen
7530899eb8 [RTT] Increase CTS coverage
Increase CTS coverage by utilizing additional methods.

Bug: 77915947
Test: atest WifiRttTest
Change-Id: Ibc560aafb317fb27fd969b8899cc49c5cd7a979f
2018-04-13 15:17:15 -07:00
TreeHugger Robot
1026eaee92 Merge "ScanResultTest: Retry scan attempts on failure" into pi-dev 2018-04-12 23:58:51 +00:00
Roshan Pius
021f8dde9b ScanResultTest: Retry scan attempts on failure
Scans can fail for multiple reasons (throttling, driver error, framework
aborting scans, etc). Add a retry mechanism for scans in this test
because these tests are dependendent on a successful scan being
completed.

Bug: 77601110
Test: atest ScanResultTest#testScanResultTimeStamp
Test: atest android.net.wifi.cts
Change-Id: Ic15e455394dde6fc01c01ea7f3eed2e27976d666
2018-04-06 15:43:37 -07:00
Lorenzo Colitti
356139091d Revert "Add cts to test unwanted capabilities api"
This reverts commit bf6a2ad00c.

Bug: 77601789
Test: atest android.net.cts.NetworkRequestTest
Change-Id: Ib3db82e889ed4ca050a837b1169a9da8e17bb424
2018-04-06 22:44:19 +09:00
TreeHugger Robot
4997cbc5ae Merge "Add cts to test unwanted capabilities api" into pi-dev 2018-04-04 16:55:14 +00:00
Ricky Wai
934dd7cacc Merge "Set empty watchlist test config before CTS" into pi-dev 2018-04-03 17:28:13 +00:00
Pavel Maltsev
bf6a2ad00c Add cts to test unwanted capabilities api
Test: atest android.net.cts.NetworkRequestTest
Bug: 74945408
Bug: 72828388
Change-Id: I19099a3d7a555f610c96eb1859493903152e10a3
2018-04-03 09:55:54 -07:00
Chalard Jean
8d66f2dc82 Merge "Add CTS tests for getMultipathPreference" 2018-04-03 09:16:09 +00:00
TreeHugger Robot
3233266e8d Merge "Allow net and media CTS tests to use hidden APIs" into pi-dev 2018-04-03 06:18:49 +00:00
Chalard Jean
8a0530bb9c Add CTS tests for getMultipathPreference
Test: Test passing with 1 or more connected wifis
      No wifi won't pass but it's already a requirement
Bug: 34630278

Change-Id: I43bf18943fbd00dc29417b18604e29f9111ec0b2
Merged-in: I43bf18943fbd00dc29417b18604e29f9111ec0b2
Merged-in: Ie90ca72ea3606dea4259984d42762dd742d59970
2018-04-03 05:27:38 +00:00
TreeHugger Robot
38c80d304a Merge "Add CTS tests for getMultipathPreference" into pi-dev 2018-04-02 11:56:24 +00:00
Jiyong Park
b58fc866b4 Allow net and media CTS tests to use hidden APIs
MediaRecorderTest uses EncoderCapabilities.getVideoEncoders().
WifiManagerTest uses WifiManager.getTxPackageCount().

Pass the 'hidden-api-checks=false' flag to temporarily exempt the two
CTS packages from the hidden api check. We eventually should fix the
hidden API usage completely or exempt the violating tests only.

Bug: 77436928
Test: atest CtsMediaTestCases
Test: atest CtsNetTestCases
Change-Id: I85efbb08c24b87079c0360fc3f9a2267462592f0
2018-04-01 17:05:33 +09:00
Lorenzo Colitti
0599bb578e Merge changes from topic "generic-sockets" into pi-dev
* changes:
  Prevent CTS from hanging if no UDP packet was received
  Switch checkTcp and checkUnconnectedUdp to use generic sockets
  Add generic socket interfaces and functions
  Add GCM to algorithms tested in CTS
2018-03-31 07:37:11 +00:00
Ricky Wai
087de1c815 Set empty watchlist test config before CTS
Test: CTS pass
Bug: 63908748
Change-Id: I8b607feb44f873aced1ae3c2ff02c02f0553fb10
2018-03-30 23:56:35 +00:00
Benedict Wong
cbe0a822b7 Merge "Update encapSocket API calls to getFileDescriptor" into pi-dev 2018-03-30 20:28:19 +00:00
Benedict Wong
b9b074bc03 Prevent CTS from hanging if no UDP packet was received
Previously, CTS tests could block forever on attempting to read a packet
from a UDP socket.

This patch modifies the receive methods of the NativeUdpSocket wrapper,
allowing it to gracefully fail if UDP packets are not received.
This patch also updates the IKE over UDP encap socket test to use the
NativeUdpSocket wrapper, preventing the tests from hanging in the same
fashion.

Bug: 70938121
Test: Ran updated tests on walleye + marlin
Merged-In: I390e4585e85647eb8555e706d44b76f95dec931f
Change-Id: I390e4585e85647eb8555e706d44b76f95dec931f
(cherry picked from commit e2fcb9d64ba10f07a69a6b96a7f7e1465856172a)
2018-03-30 11:25:50 -07:00
Benedict Wong
60b87e1f6d Switch checkTcp and checkUnconnectedUdp to use generic sockets
This patch switches IpSecManager checkTransform() tests to use generic
sockets, allowing for exercising of Java sockets as well as native/OS
sockets.

Bug: 76152303
Test: This; ran on Walleye
Merged-In: I515227e7aa04c424aefbbe46209ddce81421b2f1
Change-Id: I515227e7aa04c424aefbbe46209ddce81421b2f1
(cherry picked from commit 796f61bb7be36f66302311f89caa74a3a3f13dad)
2018-03-30 11:25:42 -07:00
Benedict Wong
c33ed347f0 Add generic socket interfaces and functions
This patch adds functionality to unify java and native sockets. This is
part one of two of a change to allow functionality for testing full
coverage of all APIs.

Bug: 76152303
Test: Ran tests on Walleye
Merged-In: I9bd57d6267f82d8c1ac293a0147dc2c115dd4181
Change-Id: I9bd57d6267f82d8c1ac293a0147dc2c115dd4181
(cherry picked from commit d524e0785c7bbe5c7987f8ae01fdc5d57e13545d)
2018-03-30 11:25:31 -07:00
Benedict Wong
3c0ad1ddcc Add GCM to algorithms tested in CTS
This change adds all combinations of GCM algorithms, ensuring proper
support, config flags, and data accounting. Algorithm for calculating
size of packets has also been made more generic to allow for calculation
based on different encryption algorithms.

Bug: 73261868
Test: This
Merged-In: Ib77ac237fee75415223f0291cecc0b60ce76b77f
Change-Id: Ib77ac237fee75415223f0291cecc0b60ce76b77f
(cherry picked from commit f64579bceb6287f09503d940619d096aa8c1ac0d)
2018-03-30 11:25:14 -07:00