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

Commit 72c2fb4c authored by Charlie Boutier's avatar Charlie Boutier
Browse files

pandora: change the identity_address_type accordingly to the test

* Skip test_auto_connection_dual_device when ref_address_type is public

Bug: 296927588
Test: atest avatar:"AshaTest"
Change-Id: I9b27372729f8cfb16dee44376229518c40eb464d
parent a68ee005
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -86,6 +86,21 @@ class AshaTest(base_test.BaseTestClass): # type: ignore[misc]

    @avatar.asynchronous
    async def setup_test(self) -> None:
        # TODO(b/296927588): Test should pass with a random identity address
        # We have to update the config before the reset otherwise it'll be overridden
        random_identity_address_type_list = [
            "test_auto_connection(1,1)",
            "test_advertising_advertisement_data(1,1)",
            "test_advertising_scan_response",
            "test_auto_connection_dual_device(1,1,0)",
            "test_auto_connection_dual_device(1,1,1)",
        ]
        if self.current_test_info.name in random_identity_address_type_list:
            self.ref_left._bumble.config.update({'server': {'identity_address_type': 'random'}})
            self.ref_right._bumble.config.update({'server': {'identity_address_type': 'random'}})
        else:
            self.ref_left._bumble.config.update({'server': {'identity_address_type': 'public'}})
            self.ref_right._bumble.config.update({'server': {'identity_address_type': 'public'}})
        await asyncio.gather(self.dut.reset(), self.ref_left.reset(), self.ref_right.reset())

        # ASHA hearing aid's IO capability is NO_OUTPUT_NO_INPUT
@@ -683,6 +698,9 @@ class AshaTest(base_test.BaseTestClass): # type: ignore[misc]
           2. The disconnected peripheral starts sending ASHA advertisements.
           3. Verify that DUT auto-connects to the peripheral.
        """
        # This tests need to be reactivated ASAP
        if ref_address_type == PUBLIC:
            raise signals.TestSkip('TODO: b/296927588')

        advertisement_left = await self.ref_advertise_asha(
            ref_device=self.ref_left, ref_address_type=ref_address_type, ear=Ear.LEFT
+3 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ import logging

from avatar import BumblePandoraDevice, PandoraDevice, PandoraDevices
from avatar.pandora_server import AndroidPandoraServer
from bumble.colors import color
from bumble.core import (
    BT_GENERIC_AUDIO_SERVICE,
    BT_HANDSFREE_AUDIO_GATEWAY_SERVICE,
@@ -61,6 +62,7 @@ HFP_VERSION_1_7 = 0x0107

# Stub for Audio Gateway implementation
# TODO: b/296471045
logger = logging.getLogger(__name__)
class HfpProtocol:
    dlc: rfcomm.DLC
    buffer: str
@@ -150,6 +152,7 @@ class HfpClientTest(base_test.BaseTestClass): # type: ignore[misc]

    @avatar.asynchronous
    async def setup_test(self) -> None:
        self.ref._bumble.config.update({'server': {'identity_address_type': 'public'}})
        await asyncio.gather(self.dut.reset(), self.ref.reset())

    # TODO(b/286338264): Moving connecting and bonding methods to a shared util scripts