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

Commit 353033c6 authored by Zach Johnson's avatar Zach Johnson Committed by Gerrit Code Review
Browse files

Merge changes Ibd11c0a8,I11fe6201,I63049dbb,I97ef3f26,I11cbffde, ...

* changes:
  rusty-gd: clean up imports & pub exports
  rusty-gd: remove one level of indirection for hci facade proto
  rusty-gd: collapse facade implementation into facade.rs
  rusty-gd: move hci facade client contents to root server
  Start integration with gd rust & cert tests
  GD: signal on signal port when server is ready
  Catch sigint to shut down BT testing process
parents 62fe9dcd b7fc6c7c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ LOCAL_cert_test_sources := \

LOCAL_host_executables := \
	$(HOST_OUT_EXECUTABLES)/bluetooth_stack_with_facade \
	$(HOST_OUT_EXECUTABLES)/bluetooth_with_facades \
	$(HOST_OUT_EXECUTABLES)/root-canal

LOCAL_host_python_extension_libraries := \
@@ -23,7 +24,10 @@ LOCAL_host_libraries := \
	$(HOST_OUT_SHARED_LIBRARIES)/libcrypto-host.so \
	$(HOST_OUT_SHARED_LIBRARIES)/libevent-host.so \
	$(HOST_OUT_SHARED_LIBRARIES)/libgrpc++_unsecure.so \
	$(HOST_OUT_SHARED_LIBRARIES)/libgrpc++.so \
	$(HOST_OUT_SHARED_LIBRARIES)/libgrpc_wrap.so \
	$(HOST_OUT_SHARED_LIBRARIES)/liblog.so \
	$(HOST_OUT_SHARED_LIBRARIES)/libssl-host.so \
	$(HOST_OUT_SHARED_LIBRARIES)/libz-host.so \
	$(HOST_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-full.so \
	$(HOST_OUT_SHARED_LIBRARIES)/libunwindstack.so \
+14 −3
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ CERT_TEST_VENV=${ANDROID_BUILD_TOP}/out/dist/bluetooth_venv
OUT_TARGET="${ANDROID_BUILD_TOP}/out/target"
TEST_CONFIG="${ANDROID_BUILD_TOP}/packages/modules/Bluetooth/system/gd/cert/android_devices_config.json"
TEST_FILTER="-tf ${ANDROID_BUILD_TOP}/packages/modules/Bluetooth/system/gd/cert/all_cert_testcases"
BUILD_TARGET="bluetooth_stack_with_facade"

CLEAN_VENV=false
GOTTA_GO_FAST=false
@@ -150,6 +151,16 @@ function parse_options {
        TEST_CONFIG="${key#*=}"
        shift # past argument
        ;;
        --rust)
        BUILD_TARGET="bluetooth_with_facades"
        TEST_CONFIG=$ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd/cert/rust_android_devices_config.json
        shift # past argument
        ;;
        --rhost)
        BUILD_TARGET="bluetooth_with_facades"
        TEST_CONFIG=$ANDROID_BUILD_TOP/packages/modules/Bluetooth/system/gd/cert/rust_host_config.json
        shift # past argument
        ;;
        # This will log everything to both log file and stdout
        --verbose)
        VERBOSE_MODE=true
@@ -182,9 +193,9 @@ function parse_options {
}

