Loading system/blueberry/tests/gd/rust/topshim/facade/adapter_test.py +17 −4 Original line number Diff line number Diff line Loading @@ -14,13 +14,26 @@ # See the License for the specific language governing permissions and # limitations under the License. from rust.topshim.facade import adapter_test import asyncio from mobly import test_runner from blueberry.tests.gd.rust.topshim.facade import topshim_base_test from blueberry.tests.gd.rust.topshim.facade.automation_helper import AdapterAutomationHelper class AdapterTest(adapter_test.AdapterTest): pass class AdapterTest(topshim_base_test.TopshimBaseTest): async def _test_verify_adapter_started(self): self.dut_adapter = AdapterAutomationHelper(port=self.dut_port) event_loop = asyncio.get_running_loop() self.dut_adapter.fetch_events(event_loop) self.dut_adapter.pending_future = event_loop.create_future() await self.dut_adapter.toggle_stack() await self.dut_adapter.verify_adapter_started() self.dut_adapter.event_handler.cancel() if __name__ == '__main__': def test_verify_adapter_started(self): asyncio.run(self._test_verify_adapter_started()) if __name__ == "__main__": test_runner.main() system/gd/rust/topshim/facade/automation_helper.py→system/blueberry/tests/gd/rust/topshim/facade/automation_helper.py +0 −0 File moved. View file system/gd/rust/topshim/facade/topshim_base_test.py→system/blueberry/tests/gd/rust/topshim/facade/topshim_base_test.py +9 −8 Original line number Diff line number Diff line Loading @@ -22,13 +22,13 @@ import subprocess from blueberry.tests.gd.cert.context import get_current_context from blueberry.tests.gd.cert.tracelogger import TraceLogger from cert.async_subprocess_logger import AsyncSubprocessLogger from cert.os_utils import get_gd_root from cert.os_utils import get_gd_root from cert.os_utils import read_crash_snippet_and_log_tail from cert.os_utils import is_subprocess_alive from cert.os_utils import make_ports_available from cert.os_utils import TerminalColor from blueberry.tests.gd.cert.async_subprocess_logger import AsyncSubprocessLogger from blueberry.tests.gd.cert.os_utils import get_gd_root from blueberry.tests.gd.cert.os_utils import get_gd_root from blueberry.tests.gd.cert.os_utils import read_crash_snippet_and_log_tail from blueberry.tests.gd.cert.os_utils import is_subprocess_alive from blueberry.tests.gd.cert.os_utils import make_ports_available from blueberry.tests.gd.cert.os_utils import TerminalColor from mobly import asserts from mobly import base_test Loading Loading @@ -179,7 +179,8 @@ class TopshimBaseTest(base_test.BaseTestClass): self.controller_configs = self.info['controller_configs'] controllers = self.register_controller(importlib.import_module('rust.topshim.facade.topshim_device')) controllers = self.register_controller( importlib.import_module('blueberry.tests.gd.rust.topshim.facade.topshim_device')) self.cert_port = controllers[0].grpc_port self.dut_port = controllers[1].grpc_port Loading system/gd/rust/topshim/facade/topshim_device.py→system/blueberry/tests/gd/rust/topshim/facade/topshim_device.py +3 −6 Original line number Diff line number Diff line Loading @@ -17,19 +17,16 @@ import logging from blueberry.tests.gd.cert.gd_device import GdHostOnlyDevice from cert.gd_device_lib import create_core from cert.gd_device_lib import destroy_core from cert.gd_device_lib import MOBLY_CONTROLLER_CONFIG_NAME from cert.os_utils import get_gd_root from blueberry.tests.gd.cert.gd_device import MOBLY_CONTROLLER_CONFIG_NAME from blueberry.tests.gd.cert.os_utils import get_gd_root def create(configs): create_core(configs) return get_instances_with_configs(configs) def destroy(devices): destroy_core(devices) pass def replace_vars_for_topshim(string, config): Loading system/gd/Android.bp +4 −4 Original line number Diff line number Diff line Loading @@ -850,11 +850,11 @@ genrule { "mkdir -p $(genDir)/files/blueberry/tests/gd/shim && " + "touch $(genDir)/files/blueberry/tests/gd/shim/__init__.py && " + // Bundle topshim proto here for now "mkdir -p $(genDir)/files/rust/topshim/facade && " + "mkdir -p $(genDir)/files/blueberry/tests/gd/rust/topshim/facade && " + "$(location aprotoc) -Ipackages/modules/Bluetooth/system/gd --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-python-plugin) packages/modules/Bluetooth/system/gd/rust/topshim/facade/facade.proto --grpc_out=$(genDir)/files --python_out=$(genDir)/files && " + "touch $(genDir)/files/rust/__init__.py && " + "touch $(genDir)/files/rust/topshim/__init__.py && " + "touch $(genDir)/files/rust/topshim/facade/__init__.py && " + "touch $(genDir)/files/blueberry/tests/gd/rust/__init__.py && " + "touch $(genDir)/files/blueberry/tests/gd/rust/topshim/__init__.py && " + "touch $(genDir)/files/blueberry/tests/gd/rust/topshim/facade/__init__.py && " + "$(location soong_zip) -C $(genDir)/files -D $(genDir)/files -o $(out)", srcs: [ ":BluetoothFacadeProto", Loading Loading
system/blueberry/tests/gd/rust/topshim/facade/adapter_test.py +17 −4 Original line number Diff line number Diff line Loading @@ -14,13 +14,26 @@ # See the License for the specific language governing permissions and # limitations under the License. from rust.topshim.facade import adapter_test import asyncio from mobly import test_runner from blueberry.tests.gd.rust.topshim.facade import topshim_base_test from blueberry.tests.gd.rust.topshim.facade.automation_helper import AdapterAutomationHelper class AdapterTest(adapter_test.AdapterTest): pass class AdapterTest(topshim_base_test.TopshimBaseTest): async def _test_verify_adapter_started(self): self.dut_adapter = AdapterAutomationHelper(port=self.dut_port) event_loop = asyncio.get_running_loop() self.dut_adapter.fetch_events(event_loop) self.dut_adapter.pending_future = event_loop.create_future() await self.dut_adapter.toggle_stack() await self.dut_adapter.verify_adapter_started() self.dut_adapter.event_handler.cancel() if __name__ == '__main__': def test_verify_adapter_started(self): asyncio.run(self._test_verify_adapter_started()) if __name__ == "__main__": test_runner.main()
system/gd/rust/topshim/facade/automation_helper.py→system/blueberry/tests/gd/rust/topshim/facade/automation_helper.py +0 −0 File moved. View file
system/gd/rust/topshim/facade/topshim_base_test.py→system/blueberry/tests/gd/rust/topshim/facade/topshim_base_test.py +9 −8 Original line number Diff line number Diff line Loading @@ -22,13 +22,13 @@ import subprocess from blueberry.tests.gd.cert.context import get_current_context from blueberry.tests.gd.cert.tracelogger import TraceLogger from cert.async_subprocess_logger import AsyncSubprocessLogger from cert.os_utils import get_gd_root from cert.os_utils import get_gd_root from cert.os_utils import read_crash_snippet_and_log_tail from cert.os_utils import is_subprocess_alive from cert.os_utils import make_ports_available from cert.os_utils import TerminalColor from blueberry.tests.gd.cert.async_subprocess_logger import AsyncSubprocessLogger from blueberry.tests.gd.cert.os_utils import get_gd_root from blueberry.tests.gd.cert.os_utils import get_gd_root from blueberry.tests.gd.cert.os_utils import read_crash_snippet_and_log_tail from blueberry.tests.gd.cert.os_utils import is_subprocess_alive from blueberry.tests.gd.cert.os_utils import make_ports_available from blueberry.tests.gd.cert.os_utils import TerminalColor from mobly import asserts from mobly import base_test Loading Loading @@ -179,7 +179,8 @@ class TopshimBaseTest(base_test.BaseTestClass): self.controller_configs = self.info['controller_configs'] controllers = self.register_controller(importlib.import_module('rust.topshim.facade.topshim_device')) controllers = self.register_controller( importlib.import_module('blueberry.tests.gd.rust.topshim.facade.topshim_device')) self.cert_port = controllers[0].grpc_port self.dut_port = controllers[1].grpc_port Loading
system/gd/rust/topshim/facade/topshim_device.py→system/blueberry/tests/gd/rust/topshim/facade/topshim_device.py +3 −6 Original line number Diff line number Diff line Loading @@ -17,19 +17,16 @@ import logging from blueberry.tests.gd.cert.gd_device import GdHostOnlyDevice from cert.gd_device_lib import create_core from cert.gd_device_lib import destroy_core from cert.gd_device_lib import MOBLY_CONTROLLER_CONFIG_NAME from cert.os_utils import get_gd_root from blueberry.tests.gd.cert.gd_device import MOBLY_CONTROLLER_CONFIG_NAME from blueberry.tests.gd.cert.os_utils import get_gd_root def create(configs): create_core(configs) return get_instances_with_configs(configs) def destroy(devices): destroy_core(devices) pass def replace_vars_for_topshim(string, config): Loading
system/gd/Android.bp +4 −4 Original line number Diff line number Diff line Loading @@ -850,11 +850,11 @@ genrule { "mkdir -p $(genDir)/files/blueberry/tests/gd/shim && " + "touch $(genDir)/files/blueberry/tests/gd/shim/__init__.py && " + // Bundle topshim proto here for now "mkdir -p $(genDir)/files/rust/topshim/facade && " + "mkdir -p $(genDir)/files/blueberry/tests/gd/rust/topshim/facade && " + "$(location aprotoc) -Ipackages/modules/Bluetooth/system/gd --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-python-plugin) packages/modules/Bluetooth/system/gd/rust/topshim/facade/facade.proto --grpc_out=$(genDir)/files --python_out=$(genDir)/files && " + "touch $(genDir)/files/rust/__init__.py && " + "touch $(genDir)/files/rust/topshim/__init__.py && " + "touch $(genDir)/files/rust/topshim/facade/__init__.py && " + "touch $(genDir)/files/blueberry/tests/gd/rust/__init__.py && " + "touch $(genDir)/files/blueberry/tests/gd/rust/topshim/__init__.py && " + "touch $(genDir)/files/blueberry/tests/gd/rust/topshim/facade/__init__.py && " + "$(location soong_zip) -C $(genDir)/files -D $(genDir)/files -o $(out)", srcs: [ ":BluetoothFacadeProto", Loading