Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28bf299f authored by Myles Watson's avatar Myles Watson
Browse files

Add controller test

Bug: 197011305
Test: cert/run ControllerTest
Tag: #feature
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I8a2d2fcf349aa4583f12e6d0a75b8010db68ca95
parent d6a74651
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -28,3 +28,6 @@ class ControllerTest(GdBaseTestClass, ControllerTestBase):

    def test_write_local_name(self):
        ControllerTestBase.test_write_local_name(self, self.dut, self.cert)

    def test_extended_advertising_support(self):
        ControllerTestBase.test_extended_advertising_support(self, self.dut, self.cert)
+10 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

import time

from bluetooth_packets_python3 import hci_packets
from cert.truth import assertThat
from google.protobuf import empty_pb2 as empty_proto
from facade import rootservice_pb2 as facade_rootservice
@@ -39,3 +40,12 @@ class ControllerTestBase():

        assertThat(dut_name).isEqualTo(b'ImTheDUT')
        assertThat(cert_name).isEqualTo(b'ImTheCert')

    def test_extended_advertising_support(self, dut, cert):
        extended_advertising_supported = dut.hci_controller.SupportsBleExtendedAdvertising(empty_proto.Empty())
        if extended_advertising_supported.supported:
            number_of_sets = dut.hci_controller.GetLeNumberOfSupportedAdvertisingSets(empty_proto.Empty())
            assertThat(number_of_sets.value).isGreaterThan(5)  # Android threshold for CTS
            supported = dut.hci_controller.IsSupportedCommand(
                controller_facade.OpCodeMsg(op_code=int(hci_packets.OpCode.LE_SET_EXTENDED_ADVERTISING_PARAMETERS)))
            assertThat(supported.supported).isEqualTo(True)