Commit Graph

877 Commits

Author SHA1 Message Date
nharold
44eef0ee8d Merge "Update testCreateTransform() for one-way transforms" 2018-01-17 08:45:29 +00:00
nharold
5810dda443 Merge "Update IpSecManagerTest for API changes to Transforms" 2018-01-17 08:40:37 +00:00
Nathan Harold
f91b5a214b Update testCreateTransform() for one-way transforms
This patch augments testCreateTransform() to
selectively apply the ipSecTransform in one/both
directions and then verifies that the link succeeds or
fails correctly. In addition, this converts the test
to use the Java sockets API for DatagramSocket instead
of using the FD-based API. One of the combos does not
fail as expected, so b/72048263 is tracking further
work needed.

Bug: 72047396
Bug: 71717213
Test: cts - IpSecManagerTest

Change-Id: Ied961f442b29f1e66ded37c7ffe7afdd4a5c49da
2018-01-16 21:12:43 -08:00
Nathan Harold
19adaa182d Update IpSecManagerTest for API changes to Transforms
API changes in IpSecManager and IpSecTransform are
reflected in these test updates: no functional change
to the test; just style updates along with improvement
in the clarity of using a single transform for both
directions.

Bug: 71717213
Test: CTS - IpSecManagerTest
Change-Id: Ia6933d010620516672687080898f8c4fd83223bc
2018-01-16 11:15:13 -08:00
Android Merger
eeef276826 Merge "Merge "Add a delay before toggling WiFi to let listening activity to start up" into oreo-cts-dev am: 9992c29071" into oreo-mr1-cts-dev
am: 803a8520c2

Change-Id: I2feea16764dc7844a083e16df3e401b5158c11df
2018-01-12 00:12:10 +00:00
Alex Vakulenko
daf2e786d2 Merge "Add a delay before toggling WiFi to let listening activity to start up" into oreo-cts-dev
am: 9992c29071

Change-Id: I5ea0bd658d11252b1c32cab7bedd1bfac8e80b26
2018-01-12 00:07:41 +00:00
Treehugger Robot
9992c29071 Merge "Add a delay before toggling WiFi to let listening activity to start up" into oreo-cts-dev 2018-01-12 00:01:30 +00:00
Treehugger Robot
3b38b58b1f Merge "Check kernel version before running qtaguid test" 2018-01-11 21:18:47 +00:00
Chenbo Feng
3a9e2dc232 Check kernel version before running qtaguid test
The qtaguid module is required for devices running kernel earlier then
4.9, but is no longer avaliable after that. Add a check before running
the kernel qtaguid native test so it doesn't fail on new devices.

Bug: 30950746
Test: run cts -m CtsNativeNetTestCases
Change-Id: I32bc77a4c51d8b64ac1a5411c75c56a51b84ea77
2018-01-11 11:15:06 -08:00
Alex Vakulenko
9a35c697dc Add a delay before toggling WiFi to let listening activity to start up
testConnectivityChanged_manifestRequestOnlyPreN_shouldReceiveIntent()
starts up a helper activity that listens to network connection/disconnection
notification. In many cases the test fails because the activity is just
able to start up and initialize itself before the first toggle event
arrives and in many cases it just misses by a matter of 100ms.

Added a short sleep after we start the activity and before we start
toggling WiFi to let the activity a chance to receive the first
notification.

Bug: 70988664
Change-Id: Ie122770fc8447a936d079fae7bdce61b10cf6dc2
2018-01-10 17:27:32 -08:00
Adam Vartanian
a02bbf31c4 DO NOT MERGE Add CTS test for URI fix.
Bug: 68341964
Test: cts -m CtsNetTestCases (on NYC branch)
Change-Id: If532123542155ea3be281044a3ea4ca0b6cf2db5
(cherry picked from commit a01da8536c)
2018-01-08 13:33:23 -08:00
Sudheer Shanka
a353a9bf2b Merge "Skip unsupported tests on low ram devices." into stage-aosp-oc-mr1-cts-dev
am: e352866bee

Change-Id: I62d301dd0c4f026ea4f52de0ad706d50ff5382e4
2018-01-06 01:42:28 +00:00
Adam Vartanian
5dc6849013 Add CTS test for URI fix. am: a01da8536c am: b1b5379591 am: 73105d42aa am: c210cc1a90 am: 5d8ba63f42 am: e88ef1b832 am: 1e1de4f052 am: 2204809646 am: fb73667810 am: 83f1303285 am: f259a8e37a am: 3d7e43b226 am: 2516305c8c
am: cd4ab882f0

