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

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

Merge "SecurityModule: Initial cert test"

parents a7cc2839 0c91c03b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -473,7 +473,8 @@ genrule {
        "touch $(genDir)/hci/facade/__init__.py; " +
        "touch $(genDir)/hci/cert/__init__.py; " +
        "touch $(genDir)/l2cap/classic/__init__.py; " +
        "touch $(genDir)/l2cap/classic/cert/__init__.py; ",
        "touch $(genDir)/l2cap/classic/cert/__init__.py; " +
        "touch $(genDir)/security/__init__.py; ",
    srcs: [
        ":BluetoothFacadeProto",
        ":BluetoothCertStackProto",
@@ -504,6 +505,9 @@ genrule {
        "l2cap/classic/cert/__init__.py",
        "l2cap/classic/cert/api_pb2_grpc.py",
        "l2cap/classic/cert/api_pb2.py",
        "security/__init__.py",
        "security/facade_pb2_grpc.py",
        "security/facade_pb2.py",
    ],
}

+2 −1
Original line number Diff line number Diff line
SimpleHalTest
SimpleSecurityTest
+0 −0

File mode changed from 100644 to 100755.

+5 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
#include "l2cap/classic/facade.h"
#include "os/log.h"
#include "os/thread.h"
#include "security/facade.h"
#include "stack_manager.h"

namespace bluetooth {
@@ -62,6 +63,10 @@ class RootFacadeService : public ::bluetooth::facade::RootFacade::Service {
        modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>();
        modules.add<::bluetooth::l2cap::classic::L2capClassicModuleFacadeModule>();
        break;
      case BluetoothModule::SECURITY:
        modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>();
        modules.add<::bluetooth::security::SecurityModuleFacadeModule>();
        break;
      default:
        return ::grpc::Status(::grpc::StatusCode::INVALID_ARGUMENT, "invalid module under test");
    }
+60 −0
Original line number Diff line number Diff line
#!/usr/bin/env python3
#
#   Copyright 2019 - The Android Open Source Project
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

from __future__ import print_function

from datetime import timedelta
import os
import sys

sys.path.append(os.environ['ANDROID_BUILD_TOP'] + '/packages/modules/Bluetooth/system/gd')

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 rootservice_pb2 as facade_rootservice_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


class SimpleSecurityTest(GdFacadeOnlyBaseTestClass):

    def setup_test(self):
        self.cert_device = self.gd_devices[0]
        self.device_under_test = self.gd_devices[1]

        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.wait_channel_ready()
        self.cert_device.wait_channel_ready()

    def teardown_test(self):
        self.device_under_test.rootservice.StopStack(
            facade_rootservice_pb2.StopStackRequest())
        self.cert_device.rootservice.StopStack(
            facade_rootservice_pb2.StopStackRequest())

    def test_pass(self):
        pass