1 #/usr/bin/env python3.4 2 # 3 # Copyright (C) 2016 The Android Open Source Project 4 # 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. 16 """ 17 Test script to execute Bluetooth basic functionality test cases. 18 This test was designed to be run in a shield box. 19 """ 20 21 import threading 22 import time 23 24 from queue import Empty 25 from acts.test_decorators import test_tracker_info 26 from acts.test_utils.bt.BluetoothBaseTest import BluetoothBaseTest 27 from acts.test_utils.bt.bt_test_utils import clear_bonded_devices 28 from acts.test_utils.bt.bt_test_utils import kill_bluetooth_process 29 from acts.test_utils.bt.bt_test_utils import orchestrate_rfcomm_connection 30 from acts.test_utils.bt.bt_test_utils import reset_bluetooth 31 from acts.test_utils.bt.bt_test_utils import setup_multiple_devices_for_bt_test 32 from acts.test_utils.bt.bt_test_utils import take_btsnoop_logs 33 from acts.test_utils.bt.bt_test_utils import write_read_verify_data 34 from acts.test_utils.bt.bt_test_utils import verify_server_and_client_connected 35 36 from acts.test_utils.bt.BtEnum import RfcommUuid 37 38 39 class RfcommTest(BluetoothBaseTest): 40 default_timeout = 10 41 rf_client_th = 0 42 scan_discovery_time = 5 43 message = ( 44 "Space: the final frontier. These are the voyages of " 45 "the starship Enterprise. Its continuing mission: to explore " 46 "strange new worlds, to seek out new life and new civilizations," 47 " to boldly go where no man has gone before.") 48 49 def __init__(self, controllers): 50 BluetoothBaseTest.__init__(self, controllers) 51 self.client_ad = self.android_devices[0] 52 self.server_ad = self.android_devices[1] 53 54 def setup_class(self): 55 return setup_multiple_devices_for_bt_test(self.android_devices) 56 57 def setup_test(self): 58 for a in self.android_devices: 59 if not clear_bonded_devices(a): 60 return False 61 for a in self.android_devices: 62 a.ed.clear_all_events() 63 return True 64 65 def teardown_test(self): 66 self.client_ad.droid.bluetoothRfcommCloseClientSocket() 67 self.server_ad.droid.bluetoothRfcommCloseServerSocket() 68 return True 69 70 def on_fail(self, test_name, begin_time): 71 take_btsnoop_logs(self.android_devices, self, test_name) 72 reset_bluetooth(self.android_devices) 73 74 def teardown_test(self): 75 if verify_server_and_client_connected( 76 self.client_ad, self.server_ad, log=False): 77 self.client_ad.droid.bluetoothRfcommStop() 78 self.server_ad.droid.bluetoothRfcommStop() 79 80 def _test_rfcomm_connection_with_uuid(self, uuid): 81 if not orchestrate_rfcomm_connection( 82 self.client_ad, self.server_ad, uuid=uuid): 83 return False 84 85 self.client_ad.droid.bluetoothRfcommStop() 86 self.server_ad.droid.bluetoothRfcommStop() 87 return True 88 89 @BluetoothBaseTest.bt_test_wrap 90 @test_tracker_info(uuid='f0bd466f-9a59-4612-8b75-ae4f691eef77') 91 def test_rfcomm_connection(self): 92 """Test Bluetooth RFCOMM connection 93 94 Test RFCOMM though establishing a basic connection. 95 96 Steps: 97 1. Get the mac address of the server device. 98 2. Establish an RFCOMM connection from the client to the server AD. 99 3. Verify that the RFCOMM connection is active from both the client and 100 server. 101 102 Expected Result: 103 RFCOMM connection is established then disconnected succcessfully. 104 105 Returns: 106 Pass if True 107 Fail if False 108 109 TAGS: Classic, RFCOMM 110 Priority: 1 111 """ 112 return self._test_rfcomm_connection_with_uuid(None) 113 114 @BluetoothBaseTest.bt_test_wrap 115 @test_tracker_info(uuid='240e106a-efd0-4795-8baa-9c0ea88b8b25') 116 def test_rfcomm_connection_write_ascii(self): 117 """Test Bluetooth RFCOMM writing and reading ascii data 118 119 Test RFCOMM though establishing a connection. 120 121 Steps: 122 1. Get the mac address of the server device. 123 2. Establish an RFCOMM connection from the client to the server AD. 124 3. Verify that the RFCOMM connection is active from both the client and 125 server. 126 4. Write data from the client and read received data from the server. 127 5. Verify data matches from client and server 128 6. Disconnect the RFCOMM connection. 129 130 Expected Result: 131 RFCOMM connection is established then disconnected succcessfully. 132 133 Returns: 134 Pass if True 135 Fail if False 136 137 TAGS: Classic, RFCOMM 138 Priority: 1 139 """ 140 if not orchestrate_rfcomm_connection(self.client_ad, self.server_ad): 141 return False 142 if not write_read_verify_data(self.client_ad, self.server_ad, 143 self.message, False): 144 return False 145 if not verify_server_and_client_connected(self.client_ad, 146 self.server_ad): 147 return False 148 149 self.client_ad.droid.bluetoothRfcommStop() 150 self.server_ad.droid.bluetoothRfcommStop() 151 return True 152 153 @BluetoothBaseTest.bt_test_wrap 154 @test_tracker_info(uuid='c6ebf4aa-1ccb-415f-98c2-cbffb067d1ea') 155 def test_rfcomm_write_binary(self): 156 """Test Bluetooth RFCOMM writing and reading binary data 157 158 Test profile though establishing an RFCOMM connection. 159 160 Steps: 161 1. Get the mac address of the server device. 162 2. Establish an RFCOMM connection from the client to the server AD. 163 3. Verify that the RFCOMM connection is active from both the client and 164 server. 165 4. Write data from the client and read received data from the server. 166 5. Verify data matches from client and server 167 6. Disconnect the RFCOMM connection. 168 169 Expected Result: 170 RFCOMM connection is established then disconnected succcessfully. 171 172 Returns: 173 Pass if True 174 Fail if False 175 176 TAGS: Classic, RFCOMM 177 Priority: 1 178 """ 179 if not orchestrate_rfcomm_connection(self.client_ad, self.server_ad): 180 return False 181 binary_message = "11010101" 182 if not write_read_verify_data(self.client_ad, self.server_ad, 183 binary_message, True): 184 return False 185 186 if not verify_server_and_client_connected(self.client_ad, 187 self.server_ad): 188 return False 189 190 self.client_ad.droid.bluetoothRfcommStop() 191 self.server_ad.droid.bluetoothRfcommStop() 192 return True 193 194 @BluetoothBaseTest.bt_test_wrap 195 @test_tracker_info(uuid='2b36d71e-102b-469e-b064-e0da8cefdbfe') 196 def test_rfcomm_accept_timeout(self): 197 """Test Bluetooth RFCOMM accept socket timeout 198 199 Verify that RFCOMM connections are unsuccessful if 200 the socket timeout is exceeded. 201 202 Steps: 203 1. Get the mac address of the server device. 204 2. Establish an RFCOMM connection from the client to the server AD. 205 3. Verify that the RFCOMM connection is active from both the client and 206 server. 207 208 Expected Result: 209 RFCOMM connection is established then disconnected succcessfully. 210 211 Returns: 212 Pass if True 213 Fail if False 214 215 TAGS: Classic, RFCOMM 216 Priority: 1 217 """ 218 # Socket timeout set to 999ms 219 short_socket_timeout = 999 220 # Wait time in seconds before attempting a connection 221 wait_time_before_connect_attempt = 1 222 self.server_ad.droid.bluetoothStartPairingHelper() 223 self.client_ad.droid.bluetoothStartPairingHelper() 224 self.server_ad.droid.bluetoothRfcommBeginAcceptThread( 225 RfcommUuid.DEFAULT_UUID.value, short_socket_timeout) 226 time.sleep(wait_time_before_connect_attempt) 227 228 # Try to connect 229 self.client_ad.droid.bluetoothRfcommBeginConnectThread( 230 self.server_ad.droid.bluetoothGetLocalAddress()) 231 # Give the connection time to fail 232 #time.sleep(self.default_timeout) 233 time.sleep(2) 234 if verify_server_and_client_connected(self.client_ad, self.server_ad): 235 return False 236 self.log.info("No active connections found as expected") 237 # AcceptThread has finished, kill hanging ConnectThread 238 self.client_ad.droid.bluetoothRfcommKillConnThread() 239 reset_bluetooth(self.android_devices) 240 return True 241 242 @BluetoothBaseTest.bt_test_wrap 243 @test_tracker_info(uuid='88c70db6-651e-4d43-ab0c-c9f584094fb2') 244 def test_rfcomm_connection_base_uuid(self): 245 """Test Bluetooth RFCOMM connection using BASE uuid 246 247 Test RFCOMM though establishing a basic connection. 248 249 Steps: 250 1. Get the mac address of the server device. 251 2. Establish an RFCOMM connection from the client to the server AD. 252 3. Verify that the RFCOMM connection is active from both the client and 253 server. 254 255 Expected Result: 256 RFCOMM connection is established then disconnected succcessfully. 257 258 Returns: 259 Pass if True 260 Fail if False 261 262 TAGS: Classic, RFCOMM 263 Priority: 3 264 """ 265 return self._test_rfcomm_connection_with_uuid( 266 RfcommUuid.BASE_UUID.value) 267 268 @BluetoothBaseTest.bt_test_wrap 269 @test_tracker_info(uuid='42c8d861-48b3-423b-ae8c-df140ebaad9d') 270 def test_rfcomm_connection_sdp_uuid(self): 271 """Test Bluetooth RFCOMM connection using SDP uuid 272 273 Test RFCOMM though establishing a basic connection. 274 275 Steps: 276 1. Get the mac address of the server device. 277 2. Establish an RFCOMM connection from the client to the server AD. 278 3. Verify that the RFCOMM connection is active from both the client and 279 server. 280 281 Expected Result: 282 RFCOMM connection is established then disconnected succcessfully. 283 284 Returns: 285 Pass if True 286 Fail if False 287 288 TAGS: Classic, RFCOMM 289 Priority: 3 290 """ 291 return self._test_rfcomm_connection_with_uuid(RfcommUuid.SDP.value) 292 293 @BluetoothBaseTest.bt_test_wrap 294 @test_tracker_info(uuid='97cc310d-4096-481e-940f-abe6811784f3') 295 def test_rfcomm_connection_udp_uuid(self): 296 """Test Bluetooth RFCOMM connection using UDP uuid 297 298 Test RFCOMM though establishing a basic connection. 299 300 Steps: 301 1. Get the mac address of the server device. 302 2. Establish an RFCOMM connection from the client to the server AD. 303 3. Verify that the RFCOMM connection is active from both the client and 304 server. 305 306 Expected Result: 307 RFCOMM connection is established then disconnected succcessfully. 308 309 Returns: 310 Pass if True 311 Fail if False 312 313 TAGS: Classic, RFCOMM 314 Priority: 3 315 """ 316 return self._test_rfcomm_connection_with_uuid(RfcommUuid.UDP.value) 317 318 @BluetoothBaseTest.bt_test_wrap 319 @test_tracker_info(uuid='5998a0cf-fc05-433a-abd8-c52717ea755c') 320 def test_rfcomm_connection_rfcomm_uuid(self): 321 """Test Bluetooth RFCOMM connection using RFCOMM uuid 322 323 Test RFCOMM though establishing a basic connection. 324 325 Steps: 326 1. Get the mac address of the server device. 327 2. Establish an RFCOMM connection from the client to the server AD. 328 3. Verify that the RFCOMM connection is active from both the client and 329 server. 330 331 Expected Result: 332 RFCOMM connection is established then disconnected succcessfully. 333 334 Returns: 335 Pass if True 336 Fail if False 337 338 TAGS: Classic, RFCOMM 339 Priority: 3 340 """ 341 return self._test_rfcomm_connection_with_uuid(RfcommUuid.RFCOMM.value) 342 343 @BluetoothBaseTest.bt_test_wrap 344 @test_tracker_info(uuid='e3c05357-99ec-4819-86e4-1363e3359317') 345 def test_rfcomm_connection_tcp_uuid(self): 346 """Test Bluetooth RFCOMM connection using TCP uuid 347 348 Test RFCOMM though establishing a basic connection. 349 350 Steps: 351 1. Get the mac address of the server device. 352 2. Establish an RFCOMM connection from the client to the server AD. 353 3. Verify that the RFCOMM connection is active from both the client and 354 server. 355 356 Expected Result: 357 RFCOMM connection is established then disconnected succcessfully. 358 359 Returns: 360 Pass if True 361 Fail if False 362 363 TAGS: Classic, RFCOMM 364 Priority: 3 365 """ 366 return self._test_rfcomm_connection_with_uuid(RfcommUuid.TCP.value) 367 368 @BluetoothBaseTest.bt_test_wrap 369 @test_tracker_info(uuid='7304f8dc-f568-4489-9926-0b940ba7a45b') 370 def test_rfcomm_connection_tcs_bin_uuid(self): 371 """Test Bluetooth RFCOMM connection using TCS_BIN uuid 372 373 Test RFCOMM though establishing a basic connection. 374 375 Steps: 376 1. Get the mac address of the server device. 377 2. Establish an RFCOMM connection from the client to the server AD. 378 3. Verify that the RFCOMM connection is active from both the client and 379 server. 380 381 Expected Result: 382 RFCOMM connection is established then disconnected succcessfully. 383 384 Returns: 385 Pass if True 386 Fail if False 387 388 TAGS: Classic, RFCOMM 389 Priority: 3 390 """ 391 return self._test_rfcomm_connection_with_uuid(RfcommUuid.TCS_BIN.value) 392 393 @BluetoothBaseTest.bt_test_wrap 394 @test_tracker_info(uuid='ea1cfc32-d3f0-4420-a8e5-793c6ddf5820') 395 def test_rfcomm_connection_tcs_at_uuid(self): 396 """Test Bluetooth RFCOMM connection using TCS_AT uuid 397 398 Test RFCOMM though establishing a basic connection. 399 400 Steps: 401 1. Get the mac address of the server device. 402 2. Establish an RFCOMM connection from the client to the server AD. 403 3. Verify that the RFCOMM connection is active from both the client and 404 server. 405 406 Expected Result: 407 RFCOMM connection is established then disconnected succcessfully. 408 409 Returns: 410 Pass if True 411 Fail if False 412 413 TAGS: Classic, RFCOMM 414 Priority: 3 415 """ 416 return self._test_rfcomm_connection_with_uuid(RfcommUuid.TCS_AT.value) 417 418 @BluetoothBaseTest.bt_test_wrap 419 @test_tracker_info(uuid='5b0d5608-38a5-48f7-b3e5-dc52a4a681dd') 420 def test_rfcomm_connection_att_uuid(self): 421 """Test Bluetooth RFCOMM connection using ATT uuid 422 423 Test RFCOMM though establishing a basic connection. 424 425 Steps: 426 1. Get the mac address of the server device. 427 2. Establish an RFCOMM connection from the client to the server AD. 428 3. Verify that the RFCOMM connection is active from both the client and 429 server. 430 431 Expected Result: 432 RFCOMM connection is established then disconnected succcessfully. 433 434 Returns: 435 Pass if True 436 Fail if False 437 438 TAGS: Classic, RFCOMM 439 Priority: 3 440 """ 441 return self._test_rfcomm_connection_with_uuid(RfcommUuid.ATT.value) 442 443 @BluetoothBaseTest.bt_test_wrap 444 @test_tracker_info(uuid='e81f37ba-e914-4eb1-b144-b079f91c6734') 445 def test_rfcomm_connection_obex_uuid(self): 446 """Test Bluetooth RFCOMM connection using OBEX uuid 447 448 Test RFCOMM though establishing a basic connection. 449 450 Steps: 451 1. Get the mac address of the server device. 452 2. Establish an RFCOMM connection from the client to the server AD. 453 3. Verify that the RFCOMM connection is active from both the client and 454 server. 455 456 Expected Result: 457 RFCOMM connection is established then disconnected succcessfully. 458 459 Returns: 460 Pass if True 461 Fail if False 462 463 TAGS: Classic, RFCOMM 464 Priority: 3 465 """ 466 return self._test_rfcomm_connection_with_uuid(RfcommUuid.OBEX.value) 467 468 @BluetoothBaseTest.bt_test_wrap 469 @test_tracker_info(uuid='5edd766f-17fb-459c-985e-9c21afe1b104') 470 def test_rfcomm_connection_ip_uuid(self): 471 """Test Bluetooth RFCOMM connection using IP uuid 472 473 Test RFCOMM though establishing a basic connection. 474 475 Steps: 476 1. Get the mac address of the server device. 477 2. Establish an RFCOMM connection from the client to the server AD. 478 3. Verify that the RFCOMM connection is active from both the client and 479 server. 480 481 Expected Result: 482 RFCOMM connection is established then disconnected succcessfully. 483 484 Returns: 485 Pass if True 486 Fail if False 487 488 TAGS: Classic, RFCOMM 489 Priority: 3 490 """ 491 return self._test_rfcomm_connection_with_uuid(RfcommUuid.IP.value) 492 493 @BluetoothBaseTest.bt_test_wrap 494 @test_tracker_info(uuid='7a429cca-bc65-4344-8fa5-13ca0d49a351') 495 def test_rfcomm_connection_ftp_uuid(self): 496 """Test Bluetooth RFCOMM connection using FTP uuid 497 498 Test RFCOMM though establishing a basic connection. 499 500 Steps: 501 1. Get the mac address of the server device. 502 2. Establish an RFCOMM connection from the client to the server AD. 503 3. Verify that the RFCOMM connection is active from both the client and 504 server. 505 506 Expected Result: 507 RFCOMM connection is established then disconnected succcessfully. 508 509 Returns: 510 Pass if True 511 Fail if False 512 513 TAGS: Classic, RFCOMM 514 Priority: 3 515 """ 516 return self._test_rfcomm_connection_with_uuid(RfcommUuid.FTP.value) 517 518 @BluetoothBaseTest.bt_test_wrap 519 @test_tracker_info(uuid='a8ecdd7b-8529-4e0b-ad18-0d0cf61f4b02') 520 def test_rfcomm_connection_http_uuid(self): 521 """Test Bluetooth RFCOMM connection using HTTP uuid 522 523 Test RFCOMM though establishing a basic connection. 524 525 Steps: 526 1. Get the mac address of the server device. 527 2. Establish an RFCOMM connection from the client to the server AD. 528 3. Verify that the RFCOMM connection is active from both the client and 529 server. 530 531 Expected Result: 532 RFCOMM connection is established then disconnected succcessfully. 533 534 Returns: 535 Pass if True 536 Fail if False 537 538 TAGS: Classic, RFCOMM 539 Priority: 3 540 """ 541 return self._test_rfcomm_connection_with_uuid(RfcommUuid.HTTP.value) 542 543 @BluetoothBaseTest.bt_test_wrap 544 @test_tracker_info(uuid='816569e6-6189-45b5-95c3-ea27b69698ff') 545 def test_rfcomm_connection_wsp_uuid(self): 546 """Test Bluetooth RFCOMM connection using WSP uuid 547 548 Test RFCOMM though establishing a basic connection. 549 550 Steps: 551 1. Get the mac address of the server device. 552 2. Establish an RFCOMM connection from the client to the server AD. 553 3. Verify that the RFCOMM connection is active from both the client and 554 server. 555 556 Expected Result: 557 RFCOMM connection is established then disconnected succcessfully. 558 559 Returns: 560 Pass if True 561 Fail if False 562 563 TAGS: Classic, RFCOMM 564 Priority: 3 565 """ 566 return self._test_rfcomm_connection_with_uuid(RfcommUuid.WSP.value) 567 568 @BluetoothBaseTest.bt_test_wrap 569 @test_tracker_info(uuid='cd5e8c87-4df9-4f1d-ae0b-b47f84c75e44') 570 def test_rfcomm_connection_bnep_uuid(self): 571 """Test Bluetooth RFCOMM connection using BNEP uuid 572 573 Test RFCOMM though establishing a basic connection. 574 575 Steps: 576 1. Get the mac address of the server device. 577 2. Establish an RFCOMM connection from the client to the server AD. 578 3. Verify that the RFCOMM connection is active from both the client and 579 server. 580 581 Expected Result: 582 RFCOMM connection is established then disconnected succcessfully. 583 584 Returns: 585 Pass if True 586 Fail if False 587 588 TAGS: Classic, RFCOMM 589 Priority: 3 590 """ 591 return self._test_rfcomm_connection_with_uuid(RfcommUuid.BNEP.value) 592 593 @BluetoothBaseTest.bt_test_wrap 594 @test_tracker_info(uuid='fda073d3-d856-438b-b208-61cce67689dd') 595 def test_rfcomm_connection_upnp_uuid(self): 596 """Test Bluetooth RFCOMM connection using UPNP uuid 597 598 Test RFCOMM though establishing a basic connection. 599 600 Steps: 601 1. Get the mac address of the server device. 602 2. Establish an RFCOMM connection from the client to the server AD. 603 3. Verify that the RFCOMM connection is active from both the client and 604 server. 605 606 Expected Result: 607 RFCOMM connection is established then disconnected succcessfully. 608 609 Returns: 610 Pass if True 611 Fail if False 612 613 TAGS: Classic, RFCOMM 614 Priority: 3 615 """ 616 return self._test_rfcomm_connection_with_uuid(RfcommUuid.UPNP.value) 617 618 @BluetoothBaseTest.bt_test_wrap 619 @test_tracker_info(uuid='0ab329bb-ef61-4574-a5c1-440fb45938ff') 620 def test_rfcomm_connection_hidp_uuid(self): 621 """Test Bluetooth RFCOMM connection using HIDP uuid 622 623 Test RFCOMM though establishing a basic connection. 624 625 Steps: 626 1. Get the mac address of the server device. 627 2. Establish an RFCOMM connection from the client to the server AD. 628 3. Verify that the RFCOMM connection is active from both the client and 629 server. 630 631 Expected Result: 632 RFCOMM connection is established then disconnected succcessfully. 633 634 Returns: 635 Pass if True 636 Fail if False 637 638 TAGS: Classic, RFCOMM 639 Priority: 3 640 """ 641 return self._test_rfcomm_connection_with_uuid(RfcommUuid.HIDP.value) 642 643 @BluetoothBaseTest.bt_test_wrap 644 @test_tracker_info(uuid='5b1d8c64-4f92-4a22-b61b-28b1a1086b39') 645 def test_rfcomm_connection_hardcopy_control_channel_uuid(self): 646 """Test Bluetooth RFCOMM connection using HARDCOPY_CONTROL_CHANNEL uuid 647 648 Test RFCOMM though establishing a basic connection. 649 650 Steps: 651 1. Get the mac address of the server device. 652 2. Establish an RFCOMM connection from the client to the server AD. 653 3. Verify that the RFCOMM connection is active from both the client and 654 server. 655 656 Expected Result: 657 RFCOMM connection is established then disconnected succcessfully. 658 659 Returns: 660 Pass if True 661 Fail if False 662 663 TAGS: Classic, RFCOMM 664 Priority: 3 665 """ 666 return self._test_rfcomm_connection_with_uuid( 667 RfcommUuid.HARDCOPY_CONTROL_CHANNEL.value) 668 669 @BluetoothBaseTest.bt_test_wrap 670 @test_tracker_info(uuid='1ae6ca34-87ab-48ad-8da8-98c997538af4') 671 def test_rfcomm_connection_hardcopy_data_channel_uuid(self): 672 """Test Bluetooth RFCOMM connection using HARDCOPY_DATA_CHANNEL uuid 673 674 Test RFCOMM though establishing a basic connection. 675 676 Steps: 677 1. Get the mac address of the server device. 678 2. Establish an RFCOMM connection from the client to the server AD. 679 3. Verify that the RFCOMM connection is active from both the client and 680 server. 681 682 Expected Result: 683 RFCOMM connection is established then disconnected succcessfully. 684 685 Returns: 686 Pass if True 687 Fail if False 688 689 TAGS: Classic, RFCOMM 690 Priority: 3 691 """ 692 return self._test_rfcomm_connection_with_uuid( 693 RfcommUuid.HARDCOPY_DATA_CHANNEL.value) 694 695 @BluetoothBaseTest.bt_test_wrap 696 @test_tracker_info(uuid='d18ed311-a533-4306-944a-6f0f95eac141') 697 def test_rfcomm_connection_hardcopy_notification_uuid(self): 698 """Test Bluetooth RFCOMM connection using HARDCOPY_NOTIFICATION uuid 699 700 Test RFCOMM though establishing a basic connection. 701 702 Steps: 703 1. Get the mac address of the server device. 704 2. Establish an RFCOMM connection from the client to the server AD. 705 3. Verify that the RFCOMM connection is active from both the client and 706 server. 707 708 Expected Result: 709 RFCOMM connection is established then disconnected succcessfully. 710 711 Returns: 712 Pass if True 713 Fail if False 714 715 TAGS: Classic, RFCOMM 716 Priority: 3 717 """ 718 return self._test_rfcomm_connection_with_uuid( 719 RfcommUuid.HARDCOPY_NOTIFICATION.value) 720 721 @BluetoothBaseTest.bt_test_wrap 722 @test_tracker_info(uuid='ab0af819-7d26-451d-8275-1119ee3c8df8') 723 def test_rfcomm_connection_avctp_uuid(self): 724 """Test Bluetooth RFCOMM connection using AVCTP uuid 725 726 Test RFCOMM though establishing a basic connection. 727 728 Steps: 729 1. Get the mac address of the server device. 730 2. Establish an RFCOMM connection from the client to the server AD. 731 3. Verify that the RFCOMM connection is active from both the client and 732 server. 733 734 Expected Result: 735 RFCOMM connection is established then disconnected succcessfully. 736 737 Returns: 738 Pass if True 739 Fail if False 740 741 TAGS: Classic, RFCOMM 742 Priority: 3 743 """ 744 return self._test_rfcomm_connection_with_uuid(RfcommUuid.AVCTP.value) 745 746 @BluetoothBaseTest.bt_test_wrap 747 @test_tracker_info(uuid='124b545e-e842-433d-b541-9710a139c8fb') 748 def test_rfcomm_connection_avdtp_uuid(self): 749 """Test Bluetooth RFCOMM connection using AVDTP uuid 750 751 Test RFCOMM though establishing a basic connection. 752 753 Steps: 754 1. Get the mac address of the server device. 755 2. Establish an RFCOMM connection from the client to the server AD. 756 3. Verify that the RFCOMM connection is active from both the client and 757 server. 758 759 Expected Result: 760 RFCOMM connection is established then disconnected succcessfully. 761 762 Returns: 763 Pass if True 764 Fail if False 765 766 TAGS: Classic, RFCOMM 767 Priority: 3 768 """ 769 return self._test_rfcomm_connection_with_uuid(RfcommUuid.AVDTP.value) 770 771 @BluetoothBaseTest.bt_test_wrap 772 @test_tracker_info(uuid='aea354b9-2ba5-4d7e-90a9-b637cb2fd48c') 773 def test_rfcomm_connection_cmtp_uuid(self): 774 """Test Bluetooth RFCOMM connection using CMTP uuid 775 776 Test RFCOMM though establishing a basic connection. 777 778 Steps: 779 1. Get the mac address of the server device. 780 2. Establish an RFCOMM connection from the client to the server AD. 781 3. Verify that the RFCOMM connection is active from both the client and 782 server. 783 784 Expected Result: 785 RFCOMM connection is established then disconnected succcessfully. 786 787 Returns: 788 Pass if True 789 Fail if False 790 791 TAGS: Classic, RFCOMM 792 Priority: 3 793 """ 794 return self._test_rfcomm_connection_with_uuid(RfcommUuid.CMTP.value) 795 796 @BluetoothBaseTest.bt_test_wrap 797 @test_tracker_info(uuid='b547b8d9-6453-41af-959f-8bc0d9a6c89a') 798 def test_rfcomm_connection_mcap_control_channel_uuid(self): 799 """Test Bluetooth RFCOMM connection using MCAP_CONTROL_CHANNEL uuid 800 801 Test RFCOMM though establishing a basic connection. 802 803 Steps: 804 1. Get the mac address of the server device. 805 2. Establish an RFCOMM connection from the client to the server AD. 806 3. Verify that the RFCOMM connection is active from both the client and 807 server. 808 809 Expected Result: 810 RFCOMM connection is established then disconnected succcessfully. 811 812 Returns: 813 Pass if True 814 Fail if False 815 816 TAGS: Classic, RFCOMM 817 Priority: 3 818 """ 819 return self._test_rfcomm_connection_with_uuid( 820 RfcommUuid.MCAP_CONTROL_CHANNEL.value) 821 822 @BluetoothBaseTest.bt_test_wrap 823 @test_tracker_info(uuid='ba3ab84c-bc61-442c-944c-af4fbca157f1') 824 def test_rfcomm_connection_mcap_data_channel_uuid(self): 825 """Test Bluetooth RFCOMM connection using MCAP_DATA_CHANNEL uuid 826 827 Test RFCOMM though establishing a basic connection. 828 829 Steps: 830 1. Get the mac address of the server device. 831 2. Establish an RFCOMM connection from the client to the server AD. 832 3. Verify that the RFCOMM connection is active from both the client and 833 server. 834 835 Expected Result: 836 RFCOMM connection is established then disconnected succcessfully. 837 838 Returns: 839 Pass if True 840 Fail if False 841 842 TAGS: Classic, RFCOMM 843 Priority: 3 844 """ 845 return self._test_rfcomm_connection_with_uuid( 846 RfcommUuid.MCAP_DATA_CHANNEL.value) 847 848 @BluetoothBaseTest.bt_test_wrap 849 @test_tracker_info(uuid='d6c7523d-9247-480e-8154-edd51ae1be50') 850 def test_rfcomm_connection_l2cap_uuid(self): 851 """Test Bluetooth RFCOMM connection using L2CAP uuid 852 853 Test RFCOMM though establishing a basic connection. 854 855 Steps: 856 1. Get the mac address of the server device. 857 2. Establish an RFCOMM connection from the client to the server AD. 858 3. Verify that the RFCOMM connection is active from both the client and 859 server. 860 861 Expected Result: 862 RFCOMM connection is established then disconnected succcessfully. 863 864 Returns: 865 Pass if True 866 Fail if False 867 868 TAGS: Classic, RFCOMM 869 Priority: 3 870 """ 871 return self._test_rfcomm_connection_with_uuid(RfcommUuid.L2CAP.value) 872