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

Commit 2ee9e615 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "ACL manager cert"

parents 7f3723c7 c3eb1c9e
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -140,6 +140,7 @@ cc_binary {
        "facade/grpc_root_server.cc",
        "grpc/grpc_module.cc",
        ":BluetoothFacade_hci_hal",
        ":BluetoothFacade_hci_layer",
    ],
    generated_headers: [
        "BluetoothGeneratedPackets_h",
@@ -183,6 +184,7 @@ cc_binary {
        "cert/grpc_root_server.cc",
        "grpc/grpc_module.cc",
        ":BluetoothCertSource_hci_hal",
        ":BluetoothCertSource_hci_layer",
    ],
    generated_headers: [
        "BluetoothGeneratedPackets_h",
@@ -331,6 +333,7 @@ filegroup {
        "facade/common.proto",
        "facade/rootservice.proto",
        "hal/facade.proto",
        "hci/facade.proto",
    ],
}

@@ -351,6 +354,8 @@ genrule {
        "facade/rootservice.pb.h",
        "hal/facade.grpc.pb.h",
        "hal/facade.pb.h",
        "hci/facade.grpc.pb.h",
        "hci/facade.pb.h",
    ],
}

@@ -371,6 +376,8 @@ genrule {
        "facade/rootservice.pb.cc",
        "hal/facade.grpc.pb.cc",
        "hal/facade.pb.cc",
        "hci/facade.grpc.pb.cc",
        "hci/facade.pb.cc",
    ],
}

@@ -383,7 +390,9 @@ genrule {
    cmd: "$(location aprotoc) -Ipackages/modules/Bluetooth/system/gd -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-python-plugin) $(in) --grpc_out=$(genDir) --python_out=$(genDir); " +
        "touch $(genDir)/facade/__init__.py; " +
        "touch $(genDir)/hal/__init__.py; " +
        "touch $(genDir)/hal/cert/__init__.py; ",
        "touch $(genDir)/hal/cert/__init__.py; " +
        "touch $(genDir)/hci/__init__.py; " +
        "touch $(genDir)/hci/cert/__init__.py; ",
    srcs: [
        ":BluetoothFacadeProto",
        ":BluetoothCertStackProto",
@@ -399,9 +408,15 @@ genrule {
        "hal/__init__.py",
        "hal/facade_pb2_grpc.py",
        "hal/facade_pb2.py",
        "hci/__init__.py",
        "hci/facade_pb2_grpc.py",
        "hci/facade_pb2.py",
        "hal/cert/__init__.py",
        "hal/cert/api_pb2_grpc.py",
        "hal/cert/api_pb2.py",
        "hci/cert/__init__.py",
        "hci/cert/api_pb2_grpc.py",
        "hci/cert/api_pb2.py",
    ],
}

@@ -410,6 +425,7 @@ filegroup {
    srcs: [
        "cert/rootservice.proto",
        "hal/cert/api.proto",
        "hci/cert/api.proto",
    ],
}

@@ -431,6 +447,8 @@ genrule {
        "facade/common.pb.h",
        "hal/cert/api.grpc.pb.h",
        "hal/cert/api.pb.h",
        "hci/cert/api.grpc.pb.h",
        "hci/cert/api.pb.h",
    ],
}

@@ -452,5 +470,7 @@ genrule {
        "facade/common.pb.cc",
        "hal/cert/api.grpc.pb.cc",
        "hal/cert/api.pb.cc",
        "hci/cert/api.grpc.pb.cc",
        "hci/cert/api.pb.cc",
    ],
}
+1 −0
Original line number Diff line number Diff line
SimpleHalTest
SimpleHciTest
+10 −0
Original line number Diff line number Diff line
@@ -17,8 +17,10 @@
from gd_device_base import GdDeviceBase
from gd_device_base import replace_vars

