Skip to content

Add Android IceBT-over-Bluetooth CI testing#5839

Draft
externl wants to merge 3 commits into
zeroc-ice:mainfrom
externl:icebt-bluetooth-ci
Draft

Add Android IceBT-over-Bluetooth CI testing#5839
externl wants to merge 3 commits into
zeroc-ice:mainfrom
externl:icebt-bluetooth-ci

Conversation

@externl

@externl externl commented Jul 7, 2026

Copy link
Copy Markdown
Member

Adds CI coverage for the IceBT (Bluetooth) transport by running real Ice test suites between two Android emulators over the emulator's userspace virtual Bluetooth controller (Netsim/Rootcanal) — no hardware. GitHub-hosted Linux runners can't host a Bluetooth stack, but two emulators do RFCOMM between themselves.

  • Hardware-free endpoint tests (cpp/test/IceBT/endpoints) — parse bt/bts endpoint strings with the plug-in registered but not initialized (Ice.InitPlugins=0); run in the normal Linux suite under tcp.
  • Two-emulator harness support (scripts/Util.py) — device-scoped adb + a per-emulator forward port, four two-device reachability fixes, and adb-driven device-setup helpers (boot-wait, priv-app install, BT enable, bond).
  • The workflow (.github/workflows/bt-android-harness.yml + java/test/android/btecho) — builds the Java libs + controller APK + a pre-bond helper, boots two emulators, prepares/bonds them via Controller.py --bt-setup/--bt-bond, then runs Controller.py (server) + allTests.py (client) over --protocol=bt.

Runs nightly and on PRs touching the IceBT transport or the shared harness. Exercises Ice/operations plus the marshalling core (ami, enums, inheritance, objects, optional) — the suites verified to pass over emulated RFCOMM. C++↔Java cross-tests stay out of scope (the C++ side needs a host Bluetooth stack). Supersedes #5803.

Copilot AI review requested due to automatic review settings July 7, 2026 15:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds CI coverage for the IceBT (Bluetooth) transport by introducing a two-Android-emulator test harness that runs real Ice Java test suites over emulated RFCOMM (Netsim/Rootcanal), plus a hardware-free C++ endpoint-parsing test and a Linux runner capability probe.

Changes:

  • Extend the Python test harness to support two concurrent Android devices/emulators with per-device adb scoping, per-emulator port forwarding, and process-proxy rebinding over the controller connection.
  • Add a small Android “pre-bond” helper app (btecho) and a dedicated GitHub Actions workflow to boot two emulators, bond them, and run selected suites over --protocol=bt.
  • Add a C++ IceBT endpoint parsing test that doesn’t require a live Bluetooth stack, and add a non-blocking probe step in the main CI workflow to record runner Bluetooth limitations.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scripts/Util.py Updates Android harness behavior for two-device runs (adb scoping, per-emulator forwards, process proxy rebinding).
java/test/android/btecho/src/main/java/com/zeroc/btecho/MainActivity.java Adds a minimal Bluetooth RFCOMM echo/bond helper activity used by CI pre-bonding.
java/test/android/btecho/src/main/AndroidManifest.xml Declares Bluetooth permissions needed for the pre-bond helper in CI.
java/test/android/btecho/settings.gradle New Gradle settings for the standalone helper app.
java/test/android/btecho/gradlew.bat Adds Gradle wrapper script for Windows (helper app build).
java/test/android/btecho/gradlew Adds Gradle wrapper script for POSIX (helper app build).
java/test/android/btecho/gradle/wrapper/gradle-wrapper.properties Adds Gradle wrapper configuration for the helper app.
java/test/android/btecho/gradle/GRADLE_LICENSE Adds Gradle license text for wrapper distribution.
java/test/android/btecho/gradle.properties Adds Gradle properties used by the helper app project.
java/test/android/btecho/build.gradle Defines the Android application build for the helper app.
cpp/test/IceBT/endpoints/test.py Adds Linux-only harness gating for the new endpoint parsing test (matching build conditions).
cpp/test/IceBT/endpoints/Makefile.mk Builds the endpoint parsing test only when IceBT system libs are available.
cpp/test/IceBT/endpoints/Client.cpp Implements hardware-free parsing/round-trip tests for bt/bts endpoints with plugins not initialized.
BLUETOOTH.md Documents running Android client/server over Bluetooth using two emulators.
.github/workflows/ci.yml Adds a non-failing probe step to report Linux runner Bluetooth stack capability signals.
.github/workflows/bt-android-harness.yml Introduces a scheduled/targeted workflow that runs Android↔Android IceBT tests over emulated Bluetooth.

