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

Commit cbbb39bb authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Cert: Fix test infra to meet latest environment requirement"

parents 229c1498 430d97ff
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ LOCAL_target_executables := \
	$(TARGET_OUT_EXECUTABLES)/bluetooth_stack_with_facade

LOCAL_target_libraries := \
	$(TARGET_OUT_SHARED_LIBRARIES)/android.system.suspend.control-V1-ndk.so \
	$(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so \
	$(TARGET_OUT_SHARED_LIBRARIES)/libbluetooth_gd.so \
	$(TARGET_OUT_SHARED_LIBRARIES)/libgrpc++_unsecure.so \
+3 −5
Original line number Diff line number Diff line
@@ -480,8 +480,7 @@ class GdAndroidDevice(GdDeviceBase):
        # Try freeing ports and ignore results
        asserts.assert_true(
            make_ports_available((self.grpc_port, self.grpc_root_server_port, self.signal_port)),
            "[%s] Failed to make backing process ports available" % self.label
        )
            "[%s] Failed to make backing process ports available" % self.label)
        self.cleanup_port_forwarding()
        self.sync_device_time()
        logging.info("Ports cleaned up and clock is set for device %s %s" % (self.label, self.serial_number))
@@ -495,8 +494,6 @@ class GdAndroidDevice(GdDeviceBase):

        # Push test binaries
        self.push_or_die(os.path.join(get_gd_root(), "target", "bluetooth_stack_with_facade"), "system/bin")
        self.push_or_die(
            os.path.join(get_gd_root(), "target", "android.system.suspend.control-V1-ndk.so"), "system/lib64")
        self.push_or_die(os.path.join(get_gd_root(), "target", "libbluetooth_gd.so"), "system/lib64")
        self.push_or_die(os.path.join(get_gd_root(), "target", "libgrpc++_unsecure.so"), "system/lib64")
        self.push_or_die(os.path.join(get_gd_root(), "target", "libgrpc++.so"), "system/lib64")
@@ -533,7 +530,8 @@ class GdAndroidDevice(GdDeviceBase):
        self.ensure_no_output(self.adb.shell("settings put global ble_scan_always_enabled 0"))
        self.adb.shell("cmd bluetooth_manager disable")
        device_bt_state = int(self.adb.shell("settings get global bluetooth_on"))
        asserts.assert_equal(device_bt_state, 0, "Failed to disable Bluetooth on device %s %s" % (self.label, self.serial_number))
        asserts.assert_equal(device_bt_state, 0,
                             "Failed to disable Bluetooth on device %s %s" % (self.label, self.serial_number))
        logging.info("Bluetooth disabled on device %s %s" % (self.label, self.serial_number))

        # Start logcat logging
+8 −4
Original line number Diff line number Diff line
@@ -61,9 +61,10 @@ class GdSl4aBaseTestClass(BaseTestClass):
        # Enable full btsnoop log
        self.dut.adb.root()
        self.dut.adb.shell("setprop persist.bluetooth.btsnooplogmode full")
        getprop_result = self.dut.adb.shell("getprop persist.bluetooth.btsnooplogmode") == "full"
        if not getprop_result:
            self.dut.log.warning("Failed to enable Bluetooth Hci Snoop Logging.")
        getprop_result = self.dut.adb.getprop("persist.bluetooth.btsnooplogmode")
        if getprop_result is None or ("full" not in getprop_result.lower()):
            self.dut.log.warning(
                "Failed to enable Bluetooth Hci Snoop Logging, getprop returned {}".format(getprop_result))

        self.ble = BleLib(dut=self.dut)

@@ -95,7 +96,10 @@ class GdSl4aBaseTestClass(BaseTestClass):
        # Make sure BLE is disabled and Bluetooth is disabled after test
        self.dut.sl4a.bluetoothDisableBLE()
        disable_bluetooth(self.dut.sl4a, self.dut.ed)
        try:
            self.cert.rootservice.StopStack(facade_rootservice.StopStackRequest())
        except Exception:
            logging.error("Failed to stop CERT stack")

        # TODO: split cert logcat logs into individual tests
        current_test_dir = get_current_context().get_full_output_path()
+4 −2
Original line number Diff line number Diff line
@@ -283,14 +283,16 @@ cc_binary {
            shared_libs: [
                "android.hardware.bluetooth@1.0",
                "android.hardware.bluetooth@1.1",
                "android.system.suspend.control-V1-ndk",
                "android.system.suspend-V1-ndk",
                "libbinder_ndk",
                "libhidlbase",
                "libutils",
                "libcutils",
                "libstatslog_bt",
            ],
            static_libs: [
                "android.system.suspend.control-V1-ndk",
                "android.system.suspend-V1-ndk",
            ],
        },
        host: {
            required: [
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ force_install = False
install_requires = [
    'grpcio',
    'psutil',
    'protobuf>=3.14.0',
    'protobuf>=3.14.0, <4.0',
    'mobly',
]