Bluetooth SDP autotest: tests for invalid Service Attribute Requests
This CL adds tests for invalid Service Attribute Requests:
TP/SERVER/SA/BI-01-C - invalid record handle
TP/SERVER/SA/BI-02-C - invalid syntax of request
TP/SERVER/SA/BI-03-C - invalid size of request in header
It also adds corresponding parameters to service_attribute_request()
method of bluetooth_sdp_socket() to be able to send intentionally
invalid requests.
BUG=chromium:329044
TEST=test_that --board ${BOARD} ${HOSTNAME} bluetooth_SDP_ServiceAttributeRequest
Change-Id: Idd8d7fcc5ff807af03d4d5f50a8927501f402ac9
Reviewed-on: https://chromium-review.googlesource.com/203560
Tested-by: Artem Rakhov <arakhov@chromium.org>
Reviewed-by: Scott James Remnant <keybuk@chromium.org>
Reviewed-by: Prashanth B <beeps@chromium.org>
Reviewed-by: Arman Uguray <armansito@chromium.org>
Commit-Queue: Artem Rakhov <arakhov@chromium.org>
diff --git a/server/cros/bluetooth/bluetooth_tester.py b/server/cros/bluetooth/bluetooth_tester.py
index ee81503..2becb3e 100644
--- a/server/cros/bluetooth/bluetooth_tester.py
+++ b/server/cros/bluetooth/bluetooth_tester.py
@@ -143,7 +143,8 @@
invalid_request)
- def service_attribute_request(self, handle, max_attr_byte_count, attr_ids):
+ def service_attribute_request(self, handle, max_attr_byte_count, attr_ids,
+ forced_pdu_size=None, invalid_request=None):
"""Send a Service Attribute Request
@param handle: service record from which attribute values are to be
@@ -152,13 +153,19 @@
be returned in the response to this request.
@param attr_ids: a list, where each element is either an attribute ID
or a range of attribute IDs.
+ @param forced_pdu_size: Use certain PDU size parameter instead of
+ calculating actual length of sequence.
+ @param invalid_request: Whether to send request with intentionally
+ invalid syntax for testing purposes (string with raw request).
@return list of found attributes IDs and their values or Error Code
"""
return self._proxy.service_attribute_request(handle,
max_attr_byte_count,
- attr_ids)
+ attr_ids,
+ forced_pdu_size,
+ invalid_request)
def create_host_from(device_host):