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

Commit dcf40761 authored by William Escande's avatar William Escande
Browse files

Setup verbose log for test

Flag: Exempt, test related only
Bug: 331261134
Fix: 331261134
Test: atest everything in bluetooth
Change-Id: I20edbbec35a26b23eaa30c454bb2456fc3d2d6cc
parent ce6bc160
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -32,10 +32,7 @@
        <option name="throw-if-cmd-fail" value="true" />
        <option name="run-command" value="setprop persist.bluetooth.btsnooplogmode full" />
        <option name="run-command" value="device_config set_sync_disabled_for_tests persistent" />
        <option name="run-command"
                value="device_config put bluetooth INIT_logging_debug_enabled_for_all true" />
        <option name="run-command"
                value="device_config put bluetooth INIT_default_log_level_str LOG_VERBOSE" />
        <option name="run-command" value="setprop log.tag.bluetooth VERBOSE" />
        <option name="run-command" value="settings put global ble_scan_always_enabled 0" />
        <option name="run-command" value="cmd bluetooth_manager disable" />
        <option name="run-command" value="cmd bluetooth_manager wait-for-state:STATE_OFF" />
+3 −3
Original line number Diff line number Diff line
@@ -74,8 +74,8 @@ class GdSl4aBaseTestClass(BaseTestClass):

    def setup_test(self):
        self.cert.rootservice.StartStack(
            facade_rootservice.StartStackRequest(
                module_under_test=facade_rootservice.BluetoothModule.Value(self.cert_module),))
            facade_rootservice.StartStackRequest(module_under_test=facade_rootservice.BluetoothModule.Value(
                self.cert_module),))
        self.cert.wait_channel_ready()

        self.timer_list = []
@@ -87,7 +87,7 @@ class GdSl4aBaseTestClass(BaseTestClass):
        self.dut.sl4a.bluetoothDisableBLE()
        disable_bluetooth(self.dut.sl4a, self.dut.ed)
        # Enable full verbose logging for Bluetooth
        self.dut.adb.shell("device_config put bluetooth INIT_logging_debug_enabled_for_all true")
        self.dut.adb.shell("setprop log.tag.bluetooth VERBOSE")
        # Then enable Bluetooth
        enable_bluetooth(self.dut.sl4a, self.dut.ed)
        self.dut.sl4a.bluetoothDisableBLE()
+5 −5
Original line number Diff line number Diff line
@@ -78,14 +78,14 @@ class Sl4aSl4aBaseTestClass(BaseTestClass):
        self.dut.adb.shell("setprop persist.bluetooth.btsnooplogmode full")
        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 on DUT, mode is {}"
                                 .format(getprop_result))
            self.dut.log.warning(
                "Failed to enable Bluetooth HCI Snoop Logging on DUT, mode is {}".format(getprop_result))
        self.cert.adb.root()
        self.cert.adb.shell("setprop persist.bluetooth.btsnooplogmode full")
        getprop_result = self.cert.adb.getprop("persist.bluetooth.btsnooplogmode")
        if getprop_result is None or ("full" not in getprop_result.lower()):
            self.cert.log.warning("Failed to enable Bluetooth HCI Snoop Logging on CERT, mode is {}"
                                  .format(getprop_result))
            self.cert.log.warning(
                "Failed to enable Bluetooth HCI Snoop Logging on CERT, mode is {}".format(getprop_result))

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

@@ -103,7 +103,7 @@ class Sl4aSl4aBaseTestClass(BaseTestClass):
        device.sl4a.bluetoothDisableBLE()
        disable_bluetooth(device.sl4a, device.ed)
        # Enable full verbose logging for Bluetooth
        device.adb.shell("device_config put bluetooth INIT_logging_debug_enabled_for_all true")
        device.adb.shell("setprop log.tag.bluetooth VERBOSE")
        # Then enable Bluetooth
        enable_bluetooth(device.sl4a, device.ed)
        device.sl4a.bluetoothDisableBLE()
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ class IrkRotationTest(sl4a_sl4a_base_test.Sl4aSl4aBaseTestClass):
        self.cert.sl4a.bluetoothDisableBLE()
        disable_bluetooth(self.cert.sl4a, self.cert.ed)
        self.cert.adb.shell("setprop bluetooth.core.gap.le.privacy.enabled false")
        self.cert.adb.shell("device_config put bluetooth INIT_logging_debug_enabled_for_all true")
        self.cert.adb.shell("setprop log.tag.bluetooth VERBOSE")
        enable_bluetooth(self.cert.sl4a, self.cert.ed)
        self.cert.sl4a.bluetoothDisableBLE()
        self._test_le_reconnect_after_irk_rotation(False)
+0 −6
Original line number Diff line number Diff line
@@ -38,11 +38,6 @@ using bluetooth::le_audio::LeAudioHealthDeviceStatType;
using bluetooth::le_audio::LeAudioHealthGroupStatType;
using bluetooth::le_audio::LeAudioHealthStatus;

static const char* test_flags[] = {
    "INIT_logging_debug_enabled_for_all=true",
    nullptr,
};

LeAudioHealthBasedAction recommendation_in_callback =
    LeAudioHealthBasedAction::NONE;
RawAddress address_in_callback = RawAddress::kEmpty;
@@ -60,7 +55,6 @@ class LeAudioHealthStatusTest : public ::testing::Test {
  void SetUp() override {
    reset_mock_function_count_map();
    group_ = new LeAudioDeviceGroup(group_id_);
    bluetooth::common::InitFlags::Load(test_flags);
    le_audio_health_status_instance_ = LeAudioHealthStatus::Get();
    le_audio_health_status_instance_->RegisterCallback(
        base::BindRepeating(healthCallback));
Loading