Exemplo n.º 1
0
def setup_test_core(dut, cert, dut_module, cert_module):
    dut.rootservice.StartStack(
        facade_rootservice.StartStackRequest(module_under_test=facade_rootservice.BluetoothModule.Value(dut_module),))
    cert.rootservice.StartStack(
        facade_rootservice.StartStackRequest(module_under_test=facade_rootservice.BluetoothModule.Value(cert_module),))

    dut.wait_channel_ready()
    cert.wait_channel_ready()
Exemplo n.º 2
0
    def setup_test(self):
        self.device_under_test.rootservice.StartStack(
            facade_rootservice.StartStackRequest(
                module_under_test=facade_rootservice.BluetoothModule.Value(
                    'HCI_INTERFACES'), ))
        self.cert_device.rootservice.StartStack(
            facade_rootservice.StartStackRequest(
                module_under_test=facade_rootservice.BluetoothModule.Value(
                    'HCI'), ))

        self.device_under_test.wait_channel_ready()
        self.cert_device.wait_channel_ready()
Exemplo n.º 3
0
    def setup_test(self):
        self.dut.rootservice.StartStack(
            facade_rootservice.StartStackRequest(
                module_under_test=facade_rootservice.BluetoothModule.Value(
                    self.dut_module), ))
        self.cert.rootservice.StartStack(
            facade_rootservice.StartStackRequest(
                module_under_test=facade_rootservice.BluetoothModule.Value(
                    self.cert_module), ))

        self.dut.wait_channel_ready()
        self.cert.wait_channel_ready()
Exemplo n.º 4
0
    def setup_test(self):
        self.device_under_test.rootservice.StartStack(
            facade_rootservice_pb2.StartStackRequest(
                module_under_test=facade_rootservice_pb2.BluetoothModule.Value(
                    'HAL'), ))
        self.cert_device.rootservice.StartStack(
            facade_rootservice_pb2.StartStackRequest(
                module_under_test=facade_rootservice_pb2.BluetoothModule.Value(
                    'HAL'), ))

        self.device_under_test.wait_channel_ready()
        self.cert_device.wait_channel_ready()

        self.send_dut_hci_command(hci_packets.ResetBuilder())
        self.send_cert_hci_command(hci_packets.ResetBuilder())
Exemplo n.º 5
0
    def setup_test(self):
        self.device_under_test.rootservice.StartStack(
            facade_rootservice.StartStackRequest(
                module_under_test=facade_rootservice.BluetoothModule.Value(
                    'HCI'), ))
        self.cert_device.rootservice.StartStack(
            facade_rootservice.StartStackRequest(
                module_under_test=facade_rootservice.BluetoothModule.Value(
                    'HAL'), ))

        self.device_under_test.wait_channel_ready()
        self.cert_device.wait_channel_ready()

        self.cert_device.hal.SendHciCommand(
            hal_facade.HciCommandPacket(
                payload=bytes(hci_packets.ResetBuilder().Serialize())))
Exemplo n.º 6
0
    def setup_test(self):
        self.device_under_test.rootservice.StartStack(
            facade_rootservice_pb2.StartStackRequest(
                module_under_test=facade_rootservice_pb2.BluetoothModule.Value(
                    'SECURITY'), ))
        self.cert_device.rootservice.StartStack(
            facade_rootservice_pb2.StartStackRequest(
                module_under_test=facade_rootservice_pb2.BluetoothModule.Value(
                    'L2CAP'), ))

        self.device_under_test.address = self.device_under_test.controller_read_only_property.ReadLocalAddress(
            empty_proto.Empty()).address
        self.cert_device.address = self.cert_device.controller_read_only_property.ReadLocalAddress(
            empty_proto.Empty()).address

        self.device_under_test.neighbor.EnablePageScan(
            neighbor_facade.EnableMsg(enabled=True))
        self.cert_device.neighbor.EnablePageScan(
            neighbor_facade.EnableMsg(enabled=True))

        self.dut_address = common.BluetoothAddress(
            address=self.device_under_test.address)
        self.cert_address = common.BluetoothAddress(
            address=self.cert_device.address)

        self.dut_address_with_type = common.BluetoothAddressWithType()
        self.dut_address_with_type.address.CopyFrom(self.dut_address)
        self.dut_address_with_type.type = common.BluetoothPeerAddressTypeEnum.PUBLIC_DEVICE_OR_IDENTITY_ADDRESS

        self.cert_address_with_type = common.BluetoothAddressWithType()
        self.cert_address_with_type.address.CopyFrom(self.cert_address)
        self.cert_address_with_type.type = common.BluetoothPeerAddressTypeEnum.PUBLIC_DEVICE_OR_IDENTITY_ADDRESS

        self.device_under_test.wait_channel_ready()
        self.cert_device.wait_channel_ready()

        self.cert_name = b'ImTheCert'
        self.cert_device.hci_controller.WriteLocalName(
            controller_facade.NameMsg(name=self.cert_name))
        self.dut_name = b'ImTheDUT'
        self.device_under_test.hci_controller.WriteLocalName(
            controller_facade.NameMsg(name=self.dut_name))
