Loading system/gd/cert/gd_device.py +3 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ from hal import facade_pb2_grpc as hal_facade_pb2_grpc from hci import facade_pb2_grpc as hci_facade_pb2_grpc from hci.facade import le_advertising_manager_facade_pb2_grpc from l2cap.classic import facade_pb2_grpc as l2cap_facade_pb2_grpc from security import facade_pb2_grpc as security_facade_pb2_grpc ACTS_CONTROLLER_CONFIG_NAME = "GdDevice" ACTS_CONTROLLER_REFERENCE_NAME = "gd_devices" Loading Loading @@ -78,3 +79,5 @@ class GdDevice(GdDeviceBase): self.grpc_channel) self.hci_le_advertising_manager = le_advertising_manager_facade_pb2_grpc.LeAdvertisingManagerFacadeStub( self.grpc_channel) self.security = security_facade_pb2_grpc.SecurityModuleFacadeStub( self.grpc_channel) system/gd/security/cert/simple_security_test.py +20 −0 Original line number Diff line number Diff line Loading @@ -26,7 +26,9 @@ from cert.gd_base_test_facade_only import GdFacadeOnlyBaseTestClass from cert.event_callback_stream import EventCallbackStream from cert.event_asserts import EventAsserts from google.protobuf import empty_pb2 from facade import common_pb2 from facade import rootservice_pb2 as facade_rootservice_pb2 from google.protobuf import empty_pb2 from security import facade_pb2 as security_facade_pb2 from l2cap.classic import facade_pb2 as l2cap_facade_pb2 from bluetooth_packets_python3 import hci_packets Loading @@ -47,6 +49,24 @@ class SimpleSecurityTest(GdFacadeOnlyBaseTestClass): module_under_test=facade_rootservice_pb2.BluetoothModule.Value( 'L2CAP'),)) self.device_under_test.address = self.device_under_test.controller_read_only_property.ReadLocalAddress( empty_pb2.Empty()).address self.cert_device.address = self.cert_device.controller_read_only_property.ReadLocalAddress( empty_pb2.Empty()).address self.dut_address = common_pb2.BluetoothAddress( address=self.device_under_test.address) self.cert_address = common_pb2.BluetoothAddress( address=self.cert_device.address) self.dut_address_with_type = common_pb2.BluetoothAddressWithType() self.dut_address_with_type.address.CopyFrom(self.dut_address) self.dut_address_with_type.type = common_pb2.BluetoothPeerAddressTypeEnum.PUBLIC_DEVICE_OR_IDENTITY_ADDRESS self.cert_address_with_type = common_pb2.BluetoothAddressWithType() self.cert_address_with_type.address.CopyFrom(self.cert_address) self.cert_address_with_type.type = common_pb2.BluetoothPeerAddressTypeEnum.PUBLIC_DEVICE_OR_IDENTITY_ADDRESS self.device_under_test.wait_channel_ready() self.cert_device.wait_channel_ready() Loading Loading
system/gd/cert/gd_device.py +3 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ from hal import facade_pb2_grpc as hal_facade_pb2_grpc from hci import facade_pb2_grpc as hci_facade_pb2_grpc from hci.facade import le_advertising_manager_facade_pb2_grpc from l2cap.classic import facade_pb2_grpc as l2cap_facade_pb2_grpc from security import facade_pb2_grpc as security_facade_pb2_grpc ACTS_CONTROLLER_CONFIG_NAME = "GdDevice" ACTS_CONTROLLER_REFERENCE_NAME = "gd_devices" Loading Loading @@ -78,3 +79,5 @@ class GdDevice(GdDeviceBase): self.grpc_channel) self.hci_le_advertising_manager = le_advertising_manager_facade_pb2_grpc.LeAdvertisingManagerFacadeStub( self.grpc_channel) self.security = security_facade_pb2_grpc.SecurityModuleFacadeStub( self.grpc_channel)
system/gd/security/cert/simple_security_test.py +20 −0 Original line number Diff line number Diff line Loading @@ -26,7 +26,9 @@ from cert.gd_base_test_facade_only import GdFacadeOnlyBaseTestClass from cert.event_callback_stream import EventCallbackStream from cert.event_asserts import EventAsserts from google.protobuf import empty_pb2 from facade import common_pb2 from facade import rootservice_pb2 as facade_rootservice_pb2 from google.protobuf import empty_pb2 from security import facade_pb2 as security_facade_pb2 from l2cap.classic import facade_pb2 as l2cap_facade_pb2 from bluetooth_packets_python3 import hci_packets Loading @@ -47,6 +49,24 @@ class SimpleSecurityTest(GdFacadeOnlyBaseTestClass): module_under_test=facade_rootservice_pb2.BluetoothModule.Value( 'L2CAP'),)) self.device_under_test.address = self.device_under_test.controller_read_only_property.ReadLocalAddress( empty_pb2.Empty()).address self.cert_device.address = self.cert_device.controller_read_only_property.ReadLocalAddress( empty_pb2.Empty()).address self.dut_address = common_pb2.BluetoothAddress( address=self.device_under_test.address) self.cert_address = common_pb2.BluetoothAddress( address=self.cert_device.address) self.dut_address_with_type = common_pb2.BluetoothAddressWithType() self.dut_address_with_type.address.CopyFrom(self.dut_address) self.dut_address_with_type.type = common_pb2.BluetoothPeerAddressTypeEnum.PUBLIC_DEVICE_OR_IDENTITY_ADDRESS self.cert_address_with_type = common_pb2.BluetoothAddressWithType() self.cert_address_with_type.address.CopyFrom(self.cert_address) self.cert_address_with_type.type = common_pb2.BluetoothPeerAddressTypeEnum.PUBLIC_DEVICE_OR_IDENTITY_ADDRESS self.device_under_test.wait_channel_ready() self.cert_device.wait_channel_ready() Loading