blob: 846827b6549ffb5c7eb6b274c507fca570b5f5d6 [file] [log] [blame]
tturney1bdf77d2015-12-28 17:46:13 -08001#/usr/bin/env python3.4
2#
3# Copyright (C) 2016 The Android Open Source Project
Ang Li73697b32015-12-03 00:41:53 +00004#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may not
6# use this file except in compliance with the License. You may obtain a copy of
7# the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations under
15# the License.
Ang Li73697b32015-12-03 00:41:53 +000016"""
17Test script to execute Bluetooth basic functionality test cases.
18This test was designed to be run in a shield box.
19"""
20
21import threading
22import time
23
24from queue import Empty
tturneycdfc2cf2017-01-11 10:53:46 -080025from acts.test_decorators import test_tracker_info
Ang Li73697b32015-12-03 00:41:53 +000026from acts.test_utils.bt.BluetoothBaseTest import BluetoothBaseTest
tturney41d809c2017-07-24 14:16:02 -070027from acts.test_utils.bt.bt_constants import bt_rfcomm_uuids
tturney24506942016-08-23 10:53:17 -070028from acts.test_utils.bt.bt_test_utils import clear_bonded_devices
tturneye3170f02016-05-19 14:37:00 -070029from acts.test_utils.bt.bt_test_utils import kill_bluetooth_process
tturney24506942016-08-23 10:53:17 -070030from acts.test_utils.bt.bt_test_utils import orchestrate_rfcomm_connection
Ang Li73697b32015-12-03 00:41:53 +000031from acts.test_utils.bt.bt_test_utils import reset_bluetooth
Ang Li73697b32015-12-03 00:41:53 +000032from acts.test_utils.bt.bt_test_utils import setup_multiple_devices_for_bt_test
33from acts.test_utils.bt.bt_test_utils import take_btsnoop_logs
tturney2621d7c2016-05-20 16:19:59 -070034from acts.test_utils.bt.bt_test_utils import write_read_verify_data
tturney96970fd2016-08-31 17:36:09 -070035from acts.test_utils.bt.bt_test_utils import verify_server_and_client_connected
Ang Li73697b32015-12-03 00:41:53 +000036
tturney24506942016-08-23 10:53:17 -070037from acts.test_utils.bt.BtEnum import RfcommUuid
38
Ang Li73697b32015-12-03 00:41:53 +000039
tturney0ab6f012016-05-09 13:59:27 -070040class RfcommTest(BluetoothBaseTest):
Ang Li73697b32015-12-03 00:41:53 +000041 default_timeout = 10
tturney0ab6f012016-05-09 13:59:27 -070042 rf_client_th = 0
Ang Li73697b32015-12-03 00:41:53 +000043 scan_discovery_time = 5
tturneyc12b6ec2016-03-30 13:39:40 -070044 message = (
45 "Space: the final frontier. These are the voyages of "
46 "the starship Enterprise. Its continuing mission: to explore "
47 "strange new worlds, to seek out new life and new civilizations,"
48 " to boldly go where no man has gone before.")
Ang Li73697b32015-12-03 00:41:53 +000049
50 def __init__(self, controllers):
51 BluetoothBaseTest.__init__(self, controllers)
tturney0ab6f012016-05-09 13:59:27 -070052 self.client_ad = self.android_devices[0]
53 self.server_ad = self.android_devices[1]
Ang Li73697b32015-12-03 00:41:53 +000054
Ang Li73697b32015-12-03 00:41:53 +000055 def setup_class(self):
tturney1ce8dc62016-02-18 09:55:53 -080056 return setup_multiple_devices_for_bt_test(self.android_devices)
Ang Li73697b32015-12-03 00:41:53 +000057
Ang Li73697b32015-12-03 00:41:53 +000058 def teardown_test(self):
tturney24506942016-08-23 10:53:17 -070059 self.client_ad.droid.bluetoothRfcommCloseClientSocket()
60 self.server_ad.droid.bluetoothRfcommCloseServerSocket()
Ang Li73697b32015-12-03 00:41:53 +000061 return True
62
Ang Li73697b32015-12-03 00:41:53 +000063 def teardown_test(self):
tturney5da68262017-05-02 08:57:52 -070064 if verify_server_and_client_connected(
65 self.client_ad, self.server_ad, log=False):
tturney0ab6f012016-05-09 13:59:27 -070066 self.client_ad.droid.bluetoothRfcommStop()
67 self.server_ad.droid.bluetoothRfcommStop()
Ang Li73697b32015-12-03 00:41:53 +000068
tturney5da68262017-05-02 08:57:52 -070069 def _test_rfcomm_connection_with_uuid(self, uuid):
70 if not orchestrate_rfcomm_connection(
71 self.client_ad, self.server_ad, uuid=uuid):
72 return False
73
74 self.client_ad.droid.bluetoothRfcommStop()
75 self.server_ad.droid.bluetoothRfcommStop()
76 return True
77
Ang Li73697b32015-12-03 00:41:53 +000078 @BluetoothBaseTest.bt_test_wrap
tturneycdfc2cf2017-01-11 10:53:46 -080079 @test_tracker_info(uuid='f0bd466f-9a59-4612-8b75-ae4f691eef77')
tturney17e6f862016-06-23 10:52:40 -070080 def test_rfcomm_connection(self):
tturney5da68262017-05-02 08:57:52 -070081 """Test Bluetooth RFCOMM connection
tturney17e6f862016-06-23 10:52:40 -070082
83 Test RFCOMM though establishing a basic connection.
84
85 Steps:
86 1. Get the mac address of the server device.
87 2. Establish an RFCOMM connection from the client to the server AD.
88 3. Verify that the RFCOMM connection is active from both the client and
89 server.
90
91 Expected Result:
92 RFCOMM connection is established then disconnected succcessfully.
93
94 Returns:
95 Pass if True
96 Fail if False
97
98 TAGS: Classic, RFCOMM
99 Priority: 1
100 """
tturney5da68262017-05-02 08:57:52 -0700101 return self._test_rfcomm_connection_with_uuid(None)
tturney17e6f862016-06-23 10:52:40 -0700102
tturney17e6f862016-06-23 10:52:40 -0700103 @BluetoothBaseTest.bt_test_wrap
tturneycdfc2cf2017-01-11 10:53:46 -0800104 @test_tracker_info(uuid='240e106a-efd0-4795-8baa-9c0ea88b8b25')
tturney0ab6f012016-05-09 13:59:27 -0700105 def test_rfcomm_connection_write_ascii(self):
tturney5da68262017-05-02 08:57:52 -0700106 """Test Bluetooth RFCOMM writing and reading ascii data
Ang Li73697b32015-12-03 00:41:53 +0000107
tturney0ab6f012016-05-09 13:59:27 -0700108 Test RFCOMM though establishing a connection.
Ang Li73697b32015-12-03 00:41:53 +0000109
110 Steps:
111 1. Get the mac address of the server device.
112 2. Establish an RFCOMM connection from the client to the server AD.
113 3. Verify that the RFCOMM connection is active from both the client and
114 server.
tturney0ab6f012016-05-09 13:59:27 -0700115 4. Write data from the client and read received data from the server.
116 5. Verify data matches from client and server
117 6. Disconnect the RFCOMM connection.
Ang Li73697b32015-12-03 00:41:53 +0000118
119 Expected Result:
120 RFCOMM connection is established then disconnected succcessfully.
121
122 Returns:
123 Pass if True
124 Fail if False
125
tturney0ab6f012016-05-09 13:59:27 -0700126 TAGS: Classic, RFCOMM
Ang Li73697b32015-12-03 00:41:53 +0000127 Priority: 1
128 """
tturney24506942016-08-23 10:53:17 -0700129 if not orchestrate_rfcomm_connection(self.client_ad, self.server_ad):
tturneye3170f02016-05-19 14:37:00 -0700130 return False
131 if not write_read_verify_data(self.client_ad, self.server_ad,
132 self.message, False):
133 return False
tturney96970fd2016-08-31 17:36:09 -0700134 if not verify_server_and_client_connected(self.client_ad,
135 self.server_ad):
Ang Li73697b32015-12-03 00:41:53 +0000136 return False
tturney0ab6f012016-05-09 13:59:27 -0700137
138 self.client_ad.droid.bluetoothRfcommStop()
139 self.server_ad.droid.bluetoothRfcommStop()
140 return True
141
142 @BluetoothBaseTest.bt_test_wrap
tturneycdfc2cf2017-01-11 10:53:46 -0800143 @test_tracker_info(uuid='c6ebf4aa-1ccb-415f-98c2-cbffb067d1ea')
tturney0ab6f012016-05-09 13:59:27 -0700144 def test_rfcomm_write_binary(self):
tturney5da68262017-05-02 08:57:52 -0700145 """Test Bluetooth RFCOMM writing and reading binary data
tturney0ab6f012016-05-09 13:59:27 -0700146
147 Test profile though establishing an RFCOMM connection.
148
149 Steps:
150 1. Get the mac address of the server device.
151 2. Establish an RFCOMM connection from the client to the server AD.
152 3. Verify that the RFCOMM connection is active from both the client and
153 server.
154 4. Write data from the client and read received data from the server.
155 5. Verify data matches from client and server
156 6. Disconnect the RFCOMM connection.
157
158 Expected Result:
159 RFCOMM connection is established then disconnected succcessfully.
160
161 Returns:
162 Pass if True
163 Fail if False
164
165 TAGS: Classic, RFCOMM
166 Priority: 1
167 """
tturney24506942016-08-23 10:53:17 -0700168 if not orchestrate_rfcomm_connection(self.client_ad, self.server_ad):
tturneye3170f02016-05-19 14:37:00 -0700169 return False
tturney0ab6f012016-05-09 13:59:27 -0700170 binary_message = "11010101"
tturneye3170f02016-05-19 14:37:00 -0700171 if not write_read_verify_data(self.client_ad, self.server_ad,
172 binary_message, True):
173 return False
tturney96970fd2016-08-31 17:36:09 -0700174
175 if not verify_server_and_client_connected(self.client_ad,
176 self.server_ad):
tturney0ab6f012016-05-09 13:59:27 -0700177 return False
178
tturney1ce8dc62016-02-18 09:55:53 -0800179 self.client_ad.droid.bluetoothRfcommStop()
180 self.server_ad.droid.bluetoothRfcommStop()
Ang Li73697b32015-12-03 00:41:53 +0000181 return True
tturney96970fd2016-08-31 17:36:09 -0700182
183 @BluetoothBaseTest.bt_test_wrap
tturneycdfc2cf2017-01-11 10:53:46 -0800184 @test_tracker_info(uuid='2b36d71e-102b-469e-b064-e0da8cefdbfe')
tturney96970fd2016-08-31 17:36:09 -0700185 def test_rfcomm_accept_timeout(self):
tturney5da68262017-05-02 08:57:52 -0700186 """Test Bluetooth RFCOMM accept socket timeout
tturney96970fd2016-08-31 17:36:09 -0700187
188 Verify that RFCOMM connections are unsuccessful if
189 the socket timeout is exceeded.
190
191 Steps:
192 1. Get the mac address of the server device.
193 2. Establish an RFCOMM connection from the client to the server AD.
194 3. Verify that the RFCOMM connection is active from both the client and
195 server.
196
197 Expected Result:
198 RFCOMM connection is established then disconnected succcessfully.
199
200 Returns:
201 Pass if True
202 Fail if False
203
204 TAGS: Classic, RFCOMM
205 Priority: 1
206 """
207 # Socket timeout set to 999ms
208 short_socket_timeout = 999
209 # Wait time in seconds before attempting a connection
210 wait_time_before_connect_attempt = 1
211 self.server_ad.droid.bluetoothStartPairingHelper()
212 self.client_ad.droid.bluetoothStartPairingHelper()
213 self.server_ad.droid.bluetoothRfcommBeginAcceptThread(
tturney41d809c2017-07-24 14:16:02 -0700214 bt_rfcomm_uuids['default_uuid'], short_socket_timeout)
tturney96970fd2016-08-31 17:36:09 -0700215 time.sleep(wait_time_before_connect_attempt)
216
217 # Try to connect
218 self.client_ad.droid.bluetoothRfcommBeginConnectThread(
219 self.server_ad.droid.bluetoothGetLocalAddress())
220 # Give the connection time to fail
221 #time.sleep(self.default_timeout)
222 time.sleep(2)
223 if verify_server_and_client_connected(self.client_ad, self.server_ad):
224 return False
225 self.log.info("No active connections found as expected")
226 # AcceptThread has finished, kill hanging ConnectThread
227 self.client_ad.droid.bluetoothRfcommKillConnThread()
228 reset_bluetooth(self.android_devices)
229 return True
tturney5da68262017-05-02 08:57:52 -0700230
231 @BluetoothBaseTest.bt_test_wrap
232 @test_tracker_info(uuid='88c70db6-651e-4d43-ab0c-c9f584094fb2')
233 def test_rfcomm_connection_base_uuid(self):
234 """Test Bluetooth RFCOMM connection using BASE uuid
235
236 Test RFCOMM though establishing a basic connection.
237
238 Steps:
239 1. Get the mac address of the server device.
240 2. Establish an RFCOMM connection from the client to the server AD.
241 3. Verify that the RFCOMM connection is active from both the client and
242 server.
243
244 Expected Result:
245 RFCOMM connection is established then disconnected succcessfully.
246
247 Returns:
248 Pass if True
249 Fail if False
250
251 TAGS: Classic, RFCOMM
252 Priority: 3
253 """
Stanley Tng15e4b922017-12-06 16:32:41 -0800254 return self._test_rfcomm_connection_with_uuid(
255 bt_rfcomm_uuids['base_uuid'])
tturney5da68262017-05-02 08:57:52 -0700256
257 @BluetoothBaseTest.bt_test_wrap
258 @test_tracker_info(uuid='42c8d861-48b3-423b-ae8c-df140ebaad9d')
259 def test_rfcomm_connection_sdp_uuid(self):
260 """Test Bluetooth RFCOMM connection using SDP uuid
261
262 Test RFCOMM though establishing a basic connection.
263
264 Steps:
265 1. Get the mac address of the server device.
266 2. Establish an RFCOMM connection from the client to the server AD.
267 3. Verify that the RFCOMM connection is active from both the client and
268 server.
269
270 Expected Result:
271 RFCOMM connection is established then disconnected succcessfully.
272
273 Returns:
274 Pass if True
275 Fail if False
276
277 TAGS: Classic, RFCOMM
278 Priority: 3
279 """
tturney41d809c2017-07-24 14:16:02 -0700280 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['sdp'])
tturney5da68262017-05-02 08:57:52 -0700281
282 @BluetoothBaseTest.bt_test_wrap
283 @test_tracker_info(uuid='97cc310d-4096-481e-940f-abe6811784f3')
284 def test_rfcomm_connection_udp_uuid(self):
285 """Test Bluetooth RFCOMM connection using UDP uuid
286
287 Test RFCOMM though establishing a basic connection.
288
289 Steps:
290 1. Get the mac address of the server device.
291 2. Establish an RFCOMM connection from the client to the server AD.
292 3. Verify that the RFCOMM connection is active from both the client and
293 server.
294
295 Expected Result:
296 RFCOMM connection is established then disconnected succcessfully.
297
298 Returns:
299 Pass if True
300 Fail if False
301
302 TAGS: Classic, RFCOMM
303 Priority: 3
304 """
tturney41d809c2017-07-24 14:16:02 -0700305 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['udp'])
tturney5da68262017-05-02 08:57:52 -0700306
307 @BluetoothBaseTest.bt_test_wrap
308 @test_tracker_info(uuid='5998a0cf-fc05-433a-abd8-c52717ea755c')
309 def test_rfcomm_connection_rfcomm_uuid(self):
310 """Test Bluetooth RFCOMM connection using RFCOMM uuid
311
312 Test RFCOMM though establishing a basic connection.
313
314 Steps:
315 1. Get the mac address of the server device.
316 2. Establish an RFCOMM connection from the client to the server AD.
317 3. Verify that the RFCOMM connection is active from both the client and
318 server.
319
320 Expected Result:
321 RFCOMM connection is established then disconnected succcessfully.
322
323 Returns:
324 Pass if True
325 Fail if False
326
327 TAGS: Classic, RFCOMM
328 Priority: 3
329 """
Stanley Tng15e4b922017-12-06 16:32:41 -0800330 return self._test_rfcomm_connection_with_uuid(
331 bt_rfcomm_uuids['rfcomm'])
tturney5da68262017-05-02 08:57:52 -0700332
333 @BluetoothBaseTest.bt_test_wrap
334 @test_tracker_info(uuid='e3c05357-99ec-4819-86e4-1363e3359317')
335 def test_rfcomm_connection_tcp_uuid(self):
336 """Test Bluetooth RFCOMM connection using TCP uuid
337
338 Test RFCOMM though establishing a basic connection.
339
340 Steps:
341 1. Get the mac address of the server device.
342 2. Establish an RFCOMM connection from the client to the server AD.
343 3. Verify that the RFCOMM connection is active from both the client and
344 server.
345
346 Expected Result:
347 RFCOMM connection is established then disconnected succcessfully.
348
349 Returns:
350 Pass if True
351 Fail if False
352
353 TAGS: Classic, RFCOMM
354 Priority: 3
355 """
tturney41d809c2017-07-24 14:16:02 -0700356 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['tcp'])
tturney5da68262017-05-02 08:57:52 -0700357
358 @BluetoothBaseTest.bt_test_wrap
359 @test_tracker_info(uuid='7304f8dc-f568-4489-9926-0b940ba7a45b')
360 def test_rfcomm_connection_tcs_bin_uuid(self):
361 """Test Bluetooth RFCOMM connection using TCS_BIN uuid
362
363 Test RFCOMM though establishing a basic connection.
364
365 Steps:
366 1. Get the mac address of the server device.
367 2. Establish an RFCOMM connection from the client to the server AD.
368 3. Verify that the RFCOMM connection is active from both the client and
369 server.
370
371 Expected Result:
372 RFCOMM connection is established then disconnected succcessfully.
373
374 Returns:
375 Pass if True
376 Fail if False
377
378 TAGS: Classic, RFCOMM
379 Priority: 3
380 """
Stanley Tng15e4b922017-12-06 16:32:41 -0800381 return self._test_rfcomm_connection_with_uuid(
382 bt_rfcomm_uuids['tcs_bin'])
tturney5da68262017-05-02 08:57:52 -0700383
384 @BluetoothBaseTest.bt_test_wrap
385 @test_tracker_info(uuid='ea1cfc32-d3f0-4420-a8e5-793c6ddf5820')
386 def test_rfcomm_connection_tcs_at_uuid(self):
387 """Test Bluetooth RFCOMM connection using TCS_AT uuid
388
389 Test RFCOMM though establishing a basic connection.
390
391 Steps:
392 1. Get the mac address of the server device.
393 2. Establish an RFCOMM connection from the client to the server AD.
394 3. Verify that the RFCOMM connection is active from both the client and
395 server.
396
397 Expected Result:
398 RFCOMM connection is established then disconnected succcessfully.
399
400 Returns:
401 Pass if True
402 Fail if False
403
404 TAGS: Classic, RFCOMM
405 Priority: 3
406 """
Stanley Tng15e4b922017-12-06 16:32:41 -0800407 return self._test_rfcomm_connection_with_uuid(
408 bt_rfcomm_uuids['tcs_at'])
tturney5da68262017-05-02 08:57:52 -0700409
410 @BluetoothBaseTest.bt_test_wrap
411 @test_tracker_info(uuid='5b0d5608-38a5-48f7-b3e5-dc52a4a681dd')
412 def test_rfcomm_connection_att_uuid(self):
413 """Test Bluetooth RFCOMM connection using ATT uuid
414
415 Test RFCOMM though establishing a basic connection.
416
417 Steps:
418 1. Get the mac address of the server device.
419 2. Establish an RFCOMM connection from the client to the server AD.
420 3. Verify that the RFCOMM connection is active from both the client and
421 server.
422
423 Expected Result:
424 RFCOMM connection is established then disconnected succcessfully.
425
426 Returns:
427 Pass if True
428 Fail if False
429
430 TAGS: Classic, RFCOMM
431 Priority: 3
432 """
tturney41d809c2017-07-24 14:16:02 -0700433 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['att'])
tturney5da68262017-05-02 08:57:52 -0700434
435 @BluetoothBaseTest.bt_test_wrap
436 @test_tracker_info(uuid='e81f37ba-e914-4eb1-b144-b079f91c6734')
437 def test_rfcomm_connection_obex_uuid(self):
438 """Test Bluetooth RFCOMM connection using OBEX uuid
439
440 Test RFCOMM though establishing a basic connection.
441
442 Steps:
443 1. Get the mac address of the server device.
444 2. Establish an RFCOMM connection from the client to the server AD.
445 3. Verify that the RFCOMM connection is active from both the client and
446 server.
447
448 Expected Result:
449 RFCOMM connection is established then disconnected succcessfully.
450
451 Returns:
452 Pass if True
453 Fail if False
454
455 TAGS: Classic, RFCOMM
456 Priority: 3
457 """
tturney41d809c2017-07-24 14:16:02 -0700458 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['obex'])
tturney5da68262017-05-02 08:57:52 -0700459
460 @BluetoothBaseTest.bt_test_wrap
461 @test_tracker_info(uuid='5edd766f-17fb-459c-985e-9c21afe1b104')
462 def test_rfcomm_connection_ip_uuid(self):
463 """Test Bluetooth RFCOMM connection using IP uuid
464
465 Test RFCOMM though establishing a basic connection.
466
467 Steps:
468 1. Get the mac address of the server device.
469 2. Establish an RFCOMM connection from the client to the server AD.
470 3. Verify that the RFCOMM connection is active from both the client and
471 server.
472
473 Expected Result:
474 RFCOMM connection is established then disconnected succcessfully.
475
476 Returns:
477 Pass if True
478 Fail if False
479
480 TAGS: Classic, RFCOMM
481 Priority: 3
482 """
tturney41d809c2017-07-24 14:16:02 -0700483 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['ip'])
tturney5da68262017-05-02 08:57:52 -0700484
485 @BluetoothBaseTest.bt_test_wrap
486 @test_tracker_info(uuid='7a429cca-bc65-4344-8fa5-13ca0d49a351')
487 def test_rfcomm_connection_ftp_uuid(self):
488 """Test Bluetooth RFCOMM connection using FTP uuid
489
490 Test RFCOMM though establishing a basic connection.
491
492 Steps:
493 1. Get the mac address of the server device.
494 2. Establish an RFCOMM connection from the client to the server AD.
495 3. Verify that the RFCOMM connection is active from both the client and
496 server.
497
498 Expected Result:
499 RFCOMM connection is established then disconnected succcessfully.
500
501 Returns:
502 Pass if True
503 Fail if False
504
505 TAGS: Classic, RFCOMM
506 Priority: 3
507 """
tturney41d809c2017-07-24 14:16:02 -0700508 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['ftp'])
tturney5da68262017-05-02 08:57:52 -0700509
510 @BluetoothBaseTest.bt_test_wrap
511 @test_tracker_info(uuid='a8ecdd7b-8529-4e0b-ad18-0d0cf61f4b02')
512 def test_rfcomm_connection_http_uuid(self):
513 """Test Bluetooth RFCOMM connection using HTTP uuid
514
515 Test RFCOMM though establishing a basic connection.
516
517 Steps:
518 1. Get the mac address of the server device.
519 2. Establish an RFCOMM connection from the client to the server AD.
520 3. Verify that the RFCOMM connection is active from both the client and
521 server.
522
523 Expected Result:
524 RFCOMM connection is established then disconnected succcessfully.
525
526 Returns:
527 Pass if True
528 Fail if False
529
530 TAGS: Classic, RFCOMM
531 Priority: 3
532 """
tturney41d809c2017-07-24 14:16:02 -0700533 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['http'])
tturney5da68262017-05-02 08:57:52 -0700534
535 @BluetoothBaseTest.bt_test_wrap
536 @test_tracker_info(uuid='816569e6-6189-45b5-95c3-ea27b69698ff')
537 def test_rfcomm_connection_wsp_uuid(self):
538 """Test Bluetooth RFCOMM connection using WSP uuid
539
540 Test RFCOMM though establishing a basic connection.
541
542 Steps:
543 1. Get the mac address of the server device.
544 2. Establish an RFCOMM connection from the client to the server AD.
545 3. Verify that the RFCOMM connection is active from both the client and
546 server.
547
548 Expected Result:
549 RFCOMM connection is established then disconnected succcessfully.
550
551 Returns:
552 Pass if True
553 Fail if False
554
555 TAGS: Classic, RFCOMM
556 Priority: 3
557 """
tturney41d809c2017-07-24 14:16:02 -0700558 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['wsp'])
tturney5da68262017-05-02 08:57:52 -0700559
560 @BluetoothBaseTest.bt_test_wrap
561 @test_tracker_info(uuid='cd5e8c87-4df9-4f1d-ae0b-b47f84c75e44')
562 def test_rfcomm_connection_bnep_uuid(self):
563 """Test Bluetooth RFCOMM connection using BNEP uuid
564
565 Test RFCOMM though establishing a basic connection.
566
567 Steps:
568 1. Get the mac address of the server device.
569 2. Establish an RFCOMM connection from the client to the server AD.
570 3. Verify that the RFCOMM connection is active from both the client and
571 server.
572
573 Expected Result:
574 RFCOMM connection is established then disconnected succcessfully.
575
576 Returns:
577 Pass if True
578 Fail if False
579
580 TAGS: Classic, RFCOMM
581 Priority: 3
582 """
tturney41d809c2017-07-24 14:16:02 -0700583 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['bnep'])
tturney5da68262017-05-02 08:57:52 -0700584
585 @BluetoothBaseTest.bt_test_wrap
586 @test_tracker_info(uuid='fda073d3-d856-438b-b208-61cce67689dd')
587 def test_rfcomm_connection_upnp_uuid(self):
588 """Test Bluetooth RFCOMM connection using UPNP uuid
589
590 Test RFCOMM though establishing a basic connection.
591
592 Steps:
593 1. Get the mac address of the server device.
594 2. Establish an RFCOMM connection from the client to the server AD.
595 3. Verify that the RFCOMM connection is active from both the client and
596 server.
597
598 Expected Result:
599 RFCOMM connection is established then disconnected succcessfully.
600
601 Returns:
602 Pass if True
603 Fail if False
604
605 TAGS: Classic, RFCOMM
606 Priority: 3
607 """
tturney41d809c2017-07-24 14:16:02 -0700608 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['upnp'])
tturney5da68262017-05-02 08:57:52 -0700609
610 @BluetoothBaseTest.bt_test_wrap
611 @test_tracker_info(uuid='0ab329bb-ef61-4574-a5c1-440fb45938ff')
612 def test_rfcomm_connection_hidp_uuid(self):
613 """Test Bluetooth RFCOMM connection using HIDP uuid
614
615 Test RFCOMM though establishing a basic connection.
616
617 Steps:
618 1. Get the mac address of the server device.
619 2. Establish an RFCOMM connection from the client to the server AD.
620 3. Verify that the RFCOMM connection is active from both the client and
621 server.
622
623 Expected Result:
624 RFCOMM connection is established then disconnected succcessfully.
625
626 Returns:
627 Pass if True
628 Fail if False
629
630 TAGS: Classic, RFCOMM
631 Priority: 3
632 """
tturney41d809c2017-07-24 14:16:02 -0700633 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['hidp'])
tturney5da68262017-05-02 08:57:52 -0700634
635 @BluetoothBaseTest.bt_test_wrap
636 @test_tracker_info(uuid='5b1d8c64-4f92-4a22-b61b-28b1a1086b39')
637 def test_rfcomm_connection_hardcopy_control_channel_uuid(self):
638 """Test Bluetooth RFCOMM connection using HARDCOPY_CONTROL_CHANNEL uuid
639
640 Test RFCOMM though establishing a basic connection.
641
642 Steps:
643 1. Get the mac address of the server device.
644 2. Establish an RFCOMM connection from the client to the server AD.
645 3. Verify that the RFCOMM connection is active from both the client and
646 server.
647
648 Expected Result:
649 RFCOMM connection is established then disconnected succcessfully.
650
651 Returns:
652 Pass if True
653 Fail if False
654
655 TAGS: Classic, RFCOMM
656 Priority: 3
657 """
Stanley Tng15e4b922017-12-06 16:32:41 -0800658 return self._test_rfcomm_connection_with_uuid(
659 bt_rfcomm_uuids['hardcopy_control_channel'])
tturney5da68262017-05-02 08:57:52 -0700660
661 @BluetoothBaseTest.bt_test_wrap
662 @test_tracker_info(uuid='1ae6ca34-87ab-48ad-8da8-98c997538af4')
663 def test_rfcomm_connection_hardcopy_data_channel_uuid(self):
664 """Test Bluetooth RFCOMM connection using HARDCOPY_DATA_CHANNEL uuid
665
666 Test RFCOMM though establishing a basic connection.
667
668 Steps:
669 1. Get the mac address of the server device.
670 2. Establish an RFCOMM connection from the client to the server AD.
671 3. Verify that the RFCOMM connection is active from both the client and
672 server.
673
674 Expected Result:
675 RFCOMM connection is established then disconnected succcessfully.
676
677 Returns:
678 Pass if True
679 Fail if False
680
681 TAGS: Classic, RFCOMM
682 Priority: 3
683 """
Stanley Tng15e4b922017-12-06 16:32:41 -0800684 return self._test_rfcomm_connection_with_uuid(
685 bt_rfcomm_uuids['hardcopy_data_channel'])
tturney5da68262017-05-02 08:57:52 -0700686
687 @BluetoothBaseTest.bt_test_wrap
688 @test_tracker_info(uuid='d18ed311-a533-4306-944a-6f0f95eac141')
689 def test_rfcomm_connection_hardcopy_notification_uuid(self):
690 """Test Bluetooth RFCOMM connection using HARDCOPY_NOTIFICATION uuid
691
692 Test RFCOMM though establishing a basic connection.
693
694 Steps:
695 1. Get the mac address of the server device.
696 2. Establish an RFCOMM connection from the client to the server AD.
697 3. Verify that the RFCOMM connection is active from both the client and
698 server.
699
700 Expected Result:
701 RFCOMM connection is established then disconnected succcessfully.
702
703 Returns:
704 Pass if True
705 Fail if False
706
707 TAGS: Classic, RFCOMM
708 Priority: 3
709 """
Stanley Tng15e4b922017-12-06 16:32:41 -0800710 return self._test_rfcomm_connection_with_uuid(
711 bt_rfcomm_uuids['hardcopy_notification'])
tturney5da68262017-05-02 08:57:52 -0700712
713 @BluetoothBaseTest.bt_test_wrap
714 @test_tracker_info(uuid='ab0af819-7d26-451d-8275-1119ee3c8df8')
715 def test_rfcomm_connection_avctp_uuid(self):
716 """Test Bluetooth RFCOMM connection using AVCTP uuid
717
718 Test RFCOMM though establishing a basic connection.
719
720 Steps:
721 1. Get the mac address of the server device.
722 2. Establish an RFCOMM connection from the client to the server AD.
723 3. Verify that the RFCOMM connection is active from both the client and
724 server.
725
726 Expected Result:
727 RFCOMM connection is established then disconnected succcessfully.
728
729 Returns:
730 Pass if True
731 Fail if False
732
733 TAGS: Classic, RFCOMM
734 Priority: 3
735 """
tturney41d809c2017-07-24 14:16:02 -0700736 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['avctp'])
tturney5da68262017-05-02 08:57:52 -0700737
738 @BluetoothBaseTest.bt_test_wrap
739 @test_tracker_info(uuid='124b545e-e842-433d-b541-9710a139c8fb')
740 def test_rfcomm_connection_avdtp_uuid(self):
741 """Test Bluetooth RFCOMM connection using AVDTP uuid
742
743 Test RFCOMM though establishing a basic connection.
744
745 Steps:
746 1. Get the mac address of the server device.
747 2. Establish an RFCOMM connection from the client to the server AD.
748 3. Verify that the RFCOMM connection is active from both the client and
749 server.
750
751 Expected Result:
752 RFCOMM connection is established then disconnected succcessfully.
753
754 Returns:
755 Pass if True
756 Fail if False
757
758 TAGS: Classic, RFCOMM
759 Priority: 3
760 """
tturney41d809c2017-07-24 14:16:02 -0700761 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['avdtp'])
tturney5da68262017-05-02 08:57:52 -0700762
763 @BluetoothBaseTest.bt_test_wrap
764 @test_tracker_info(uuid='aea354b9-2ba5-4d7e-90a9-b637cb2fd48c')
765 def test_rfcomm_connection_cmtp_uuid(self):
766 """Test Bluetooth RFCOMM connection using CMTP uuid
767
768 Test RFCOMM though establishing a basic connection.
769
770 Steps:
771 1. Get the mac address of the server device.
772 2. Establish an RFCOMM connection from the client to the server AD.
773 3. Verify that the RFCOMM connection is active from both the client and
774 server.
775
776 Expected Result:
777 RFCOMM connection is established then disconnected succcessfully.
778
779 Returns:
780 Pass if True
781 Fail if False
782
783 TAGS: Classic, RFCOMM
784 Priority: 3
785 """
tturney41d809c2017-07-24 14:16:02 -0700786 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['cmtp'])
tturney5da68262017-05-02 08:57:52 -0700787
788 @BluetoothBaseTest.bt_test_wrap
789 @test_tracker_info(uuid='b547b8d9-6453-41af-959f-8bc0d9a6c89a')
790 def test_rfcomm_connection_mcap_control_channel_uuid(self):
791 """Test Bluetooth RFCOMM connection using MCAP_CONTROL_CHANNEL uuid
792
793 Test RFCOMM though establishing a basic connection.
794
795 Steps:
796 1. Get the mac address of the server device.
797 2. Establish an RFCOMM connection from the client to the server AD.
798 3. Verify that the RFCOMM connection is active from both the client and
799 server.
800
801 Expected Result:
802 RFCOMM connection is established then disconnected succcessfully.
803
804 Returns:
805 Pass if True
806 Fail if False
807
808 TAGS: Classic, RFCOMM
809 Priority: 3
810 """
Stanley Tng15e4b922017-12-06 16:32:41 -0800811 return self._test_rfcomm_connection_with_uuid(
812 bt_rfcomm_uuids['mcap_control_channel'])
tturney5da68262017-05-02 08:57:52 -0700813
814 @BluetoothBaseTest.bt_test_wrap
815 @test_tracker_info(uuid='ba3ab84c-bc61-442c-944c-af4fbca157f1')
816 def test_rfcomm_connection_mcap_data_channel_uuid(self):
817 """Test Bluetooth RFCOMM connection using MCAP_DATA_CHANNEL uuid
818
819 Test RFCOMM though establishing a basic connection.
820
821 Steps:
822 1. Get the mac address of the server device.
823 2. Establish an RFCOMM connection from the client to the server AD.
824 3. Verify that the RFCOMM connection is active from both the client and
825 server.
826
827 Expected Result:
828 RFCOMM connection is established then disconnected succcessfully.
829
830 Returns:
831 Pass if True
832 Fail if False
833
834 TAGS: Classic, RFCOMM
835 Priority: 3
836 """
Stanley Tng15e4b922017-12-06 16:32:41 -0800837 return self._test_rfcomm_connection_with_uuid(
838 bt_rfcomm_uuids['mcap_data_channel'])
tturney5da68262017-05-02 08:57:52 -0700839
840 @BluetoothBaseTest.bt_test_wrap
841 @test_tracker_info(uuid='d6c7523d-9247-480e-8154-edd51ae1be50')
842 def test_rfcomm_connection_l2cap_uuid(self):
843 """Test Bluetooth RFCOMM connection using L2CAP uuid
844
845 Test RFCOMM though establishing a basic connection.
846
847 Steps:
848 1. Get the mac address of the server device.
849 2. Establish an RFCOMM connection from the client to the server AD.
850 3. Verify that the RFCOMM connection is active from both the client and
851 server.
852
853 Expected Result:
854 RFCOMM connection is established then disconnected succcessfully.
855
856 Returns:
857 Pass if True
858 Fail if False
859
860 TAGS: Classic, RFCOMM
861 Priority: 3
862 """
tturney41d809c2017-07-24 14:16:02 -0700863 return self._test_rfcomm_connection_with_uuid(bt_rfcomm_uuids['l2cap'])