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

Commit 4dda5f9e authored by Charlie Boutier's avatar Charlie Boutier Committed by Automerger Merge Worker
Browse files

Merge changes from topic "pandora" am: f6fec469

parents c2053e3f f6fec469
Loading
Loading
Loading
Loading
+11 −11
Original line number Original line Diff line number Diff line
@@ -3,7 +3,7 @@ package {
}
}


android_test_helper_app {
android_test_helper_app {
    name: "BlueberryServer",
    name: "PandoraServer",
    srcs: ["src/**/*.kt"],
    srcs: ["src/**/*.kt"],
    platform_apis: true,
    platform_apis: true,
    certificate: "platform",
    certificate: "platform",
@@ -16,8 +16,8 @@ android_test_helper_app {
        "guava",
        "guava",
        "opencensus-java-api",
        "opencensus-java-api",
        "kotlinx_coroutines",
        "kotlinx_coroutines",
        "blueberry-grpc-java",
        "pandora-grpc-java",
        "blueberry-proto-java",
        "pandora-proto-java",
        "opencensus-java-contrib-grpc-metrics",
        "opencensus-java-contrib-grpc-metrics",
    ],
    ],


@@ -31,19 +31,19 @@ android_test_helper_app {


android_test {
android_test {
    name: "pts-bot",
    name: "pts-bot",
    required: ["BlueberryServer"],
    required: ["PandoraServer"],
    test_config: "configs/PtsBotTest.xml",
    test_config: "configs/PtsBotTest.xml",
    data: ["configs/pts_bot_tests_config.json"],
    data: ["configs/pts_bot_tests_config.json"],
}
}


java_library {
java_library {
    name: "blueberry-grpc-java",
    name: "pandora-grpc-java",
    visibility: ["//visibility:private"],
    visibility: ["//visibility:private"],
    srcs: [
    srcs: [
        "proto/blueberry/*.proto",
        "proto/pandora/*.proto",
    ],
    ],
    static_libs: [
    static_libs: [
        "blueberry-proto-java",
        "pandora-proto-java",
        "grpc-java-lite",
        "grpc-java-lite",
        "guava",
        "guava",
        "opencensus-java-api",
        "opencensus-java-api",
@@ -52,7 +52,7 @@ java_library {
    ],
    ],
    proto: {
    proto: {
        include_dirs: [
        include_dirs: [
            "packages/modules/Bluetooth/android/blueberry/server/proto",
            "packages/modules/Bluetooth/android/pandora/server/proto",
            "external/protobuf/src",
            "external/protobuf/src",
        ],
        ],
        plugin: "grpc-java-plugin",
        plugin: "grpc-java-plugin",
@@ -63,10 +63,10 @@ java_library {
}
}


java_library {
java_library {
    name: "blueberry-proto-java",
    name: "pandora-proto-java",
    visibility: ["//visibility:private"],
    visibility: ["//visibility:private"],
    srcs: [
    srcs: [
        "proto/blueberry/*.proto",
        "proto/pandora/*.proto",
        ":libprotobuf-internal-protos",
        ":libprotobuf-internal-protos",
    ],
    ],
    static_libs: [
    static_libs: [
@@ -75,7 +75,7 @@ java_library {
    proto: {
    proto: {
        type: "lite",
        type: "lite",
        include_dirs: [
        include_dirs: [
            "packages/modules/Bluetooth/android/blueberry/server/proto",
            "packages/modules/Bluetooth/android/pandora/server/proto",
            "external/protobuf/src",
            "external/protobuf/src",
        ],
        ],
    },
    },
+4 −4
Original line number Original line Diff line number Diff line
@@ -15,7 +15,7 @@
-->
-->


<manifest xmlns:android="http://schemas.android.com/apk/res/android"
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.blueberry">
    package="com.android.pandora">


    <application>
    <application>
        <uses-library android:name="android.test.runner" />
        <uses-library android:name="android.test.runner" />
@@ -27,7 +27,7 @@
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.LOCAL_MAC_ADDRESS" />
    <uses-permission android:name="android.permission.LOCAL_MAC_ADDRESS" />


    <instrumentation android:name="com.android.blueberry.Main"
    <instrumentation android:name="com.android.pandora.Main"
                     android:targetPackage="com.android.blueberry"
                     android:targetPackage="com.android.pandora"
                     android:label="Blueberry Android Server" />
                     android:label="Pandora Android Server" />
</manifest>
</manifest>
+14 −14
Original line number Original line Diff line number Diff line
# Blueberry Android server
# Pandora Android server


The Blueberry Android server exposes the [Blueberry test interfaces](
The Pandora Android server exposes the [Pandora test interfaces](
go/blueberry-doc) over gRPC implemented on top of the Android Bluetooth SDK.
go/pandora-doc) over gRPC implemented on top of the Android Bluetooth SDK.


## Getting started
## Getting started


Using Blueberry Android server requires to:
Using Pandora Android server requires to:


* Build AOSP for your DUT, which can be either a physical device or an Android
* Build AOSP for your DUT, which can be either a physical device or an Android
  Virtual Device (AVD).
  Virtual Device (AVD).
* [Only for virtual tests] Build Rootcanal, the Android
* [Only for virtual tests] Build Rootcanal, the Android
  virtual Bluetooth Controller.
  virtual Bluetooth Controller.
* Setup your test environment.
* Setup your test environment.
* Build, install, and run Blueberry server.
* Build, install, and run Pandora server.
* Run your tests.
* Run your tests.


### 1. Build and run AOSP code
### 1. Build and run AOSP code
@@ -62,25 +62,25 @@ with the following steps to setup the test environment:
    `adb forward tcp:<rootcanal-port> tcp:<rootcanal-port>`.
    `adb forward tcp:<rootcanal-port> tcp:<rootcanal-port>`.
    Rootcanal port number may differ depending on its configuration. It is
    Rootcanal port number may differ depending on its configuration. It is
    7200 for the AVD, and generally 6211 for physical devices.
    7200 for the AVD, and generally 6211 for physical devices.
* Forward Blueberry Android server port through ADB:
* Forward Pandora Android server port through ADB:
  `adb forward tcp:8999 tcp:8999`.
  `adb forward tcp:8999 tcp:8999`.


The above steps can be done by executing the `setup.sh` helper script (the
The above steps can be done by executing the `setup.sh` helper script (the
`-rootcanal` option must be used for virtual tests on a physical device).
`-rootcanal` option must be used for virtual tests on a physical device).


Finally, you must also make sure that the machine on which tests are executed
Finally, you must also make sure that the machine on which tests are executed
can access the ports of the Blueberry Android server, Rootcanal (if required),
can access the ports of the Pandora Android server, Rootcanal (if required),
and ADB (if required).
and ADB (if required).


You can also check the usage examples provided below.
You can also check the usage examples provided below.


### 4. Build, install, and run Blueberry Android server
### 4. Build, install, and run Pandora Android server


* `m BlueberryServer`
* `m PandoraServer`
* `adb install -r -g out/target/product/<device>/testcases/Blueberry/arm64/Blueberry.apk`
* `adb install -r -g out/target/product/<device>/testcases/Pandora/arm64/Pandora.apk`


* Start the instrumented app:
* Start the instrumented app:
* `adb shell am instrument -w -e Debug false com.android.blueberry/.Server`
* `adb shell am instrument -w -e Debug false com.android.pandora/.Server`


### 5. Run your tests
### 5. Run your tests


@@ -93,13 +93,13 @@ Here are some usage examples:
* **DUT**: physical
* **DUT**: physical
  **Test type**: virtual
  **Test type**: virtual
  **Test executer**: remote instance (for instance a Cloudtop) accessed via SSH
  **Test executer**: remote instance (for instance a Cloudtop) accessed via SSH
  **Blueberry Android server repository location**: local machine (typically
  **Pandora Android server repository location**: local machine (typically
  using Android Studio)
  using Android Studio)


  * On your local machine: `./setup.sh --rootcanal`.
  * On your local machine: `./setup.sh --rootcanal`.
  * On your local machine: build and install the app on your DUT.
  * On your local machine: build and install the app on your DUT.
  * Log on your remote instance, and forward Rootcanal port (6211, may change
  * Log on your remote instance, and forward Rootcanal port (6211, may change
    depending on your build) and Blueberry Android server (8999) port:
    depending on your build) and Pandora Android server (8999) port:
    `ssh -R 6211:localhost:6211 -R 8999:localhost:8999 <remote-instance>`.
    `ssh -R 6211:localhost:6211 -R 8999:localhost:8999 <remote-instance>`.
    Optionnally, you can also share ADB port to your remote instance (if
    Optionnally, you can also share ADB port to your remote instance (if
    needed) by adding `-R 5037:localhost:5037` to the command.
    needed) by adding `-R 5037:localhost:5037` to the command.
@@ -108,7 +108,7 @@ Here are some usage examples:
* **DUT**: virtual (running in remote instance)
* **DUT**: virtual (running in remote instance)
  **Test type**: virtual
  **Test type**: virtual
  **Test executer**: remote instance
  **Test executer**: remote instance
  **Blueberry Android server repository location**: remote instance
  **Pandora Android server repository location**: remote instance


  On your remote instance:
  On your remote instance:
  * `./setup.sh`.
  * `./setup.sh`.
+3 −3
Original line number Original line Diff line number Diff line
<configuration description="Runs PTS-bot tests">
<configuration description="Runs PTS-bot tests">


    <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
    <target_preparer class="com.android.tradefed.targetprep.TestAppInstallSetup">
        <option name="test-file-name" value="BlueberryServer.apk" />
        <option name="test-file-name" value="PandoraServer.apk" />
        <option name="install-arg" value="-r" />
        <option name="install-arg" value="-r" />
        <option name="install-arg" value="-g" />
        <option name="install-arg" value="-g" />
    </target_preparer>
    </target_preparer>
    <target_preparer class="com.android.tradefed.targetprep.InstallApkSetup">
    <target_preparer class="com.android.tradefed.targetprep.InstallApkSetup">
        <option name="post-install-cmd" value="am instrument -e Debug false com.android.blueberry/.Main" />
        <option name="post-install-cmd" value="am instrument -e Debug false com.android.pandora/.Main" />
    </target_preparer>
    </target_preparer>


    <test class="com.android.tradefed.testtype.blueberry.PtsBotTest" >
    <test class="com.android.tradefed.testtype.pandora.PtsBotTest" >
        <option name="mmi2grpc" value="empty" />
        <option name="mmi2grpc" value="empty" />
        <option name="tests-config-file" value="pts_bot_tests_config.json" />
        <option name="tests-config-file" value="pts_bot_tests_config.json" />
        <option name="physical" value="false" />
        <option name="physical" value="false" />
+2 −2
Original line number Original line Diff line number Diff line
@@ -2,9 +2,9 @@ syntax = "proto3";


option java_outer_classname = "A2dpProto";
option java_outer_classname = "A2dpProto";


package blueberry;
package pandora;


import "blueberry/host.proto";
import "pandora/host.proto";
import "google/protobuf/wrappers.proto";
import "google/protobuf/wrappers.proto";


// Service to trigger A2DP (Advanced Audio Distribution Profile) procedures.
// Service to trigger A2DP (Advanced Audio Distribution Profile) procedures.
Loading