Change-Id: I2f49f443143274a2deeccbdd7aa85d9484997c44
2018-01-05 20:43:59 +00:00
manojboopathi
f1c7d18cf2 Added CTS to test dual stack socket for TCP & UDP
This ensures the function IpSecManager.applyTransportModeTransform()
works as expected when used with Java sockets.

Bug: 70160694
Test: Ran CTS test (./run_cts.sh)
Change-Id: Ia4b636c0f48a0eeffb8813d271e59aeb86bd44bc
2018-01-02 13:54:04 -08:00
Benedict Wong
b04f7cea99 Fix IpSecManager CTS tests on 4.4 kernels
Investigation shows that 4.4 kernels take longer for loopback TCP
packets to be ack'd, and results in extra ack packets to be generated in
cases where both the server and client sockets send data packets at the
same time. This was verified via TCPdump, where an extra ack packet was
generated per run of the bidirectional transmissions in checkTcp().

This change verifies that the data + ack packets have been sent and
counted before initiating the reverse transmission. Further, changes
have been made to improve the reliability of this code via counting
expected packets (rather than sleeps).

Bug: 62994731
Test: CTS tests run (and passing) on walleye, marlin and angler
Change-Id: I7c707ec3b11235a5a9cba10275aee40e2eb37169
2017-12-21 15:02:04 -08:00
Sudheer Shanka
b7a503b578 Skip unsupported tests on low ram devices.
Notification listeners are not allowed on low ram devices.
Skip testDozeModeMetered_enabledButWhitelistedOnNotificationAction
and testDozeModeNonMetered_enabledButWhitelistedOnNotificationAction
on low ram devices since these tests depend on being able to
register notification listeners.

Bug: 70242457
Bug: 70545780
Test: testDozeModeMetered_enabledButWhitelistedOnNotificationAction
and testDozeModeNonMetered_enabledButWhitelistedOnNotificationAction
Change-Id: I8ce6f330760042ca790cd6fb10e62ebe86498a06
2017-12-21 11:23:21 -08:00
Benedict Wong
0bff9ab1c4 [ipsec-qtaguid] Update tests to check data usage
This change ensures that all forms of transport-mode packets are
correctly accounted for, and not double-counted. This includes both
per-UID counters, as well as interface counters.

Bug: 62994731
Test: CTS tests updated, passing
Change-Id: I83be0724ac21d9db7d91ce72733d13fb6736e66e
2017-12-18 19:46:30 +00:00
Treehugger Robot
8d7d4479a5 Merge "Clear some random compile warnings." 2017-12-14 21:51:21 +00:00
Jonathan Basseri
b58d3aa5b8 Update CTS to use renamed API method.
IPsec API is renaming reserveSecurityParameterIndex to
allocateSecurityParameterIndex. Update tests to reflect this.

Bug: 69128142
Test: TreeHugger should be enough
Change-Id: I0bfaa3584920096ffde7f9eeee9fccd0ec842821
2017-12-14 21:09:28 +00:00
David Benjamin
6208358a7c Clear some random compile warnings.
I saw a bunch fly by. Here are a few fixes.

ssize_t is %zd. Types from stdint.h use PRI* macros from inttypes.h.
Finally, use C99 initializers rather than the old GNU extension.

Test: make checkbuild
Change-Id: I343dfb99984ab826c7641e311e041e859eb61d93
2017-12-13 22:15:09 +00:00
Nathan Harold
78a4d4300b Fix IpSecAlgorithm Lengths in IpSecManagerTest
Update the key lengths for SHA1 and MD5 authentication
to pass the new tighter range checks.

Bug: 70324823
Test: this

Change-Id: I8f533f043d16b0571bac628d21878e31027fe853
2017-12-08 19:12:56 -08:00
Manoj Boopathi Raj
129129a6ad Merge "Test more transforms and more socket types."
am: d292f764bd

Change-Id: Icdf454b74803f0bdf4f42caaccd34ec6bd72a224
2017-11-16 18:02:38 +00:00
Lorenzo Colitti
bca5ed9431 Test more transforms and more socket types.
Added CTS test to check the transform (for IPv4 & IPv6) with
various authentication & encryptions types

Bug: 34812052
Test: Ran CTS on angler using aosp/run_cts.sh
Change-Id: I51b4d13847ed0f8ad8d5f19132fdb35b1bd2950c
2017-11-15 14:12:31 -08:00
Xin Li
6e0e8f25d8 Merge commit 'ba1e9e7f7893a079138330d2962ff75c35d4cae2' from
oc-mr1-dev-plus-aosp into stage-aosp-master.