Exemplo n.º 7
0
 def setup_test(self):
     self.device_under_test = self.gd_devices[0]
     self.cert_device = self.gd_cert_devices[0]
     self.device_under_test.rootservice.StartStack(
         facade_rootservice_pb2.StartStackRequest(
             module_under_test=facade_rootservice_pb2.BluetoothModule.Value(
                 'L2CAP'), ))
     self.cert_device.rootservice.StartStack(
         cert_rootservice_pb2.StartStackRequest(
             module_to_test=cert_rootservice_pb2.BluetoothModule.Value(
                 'L2CAP'), ))
Exemplo n.º 8
0
    def setup_test(self):
        self.device_under_test = self.gd_devices[0]

        self.device_under_test.rootservice.StartStack(
            facade_rootservice_pb2.StartStackRequest(
                module_under_test=facade_rootservice_pb2.BluetoothModule.Value('L2CAP'),))

        self.device_under_test.wait_channel_ready()

        dut_address = self.device_under_test.controller_read_only_property.ReadLocalAddress(empty_pb2.Empty()).address
        pts_address = self.controller_configs.get('pts_address').lower()
        self.device_under_test.address = dut_address

        self.dut_address = common_pb2.BluetoothAddress(address=self.device_under_test.address)
        self.pts_address = common_pb2.BluetoothAddress(address=str.encode(pts_address))

        self.device_under_test.neighbor.EnablePageScan(neighbor_facade.EnableMsg(enabled=True))
Exemplo n.º 9
0
    def setup_test(self):
        self.device_under_test = self.gd_devices[0]
        self.cert_device = self.gd_cert_devices[0]

        self.device_under_test.rootservice.StartStack(
            facade_rootservice_pb2.StartStackRequest(
                module_under_test=facade_rootservice_pb2.BluetoothModule.Value(
                    'HAL'), ))
        self.cert_device.rootservice.StartStack(
            cert_rootservice_pb2.StartStackRequest(
                module_to_test=cert_rootservice_pb2.BluetoothModule.Value(
                    'HAL'), ))

        self.device_under_test.wait_channel_ready()
        self.cert_device.wait_channel_ready()

        self.device_under_test.hal.SendHciResetCommand(empty_pb2.Empty())
        self.cert_device.hal.SendHciResetCommand(empty_pb2.Empty())

        self.hci_event_stream = self.device_under_test.hal.hci_event_stream
Exemplo n.º 10
0
    def setup_test(self):
        self.device_under_test = self.gd_devices[0]
        self.cert_device = self.gd_cert_devices[0]

        self.device_under_test.rootservice.StartStack(
            facade_rootservice_pb2.StartStackRequest(
                module_under_test=facade_rootservice_pb2.BluetoothModule.Value(
                    'HCI'), ))
        self.cert_device.rootservice.StartStack(
            cert_rootservice_pb2.StartStackRequest(
                module_to_test=cert_rootservice_pb2.BluetoothModule.Value(
                    'HCI'), ))

        self.device_under_test.wait_channel_ready()
        self.cert_device.wait_channel_ready()

        self.device_under_test.hci.SetPageScanMode(
            hci_facade_pb2.PageScanMode(enabled=True))
        self.cert_device.hci.SetPageScanMode(
            hci_cert_pb2.PageScanMode(enabled=True))

        dut_address = self.device_under_test.hci.ReadLocalAddress(
            empty_pb2.Empty()).address
        self.device_under_test.address = dut_address
        cert_address = self.cert_device.hci.ReadLocalAddress(
            empty_pb2.Empty()).address
        self.cert_device.address = cert_address

        self.dut_connection_complete_stream = self.device_under_test.hci.connection_complete_stream
        self.dut_disconnection_stream = self.device_under_test.hci.disconnection_stream
        self.dut_connection_failed_stream = self.device_under_test.hci.connection_failed_stream

        self.dut_address = common_pb2.BluetoothAddress(
            address=self.device_under_test.address)
        self.cert_address = common_pb2.BluetoothAddress(
            address=self.cert_device.address)