Bluetooth SDP autotest: ServiceSearchAttribute invalid requests
This CL adds 2 tests to check invalid Service Search Attribute requests.
One test sends a request with intentionally invalid syntax, the other one
sends requests with wrong PDU size.
BUG=chromium:417931
TEST=test_that --board ${BOARD} ${HOSTNAME} bluetooth_SDP_ServiceSearchAttributeRequest
Change-Id: If38e2d48381f08022eeaa8cfb54c96d8c1206795
Reviewed-on: https://chromium-review.googlesource.com/226381
Tested-by: Artem Rakhov <arakhov@chromium.org>
Reviewed-by: Michael Janssen <jamuraa@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 d1ee919..581b451 100644
--- a/server/cros/bluetooth/bluetooth_tester.py
+++ b/server/cros/bluetooth/bluetooth_tester.py
@@ -169,7 +169,9 @@
def service_search_attribute_request(self, uuids, max_attr_byte_count,
- attr_ids, preferred_size=32):
+ attr_ids, preferred_size=32,
+ forced_pdu_size=None,
+ invalid_request=None):
"""Send a Service Search Attribute Request
@param uuids: list of UUIDs (as integers) to look for.
@@ -178,6 +180,11 @@
@param attr_ids: a list, where each element is either an attribute ID
or a range of attribute IDs.
@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.
+ @param invalid_request: Whether to send request with intentionally
+ invalid syntax for testing purposes (string to be prepended
+ to correct request).
@return list of found attributes IDs and their values or Error Code
@@ -185,7 +192,9 @@
return self._proxy.service_search_attribute_request(uuids,
max_attr_byte_count,
attr_ids,
- preferred_size)
+ preferred_size,
+ forced_pdu_size,
+ invalid_request)
def create_host_from(device_host):