function soong_build {
    $ANDROID_BUILD_TOP/build/soong/soong_ui.bash --build-mode --"modules-in-a-dir" --dir="${ANDROID_BUILD_TOP}/packages/modules/Bluetooth/system/gd" dist bluetooth_stack_with_facade
    $ANDROID_BUILD_TOP/build/soong/soong_ui.bash --build-mode --"modules-in-a-dir" --dir="${ANDROID_BUILD_TOP}/packages/modules/Bluetooth/system/gd" dist $BUILD_TARGET
    if [[ $? -ne 0 ]] ; then
        echo "Failed to build bluetooth_stack_with_facade"
        echo "Failed to build ${BUILD_TARGET}"
        exit 1
    fi
}
+55 −0
Original line number Diff line number Diff line
{   "_description": "Bluetooth cert testing",
    "testbed":
    [
        {
            "_description": "Two Android devices cert testbed",
            "name": "AndroidDeviceCert",
            "GdDevice":
            [
                {
                    "grpc_port": "8898",
                    "grpc_root_server_port": "8896",
                    "signal_port": "8894",
                    "label": "cert",
                    "serial_number": "CERT",
                    "name": "Cert Device",
                    "cmd":
                    [
                        "adb",
                        "-s",
                        "$(serial_number)",
                        "shell",
                        "/system/bin/bluetooth_with_facadas",
                        "--grpc-port=$(grpc_port)",
                        "--root-server-port=$(grpc_root_server_port)",
                        "--btsnoop=/data/misc/bluetooth/logs/btsnoop_hci.log",
                        "--btconfig=/data/misc/bluedroid/bt_config.conf",
                        "--signal-port=$(signal_port)"
                    ]
                },
                {
                    "grpc_port": "8899",
                    "grpc_root_server_port": "8897",
                    "signal_port": "8895",
                    "label": "dut",
                    "serial_number": "DUT",
                    "name": "DUT Device",
                    "cmd":
                    [
                        "adb",
                        "-s",
                        "$(serial_number)",
                        "shell",
                        "/system/bin/bluetooth_with_facades",
                        "--grpc-port=$(grpc_port)",
                        "--root-server-port=$(grpc_root_server_port)",
                        "--btsnoop=/data/misc/bluetooth/logs/btsnoop_hci.log",
                        "--btconfig=/data/misc/bluedroid/bt_config.conf",
                        "--signal-port=$(signal_port)"
                    ]
                }
            ]
        }
    ],
    "logpath": "/tmp/logs"
}
+50 −0
Original line number Diff line number Diff line

{   "_description": "Bluetooth cert testing",
    "testbed":
    [
        {
            "_description": "Host only cert testbed",
            "name": "HostOnlyCert",
            "rootcanal":
            {
                "test_port": "6401",
                "hci_port": "6402",
                "link_layer_port": "6403"
            },
            "GdDevice":
            [
                {
                    "grpc_port": "8998",
                    "grpc_root_server_port": "8996",
                    "signal_port": "8994",
                    "label": "cert",
                    "name": "Cert Device",
                    "cmd":
                    [
                        "$GD_ROOT/bluetooth_with_facades",
                        "--grpc-port=$(grpc_port)",
                        "--root-server-port=$(grpc_root_server_port)",
                        "--rootcanal-port=$(rootcanal_port)",
                        "--signal-port=$(signal_port)"
                    ]
                },
                {
                    "grpc_port": "8999",
                    "grpc_root_server_port": "8997",
                    "signal_port": "8995",
                    "label": "dut",
                    "name": "DUT Device",
                    "cmd":
                    [
                        "$GD_ROOT/bluetooth_with_facades",
                        "--grpc-port=$(grpc_port)",
                        "--root-server-port=$(grpc_root_server_port)",
                        "--rootcanal-port=$(rootcanal_port)",
                        "--signal-port=$(signal_port)"
                    ]
                }
            ]
        }
    ],
    "logpath": "/tmp/logs"
}
+3 −0
Original line number Diff line number Diff line
@@ -4,6 +4,8 @@ rust_library {
    srcs: ["src/lib.rs"],
    edition: "2018",
    rustlibs: [
      "libbt_hal",
      "libbt_hci",
      "libbt_facade_rootservice_proto",
      "libbt_facade_common_proto",
      "libfutures",
@@ -24,6 +26,7 @@ rust_binary {
      "libfutures",
      "libgrpcio",
      "libtokio",
      "libnix",
    ],
    host_supported: true,
}
Loading