Commit Graph

894 Commits

Author SHA1 Message Date
Chalard Jean
8d66f2dc82 Merge "Add CTS tests for getMultipathPreference" 2018-04-03 09:16:09 +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
Benedict Wong
ef1a43e2c1 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
Change-Id: I390e4585e85647eb8555e706d44b76f95dec931f
2018-03-30 18:17:21 +00:00
Benedict Wong
376335421e 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
Change-Id: I515227e7aa04c424aefbbe46209ddce81421b2f1
2018-03-30 18:15:36 +00:00
Benedict Wong
3f6d149f3d 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
Change-Id: I9bd57d6267f82d8c1ac293a0147dc2c115dd4181
2018-03-30 18:14:46 +00:00
Benedict Wong
2a4463d257 Merge "Add GCM to algorithms tested in CTS" 2018-03-30 18:14:14 +00:00
Lorenzo Colitti
8f507d4edd Merge "Update encapSocket API calls to getFileDescriptor" 2018-03-30 04:58:47 +00:00
Benedict Wong
675406b789 Update encapSocket API calls to getFileDescriptor
This change updates the getSocket calls to getFileDescriptor, persuant
to new API.

Bug: 72473753
Test: CTS tests run on walleye
Change-Id: I65479cb35c88aee1f65c8597c3382cd30fa8d4a9
2018-03-27 17:00:41 -07:00
Benedict Wong
f3e34ff699 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
Change-Id: Ib77ac237fee75415223f0291cecc0b60ce76b77f
2018-03-27 16:37:41 -07:00
Benedict Wong
d4477edaf3 Merge "Add tests where only auth or crypt are enabled" 2018-03-23 17:25:10 +00:00
Benedict Wong
f8ccb00aa6 Add tests where only auth or crypt are enabled
This patch adds tests for cases where only auth or crypt are enabled.
These cases are supported, and this patch adds test coverage.

Bug: 75049573
Test: this, run on walleye
Change-Id: I656d9c4a86c13ce4928d6bd68a9e0d48cf805191
2018-03-22 20:58:21 +00:00
Benedict Wong
0ce11669ab Merge "Add tests for IPsec SPI expiration timer changes" 2018-03-16 17:45:20 +00:00
Benedict Wong
b84436977a Add tests for IPsec SPI expiration timer changes
This change adds tests to ensure that SPI expiration timers are set to a
high value, greater than 1 hour (3600s).

Bug: 72316671
Test: Ran this, and MultiNetworkSysCtlTest.
Change-Id: Ib4776322bd5df772a3700b6e7ed1b5e7ed6b4637
2018-03-15 23:42:39 -07:00
Anton Hansson
505cbf0342 cts: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: I687153389dd4bfab1c83df5d9af83d89bed76fd4
Merged-In: I5afdfc8e1e523768db9065dd3571cb31bc1dfac5
2018-02-26 12:09:09 +00:00
Hugo Benichi
83e4cf5085 Add CTS coverage for MacAddress
Bug: 71866627
Test: cts-tradefed run cts-dev --module CtsNetTestCases -t android.net.cts.MacAddressTest
Change-Id: I2d8702b154a485f89911e1affb7cee79692f3ac7
2018-01-30 14:40:51 +09:00
nharold
1ca0e05919 Merge "IpSec - API Tweak for removeTransportModeTransforms" 2018-01-17 19:07:10 +00:00
Nathan Harold
9c590594b6 IpSec - API Tweak for removeTransportModeTransforms
Update IpSec tests to remove the transform parameter from
calls to removeTransportModeTransform(). It is infeasible
and thus removed.

Bug: 72079356
Test: cts - IpSecManagerTest
Change-Id: Iaa0b35b24bf044503da9af9966508ac5e88846e1
2018-01-17 01:07:52 -08:00
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