Comment thread scripts/Util.py
Comment thread java/test/android/btecho/src/main/java/com/zeroc/btecho/MainActivity.java Outdated
Comment thread java/test/android/btecho/src/main/java/com/zeroc/btecho/MainActivity.java Outdated
@externl
externl force-pushed the icebt-bluetooth-ci branch 2 times, most recently from 17f7ce6 to 403bd1d Compare July 7, 2026 18:17
@externl
externl marked this pull request as draft July 7, 2026 19:28
@externl
externl force-pushed the icebt-bluetooth-ci branch 6 times, most recently from aa99c6c to e973700 Compare July 8, 2026 16:35
externl added 3 commits July 8, 2026 16:42
Add cpp/test/IceBT/endpoints, a client-only test that parses bt/bts endpoint
strings with the IceBT plug-in registered but not initialized (Ice.InitPlugins=0),
so it needs no BlueZ/D-Bus/radio and runs in the normal Linux suite under tcp.
Extend the Android process controller so the harness can drive two emulators at
once, which IceBT-over-Bluetooth cross-testing requires (server on one emulator,
client on the other). Device-scope every adb call and give each emulator its own
host-side forward port derived from its serial.

Fix four issues that only surface with two devices:
- stopControllerApp ran `adb kill-server`, a global reset that dropped both
  emulators' forwards; only reset adb when we own (and just killed) the emulator.
- The host->device forward was not re-established after a controller restart.
- Spawned process proxies are advertised on the device port, reachable from the
  host only through the per-emulator forward; rebind them onto the controller
  connection (bindProcessesToController).
- The pidof check used a bare `adb`, ambiguous with two devices.

Also add adb-driven device-setup and diagnostics helpers (waitForBoot,
bluetoothAddress, enableBluetooth, grantRuntimePermissions, installSystemApp for a
privileged /system/priv-app install, bond, and diagnostics), plus a lightweight
forDevice constructor, so the CI Bluetooth preparation runs through the harness
rather than inline adb shell. installSystemApp retries `adb root`/remount, which can
transiently fail when two emulators share one adb server.
Add a workflow that runs real Ice test suites between two Android emulators over
emulated Bluetooth. GitHub-hosted Linux runners cannot host a Bluetooth stack,
but the Android emulator's userspace virtual controller (Netsim/Rootcanal) does
RFCOMM between emulators.

It builds the Ice/IceBT/test Java libs, the controller APK, and btecho (a tiny
pre-bond helper, since IceBT uses secure RFCOMM which requires a BR/EDR bond),
boots two emulators on Netsim BT, then prepares and bonds them via Controller.py
--bt-setup / --bt-bond (installing btecho as a privileged system app), runs
Controller.py (server) + allTests.py (client) over --protocol=bt, and dumps adb
state via --bt-diagnostics. Runs nightly and on PRs touching the IceBT transport
or the shared test harness.

The suite list -- Ice/operations plus the marshalling core (ami, enums,
inheritance, objects, optional) -- is the set verified to pass over emulated RFCOMM.
@externl
externl force-pushed the icebt-bluetooth-ci branch from e973700 to b16c9da Compare July 8, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants