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

Commit fc2fbd16 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Shim stack facade test and fix for test" am: 791845da am: c284cb46 am: f716c462

Change-Id: I7abcf2a2c190dca3f014ad3976edf8f9b34d3814
parents 4833fa74 f716c462
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8,3 +8,4 @@ NeighborTest
ControllerTest
AclManagerTest
LeAclManagerTest
StackTest
+28 −0
Original line number Diff line number Diff line
@@ -33,6 +33,19 @@
#include "os/log.h"
#include "os/thread.h"
#include "security/facade.h"
#include "shim/advertising.h"
#include "shim/connectability.h"
#include "shim/controller.h"
#include "shim/discoverability.h"
#include "shim/dumpsys.h"
#include "shim/hci_layer.h"
#include "shim/inquiry.h"
#include "shim/l2cap.h"
#include "shim/name.h"
#include "shim/page.h"
#include "shim/scanning.h"
#include "shim/security.h"
#include "shim/storage.h"
#include "stack_manager.h"

namespace bluetooth {
@@ -84,6 +97,21 @@ class RootFacadeService : public ::bluetooth::facade::RootFacade::Service {
        modules.add<::bluetooth::facade::ReadOnlyPropertyServerModule>();
        modules.add<::bluetooth::security::SecurityModuleFacadeModule>();
        break;
      case BluetoothModule::SHIM:
        modules.add<::bluetooth::shim::Advertising>();
        modules.add<::bluetooth::shim::Connectability>();
        modules.add<::bluetooth::shim::Controller>();
        modules.add<::bluetooth::shim::Discoverability>();
        modules.add<::bluetooth::shim::Dumpsys>();
        modules.add<::bluetooth::shim::HciLayer>();
        modules.add<::bluetooth::shim::Inquiry>();
        modules.add<::bluetooth::shim::L2cap>();
        modules.add<::bluetooth::shim::Name>();
        modules.add<::bluetooth::shim::Page>();
        modules.add<::bluetooth::shim::Scanning>();
        modules.add<::bluetooth::shim::Security>();
        modules.add<::bluetooth::shim::Storage>();
        break;
      default:
        return ::grpc::Status(::grpc::StatusCode::INVALID_ARGUMENT, "invalid module under test");
    }
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ enum BluetoothModule {
  HCI_INTERFACES = 2;
  L2CAP = 3;
  SECURITY = 4;
  SHIM = 5;
}

message StartStackRequest {
+47 −0
Original line number Diff line number Diff line
#!/usr/bin/env python3
#
#   Copyright 2020 - 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

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 google.protobuf import empty_pb2 as empty_proto
from facade import rootservice_pb2 as facade_rootservice
from hci.facade import controller_facade_pb2 as controller_facade


class StackTest(GdFacadeOnlyBaseTestClass):

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

        self.device_under_test.rootservice.StartStack(
            facade_rootservice.StartStackRequest(
                module_under_test=facade_rootservice.BluetoothModule.Value(
                    'SHIM'),))

        self.device_under_test.wait_channel_ready()

    def teardown_test(self):
        self.device_under_test.rootservice.StopStack(
            facade_rootservice.StopStackRequest())

    def test_test(self):
        return True
+2 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@
#include "shim/security.h"
#include "shim/storage.h"
#include "stack_manager.h"
#include "storage/legacy.h"

using ::bluetooth::os::Thread;

@@ -74,6 +75,7 @@ struct bluetooth::shim::Stack::impl {
    modules.add<::bluetooth::shim::Controller>();
    modules.add<::bluetooth::shim::HciLayer>();
    modules.add<::bluetooth::security::SecurityModule>();
    modules.add<::bluetooth::storage::LegacyModule>();
    modules.add<::bluetooth::shim::Advertising>();
    modules.add<::bluetooth::shim::Connectability>();
    modules.add<::bluetooth::shim::Discoverability>();
Loading