Change-Id: I1172a1501c65f67b9c2829b739cadeb9e9ff1983
2017-11-14 11:40:13 -08:00
Adam Vartanian
cd4ab882f0 Add CTS test for URI fix. am: a01da8536c am: b1b5379591 am: 73105d42aa am: c210cc1a90 am: 5d8ba63f42 am: e88ef1b832 am: 1e1de4f052 am: 2204809646 am: fb73667810 am: 83f1303285 am: f259a8e37a am: 3d7e43b226
am: 2516305c8c

Change-Id: I7e7f5363c4747289c9817e58cb6636839aa2da05
2017-11-08 00:29:47 +00:00
Adam Vartanian
2516305c8c Add CTS test for URI fix. am: a01da8536c am: b1b5379591 am: 73105d42aa am: c210cc1a90 am: 5d8ba63f42 am: e88ef1b832 am: 1e1de4f052 am: 2204809646 am: fb73667810 am: 83f1303285 am: f259a8e37a
am: 3d7e43b226

Change-Id: I318a6c318db25c5d4dd4be3426b480a9de0b9b11
2017-11-08 00:05:43 +00:00
Adam Vartanian
3d7e43b226 Add CTS test for URI fix. am: a01da8536c am: b1b5379591 am: 73105d42aa am: c210cc1a90 am: 5d8ba63f42 am: e88ef1b832 am: 1e1de4f052 am: 2204809646 am: fb73667810 am: 83f1303285
am: f259a8e37a

Change-Id: Iaf798faba75cb1f543e012eee98707e20a08e8ce
2017-11-07 23:41:55 +00:00
Adam Vartanian
fb73667810 Add CTS test for URI fix. am: a01da8536c am: b1b5379591 am: 73105d42aa am: c210cc1a90 am: 5d8ba63f42 am: e88ef1b832 am: 1e1de4f052
am: 2204809646

Change-Id: Ic96d9b4693178421303c45ac628c456b66cdf655
2017-11-07 22:35:33 +00:00
Adam Vartanian
2204809646 Add CTS test for URI fix. am: a01da8536c am: b1b5379591 am: 73105d42aa am: c210cc1a90 am: 5d8ba63f42 am: e88ef1b832
am: 1e1de4f052

Change-Id: I4153cfa021655ba19b4b6dca19b70aaf91b5caa8
2017-11-07 22:08:32 +00:00
Adam Vartanian
1e1de4f052 Add CTS test for URI fix. am: a01da8536c am: b1b5379591 am: 73105d42aa am: c210cc1a90 am: 5d8ba63f42
am: e88ef1b832

Change-Id: Ie60c0885bc52b26fa900d2908946a56169d2f04c
2017-11-07 21:52:12 +00:00
Adam Vartanian
5d8ba63f42 Add CTS test for URI fix. am: a01da8536c am: b1b5379591 am: 73105d42aa
am: c210cc1a90

Change-Id: I276a0be85c41f823506fc8397050d406257324e9
2017-11-07 21:26:57 +00:00
Adam Vartanian
73105d42aa Add CTS test for URI fix. am: a01da8536c
am: b1b5379591

Change-Id: Ib1bcf1c84ee878161f812e8a9ba762a746329a3b
2017-11-07 20:49:55 +00:00
Adam Vartanian
b1b5379591 Add CTS test for URI fix.
am: a01da8536c

Change-Id: I21c707648e6cc02b267f663bd02140dd66b6bd80
2017-11-07 20:40:20 +00:00
Adam Vartanian
a01da8536c Add CTS test for URI fix.
Bug: 68341964
Test: cts -m CtsNetTestCases (on NYC branch)
Change-Id: If532123542155ea3be281044a3ea4ca0b6cf2db5
2017-11-07 14:02:08 +00:00
Jonathan Basseri
382ea38fc0 Use random available port in CTS tests.
Let the OS pick a random unused port so that the test never gets
EADDRINUSE.

Bug: 68657805
Test: Run tests in android.net.cts.IpSecManagerTest
Change-Id: I7f6c68f3c92f5cbed856eda52adcdffb8adc4734
2017-10-31 09:43:26 -07:00
Etan Cohen
fb02e14772 Merge "Merge "[CTS][PASSPOINT] Update the check for passpoint network for preloaded passpoint network" into oreo-cts-dev am: d5c00ceee0"
am: eedaf74628

Change-Id: Id1dd3f957f911db94c291484a0f313a7239634e8
2017-10-24 18:09:00 +00:00
Etan Cohen
66aec9074f Merge "[CTS][PASSPOINT] Update the check for passpoint network for preloaded passpoint network" into oreo-cts-dev am: d5c00ceee0 am: 8e699c86fc
am: 294f9ae45b

