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 := \
$(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 \
-f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-profdata \
-f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/lib64/libc++.so.1
-$(call dist-for-goals,bluetooth_stack_with_facade,$(bluetooth_cert_tests_py_package_zip):bluetooth_cert_tests.zip)
\ No newline at end of file
+$(call dist-for-goals,bluetooth_stack_with_facade,$(bluetooth_cert_tests_py_package_zip):bluetooth_cert_tests.zip)
OUT_TARGET="${ANDROID_BUILD_TOP}/out/target"
TEST_CONFIG="${ANDROID_BUILD_TOP}/system/bt/gd/cert/android_devices_config.json"
TEST_FILTER="-tf ${ANDROID_BUILD_TOP}/system/bt/gd/cert/all_cert_testcases"
+BUILD_TARGET="bluetooth_stack_with_facade"
CLEAN_VENV=false
GOTTA_GO_FAST=false
TEST_CONFIG="${key#*=}"
shift # past argument
;;
+ --rust)
+ BUILD_TARGET="bluetooth_with_facades"
+ TEST_CONFIG=$ANDROID_BUILD_TOP/system/bt/gd/cert/rust_android_devices_config.json
+ shift # past argument
+ ;;
+ --rhost)
+ BUILD_TARGET="bluetooth_with_facades"
+ TEST_CONFIG=$ANDROID_BUILD_TOP/system/bt/gd/cert/rust_host_config.json
+ shift # past argument
+ ;;
# This will log everything to both log file and stdout
--verbose)
VERBOSE_MODE=true
if [[ -n "$1" ]] ; then
TEST_FILTER="-tc $1"
fi
-
+
INSTALL_ARGS="--reuse-acts"
if [ "$CLEAN_VENV" == true ] ; then
echo -e "${YELLOW}Cleaning up existing virtualenv${NOCOLOR}"
}
function soong_build {
- $ANDROID_BUILD_TOP/build/soong/soong_ui.bash --build-mode --"modules-in-a-dir" --dir="${ANDROID_BUILD_TOP}/system/bt/gd" dist bluetooth_stack_with_facade
+ $ANDROID_BUILD_TOP/build/soong/soong_ui.bash --build-mode --"modules-in-a-dir" --dir="${ANDROID_BUILD_TOP}/system/bt/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
}
--- /dev/null
+{ "_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"
+}
--- /dev/null
+
+{ "_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"
+}
.default_value("8895")
.takes_value(true),
)
+ .arg(
+ Arg::with_name("rootcanal-port")
+ .long("rootcanal-port")
+ .takes_value(true),
+ )
+ .arg(
+ Arg::with_name("btsnoop")
+ .long("btsnoop")
+ .takes_value(true),
+ )
+ .arg(
+ Arg::with_name("btconfig")
+ .long("btconfig")
+ .takes_value(true),
+ )
.get_matches();
let root_server_port = value_t!(matches, "root-server-port", u16).unwrap();
.bind("0.0.0.0", root_server_port)
.build()
.unwrap();
+ server.start();
indicate_started(signal_port).await;
sigint.next().await;
host_executables = [
'root-canal',
- 'bluetooth_stack_with_facade',
+ 'bluetooth_stack_with_facade', # c++
+ 'bluetooth_with_facades', # rust
]