Bluetooth SDP autotest: Service Search Request with invalid PDU size
Added new SDP autotest, which implements test case 'TP/SERVER/SS/BI-01-C' from
Bluetooth SIG Test Spec. It verifies that the IUT behaves correctly when it
receives a request with invalid PDU size. The correct behaviour is to respond
with SDP_ErrorResponse PDU, with the error code 0x0004 (Invalid PDU Size).
In order to support invalid PDU size, forced_pdu_size parameter was added to all
the service_search_request() methods (equals None by default, which means
"calculate from resulting sequence's size").
This CL also adds handling of error responses to BluetoothSDPSocket class: so
service_search_request() method should return error code (as int) in case of
error, and list of found services' records otherwise.
BUG=chromium:329044
TEST=test_that --board ${BOARD} ${HOSTNAME} bluetooth_SDP_ServiceSearchRequestBasic
Change-Id: I93c072b8986498b1464d336fd51f47312d359f09
Reviewed-on: https://chromium-review.googlesource.com/188118
Tested-by: Artem Rakhov <arakhov@chromium.org>
Reviewed-by: Scott James Remnant <keybuk@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 270aa1b..753de40 100644
--- a/server/cros/bluetooth/bluetooth_tester.py
+++ b/server/cros/bluetooth/bluetooth_tester.py
@@ -122,18 +122,22 @@
self._proxy.connect(address)
- def service_search_request(self, uuids, max_rec_cnt, preferred_size=32):
+ def service_search_request(self, uuids, max_rec_cnt, preferred_size=32,
+ forced_pdu_size=None):
"""Send a Service Search Request
- @param uuids: List of UUIDs (in 32-bit format) to look for.
+ @param uuids: List of UUIDs (as integers) to look for.
@param max_rec_cnt: Maximum count of returned service records.
@param preferred_size: Preffered size of UUIDs in bits (16, 32, or 128).
+ @param forced_pdu_size: Use certain PDU size parameter instead of
+ calculating actual length of sequence.
- @return list of found services' service record handles
+ @return list of found services' service record handles or Error Code
"""
return self._proxy.service_search_request(uuids, max_rec_cnt,
- preferred_size)
+ preferred_size,
+ forced_pdu_size)
def create_host_from(device_host):