Change-Id: Id6806b4936ec7e3ae9bcc2ae3b62ff37b370e69b
2017-10-24 18:08:45 +00:00
Etan Cohen
294f9ae45b Merge "[CTS][PASSPOINT] Update the check for passpoint network for preloaded passpoint network" into oreo-cts-dev am: d5c00ceee0
am: 8e699c86fc

Change-Id: I7860a70a1cb206f4af24441886efa2cb9512b3b5
2017-10-24 18:02:30 +00:00
Etan Cohen
1b5d253694 Merge "[CTS][PASSPOINT] Update the check for passpoint network for preloaded passpoint network" into oreo-cts-dev
am: d5c00ceee0

Change-Id: I0d937d53fd3c151b67d8dd263d2c5d5f7f89dd50
2017-10-24 17:57:49 +00:00
Etan Cohen
8e699c86fc Merge "[CTS][PASSPOINT] Update the check for passpoint network for preloaded passpoint network" into oreo-cts-dev
am: d5c00ceee0

Change-Id: I9b42b412355a641f2bb8a06f031fced7575bab44
2017-10-24 17:57:29 +00:00
Benedict Wong
59c10d21d4 Merge "Add UDP encap socket test to CTS tests"
am: 9b85584096

Change-Id: Ic819770bb02cfc08018068ad43b05dc39aa0e170
2017-10-24 16:38:42 +00:00
Benedict Wong
9b85584096 Merge "Add UDP encap socket test to CTS tests" 2017-10-24 16:31:12 +00:00
Etan Cohen
591518f378 [CTS][PASSPOINT] Update the check for passpoint network for preloaded passpoint network
Before calling the testAddPasspointConfigWithCertCredential
we need to check number of network already present in device

Bug: 67630919
Test: android.server.cts.CtsNetTestCases, WifiManagerTest
Change-Id: If643ab7bde760a65e9a5b1e9d47af53378a178fd
2017-10-23 23:07:59 +00:00
Benedict Wong
d777ed231c Add UDP encap socket test to CTS tests
Tests basic functionality of UDP encap sockets:
> Creates SPIs
> Creates & applies transforms
> Creates UDP encap socket
> Ensures UDP encap socket port is non-zero
> Validates that ESP, IKE packets can be sent correctly

Test: Ran on aosp_angler-eng
Bug: 67662580
Change-Id: Ia7eca384cd779e663d53cbede97ec70da33d28ec
2017-10-23 15:59:09 -07:00
Chih-hung Hsieh
c4e5ef0549 Merge "Use -Werror in cts/.../Anroid.mk"
am: 3012fb2ba0

Change-Id: I9745c0cbef7ad12f950a5a68a45bf691776fb5ed
2017-10-20 22:42:31 +00:00
Chih-Hung Hsieh
78061072b6 Use -Werror in cts/.../Anroid.mk
* Suppress existing warnings.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: Ic599c9e11ea4f991b7e60930c891a6d736623b39
2017-10-18 16:55:15 -07:00
Ningyuan Wang
34f5d032f4 Merge "CTS: update wifi scan timeout to 9 seconds" into oc-mr1-dev
am: 9d802bdf96

Change-Id: I63e93684c0ce201c445cd1dd2ebb8f41b1afa04d
2017-10-11 16:46:49 +00:00
Ningyuan Wang
8666bc8c23 CTS: update wifi scan timeout to 9 seconds
This creates a new timeout constant for scan duration, so
this test doesn't share timeout constant with other events.

This also increases the scan timeout time to 9 seconds per
our estimation.

Bug: 67462981
Test: cts-tradefed run cts -m CtsNetTestCases -t
android.net.wifi.cts.WifiManagerTest#testWifiScanTimestamp

Change-Id: I7e1dea64bc8df3e4b31adbf8b5f05c8564a739b1
2017-10-10 13:26:34 -07:00
Sudheer Shanka
3496ab978d Merge "CtsHostsideNetworkTests: Add more logging when the test fails." into oc-mr1-dev
am: e0c6f29d71

Change-Id: Id7704abf409f4338061c86f9cc5c67e356b0f2e9
2017-09-30 07:40:06 +00:00
Sudheer Shanka
21163bc32d CtsHostsideNetworkTests: Add more logging when the test fails.
Bug: 66015813
Test: cts-tradefed run singleCommand cts-dev -m CtsHostsideNetworkTests -t \
      com.android.cts.net.HostsideRestrictBackgroundNetworkTests

Change-Id: I1dc0603011522f73c63dcb7f0f1422428f727fad
2017-09-29 17:13:32 -07:00