from cert.event_stream import EventStream
from cert import rootservice_pb2_grpc as cert_rootservice_pb2_grpc
from hal.cert import api_pb2_grpc as hal_cert_pb2_grpc
from hci.cert import api_pb2_grpc as hci_cert_pb2_grpc

ACTS_CONTROLLER_CONFIG_NAME = "GdCertDevice"
ACTS_CONTROLLER_REFERENCE_NAME = "gd_cert_devices"
@@ -56,6 +58,14 @@ def get_instances_with_configs(configs):
class GdCertDevice(GdDeviceBase):
    def __init__(self, grpc_port, grpc_root_server_port, cmd, label):
        super().__init__(grpc_port, grpc_root_server_port, cmd, label, ACTS_CONTROLLER_CONFIG_NAME)

        # Cert stubs
        self.rootservice = cert_rootservice_pb2_grpc.RootCertStub(self.grpc_root_server_channel)
        self.hal = hal_cert_pb2_grpc.HciHalCertStub(self.grpc_channel)
        self.hci = hci_cert_pb2_grpc.AclManagerCertStub(self.grpc_channel)

        # Event streams
        self.hci.connection_complete_stream = EventStream(self.hci.FetchConnectionComplete)
        self.hci.disconnection_stream = EventStream(self.hci.FetchDisconnection)
        self.hci.connection_failed_stream = EventStream(self.hci.FetchConnectionFailed)
        self.hci.acl_stream = EventStream(self.hci.FetchAclData)
+10 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ from gd_device_base import replace_vars
from cert.event_stream import EventStream
from facade import rootservice_pb2_grpc as facade_rootservice_pb2_grpc
from hal import facade_pb2_grpc as hal_facade_pb2_grpc
from hci import facade_pb2_grpc as hci_facade_pb2_grpc

ACTS_CONTROLLER_CONFIG_NAME = "GdDevice"
ACTS_CONTROLLER_REFERENCE_NAME = "gd_devices"
@@ -57,8 +58,17 @@ def get_instances_with_configs(configs):
class GdDevice(GdDeviceBase):
    def __init__(self, grpc_port, grpc_root_server_port, cmd, label):
        super().__init__(grpc_port, grpc_root_server_port, cmd, label, ACTS_CONTROLLER_CONFIG_NAME)

        # Facade stubs
        self.rootservice = facade_rootservice_pb2_grpc.RootFacadeStub(self.grpc_root_server_channel)
        self.hal = hal_facade_pb2_grpc.HciHalFacadeStub(self.grpc_channel)
        self.hci = hci_facade_pb2_grpc.AclManagerFacadeStub(self.grpc_channel)

        # Event streams
        self.hal.hci_event_stream = EventStream(self.hal.FetchHciEvent)
        self.hal.hci_acl_stream = EventStream(self.hal.FetchHciAcl)
        self.hal.hci_sco_stream = EventStream(self.hal.FetchHciSco)
        self.hci.connection_complete_stream = EventStream(self.hci.FetchConnectionComplete)
        self.hci.disconnection_stream = EventStream(self.hci.FetchDisconnection)
        self.hci.connection_failed_stream = EventStream(self.hci.FetchConnectionFailed)
        self.hci.acl_stream = EventStream(self.hci.FetchAclData)
+3 −2
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ class GdDeviceBase:
            stderr=self.backing_process_logs)
        tester_signal_socket.accept()
        tester_signal_socket.close()
        os.unlink(socket_address)

        self.grpc_root_server_channel = grpc.insecure_channel("localhost:" + grpc_root_server_port)
        self.grpc_port = int(grpc_port)
@@ -83,8 +84,8 @@ class GdDeviceBase:
        backing_process_return_code = self.backing_process.wait()
        self.backing_process_logs.close()
        if backing_process_return_code != 0:
            logging.error("backing process stopped with code: %d" %
                          backing_process_return_code)
            logging.error("backing process %s stopped with code: %d" %
                          (self.label, backing_process_return_code))
            return False

    def wait_channel_ready(self):
Loading