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

Commit e40cd876 authored by Abel Lucas's avatar Abel Lucas Committed by Gerrit Code Review
Browse files

Merge changes from topic "update_host_proto"

* changes:
  avatar: update mobly config files
  avatar: update dependencies to bumble ones
  PandoraServer: Update host interfaces
  PandoraServer: Fix waitAclIntent
parents 38903a1b 2c8d0da9
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -162,9 +162,7 @@ class A2DPProxy(ProfileProxy):
        Action: This
        can be also be done by placing the IUT or PTS in an RF shielded box.
         """

        if self.connection is None:
            self.connection = self.host.GetConnection(address=pts_addr).connection
        assert self.connection
        self.host.Disconnect(connection=self.connection)
        self.connection = None
        self.sink = None
+1 −6
Original line number Diff line number Diff line
@@ -61,8 +61,6 @@ class AVRCPProxy(ProfileProxy):
        the IUT connects to PTS to establish pairing.

        """
        # Simulate CSR timeout: b/259102046
        time.sleep(4)
        self.connection = self.host.WaitConnection(address=pts_addr).connection
        if ("TG" in test and "TG/VLH" not in test) or "CT/VLH" in test:
            try:
@@ -151,8 +149,7 @@ class AVRCPProxy(ProfileProxy):
        Take action to disconnect all A2DP and/or AVRCP connections.

        """
        if self.connection is None:
            self.connection = self.host.GetConnection(address=pts_addr).connection
        assert self.connection is not None
        self.host.Disconnect(connection=self.connection)

        return "OK"
@@ -913,8 +910,6 @@ class AVRCPProxy(ProfileProxy):
        """
        # Currently disconnect is required in TG role
        if "TG" in test:
            if self.connection is None:
                self.connection = self.host.GetConnection(address=pts_addr).connection
            time.sleep(3)
            self.host.Disconnect(connection=self.connection)
            self.connection = None
+24 −29
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ class GAPProxy(ProfileProxy):
        Please send a connectable undirected advertising report.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            connectable=True,
            own_address_type=OwnAddressType.PUBLIC,
        )
@@ -152,7 +152,7 @@ class GAPProxy(ProfileProxy):
            scans = self.host.Scan()
            for scan in scans:
                adv_address = scan.public if scan.HasField("public") else scan.random
                device_name = self.host.GetRemoteName(address=adv_address).name
                device_name = scan.data.complete_local_name
                if "pts" in device_name.lower():
                    address = adv_address
                    scans.cancel()
@@ -205,7 +205,7 @@ class GAPProxy(ProfileProxy):
        Please prepare IUT to send an advertising report with Service UUID.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            own_address_type=OwnAddressType.PUBLIC,
            data=DataTypes(complete_service_class_uuids128=["955798ce-3022-455c-b759-ee8edcd73d1a"],))
        return "OK"
@@ -216,7 +216,7 @@ class GAPProxy(ProfileProxy):
        Please prepare IUT to send an advertising report with Local Name.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            own_address_type=OwnAddressType.PUBLIC,
            data=DataTypes(include_complete_local_name=True, include_shortened_local_name=True,))

@@ -228,7 +228,7 @@ class GAPProxy(ProfileProxy):
        Please prepare IUT to send an advertising report with Flags.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            connectable=True,
            own_address_type=OwnAddressType.PUBLIC,
        )
@@ -244,7 +244,7 @@ class GAPProxy(ProfileProxy):
        Specific Data.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            own_address_type=OwnAddressType.PUBLIC,
            data=DataTypes(manufacturer_specific_data=b"d0n't b3 3v1l!",))

@@ -256,7 +256,7 @@ class GAPProxy(ProfileProxy):
        Please prepare IUT to send an advertising report with TX Power Level.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            own_address_type=OwnAddressType.PUBLIC,
            data=DataTypes(include_tx_power_level=True,))

@@ -268,7 +268,7 @@ class GAPProxy(ProfileProxy):
        Please send a connectable advertising report.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            own_address_type=OwnAddressType.PUBLIC,
            connectable=True,
        )
@@ -283,7 +283,7 @@ class GAPProxy(ProfileProxy):
        Please send connectable undirected advertising report.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            own_address_type=OwnAddressType.PUBLIC,
            connectable=True,
        )
@@ -334,8 +334,7 @@ class GAPProxy(ProfileProxy):
        Please confirm that IUT has discovered PTS and retrieved its name (?P<name>[a-zA-Z\-0-9]*)
        """

        connection = self.host.GetConnection(address=pts_addr).connection
        device = self.host.GetDevice(connection=connection)
        device = self.host.GetDevice(connection=self.connection)
        assert name == device.name, (name, device.name)

        return "OK"
@@ -355,7 +354,7 @@ class GAPProxy(ProfileProxy):
        advertising report. Press OK to continue.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            data=DataTypes(le_discoverability_mode=DiscoverabilityMode.DISCOVERABLE_GENERAL),
            own_address_type=OwnAddressType.PUBLIC,
            connectable=True,
@@ -373,7 +372,7 @@ class GAPProxy(ProfileProxy):
        discoverable undirected advertising.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            data=DataTypes(le_discoverability_mode=DiscoverabilityMode.DISCOVERABLE_GENERAL),
            own_address_type=OwnAddressType.PUBLIC,
            connectable=True,
@@ -390,7 +389,7 @@ class GAPProxy(ProfileProxy):
        report using connectable undirected advertising.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            data=DataTypes(le_discoverability_mode=DiscoverabilityMode.NOT_DISCOVERABLE),
            own_address_type=OwnAddressType.PUBLIC,
            connectable=True,
@@ -404,7 +403,7 @@ class GAPProxy(ProfileProxy):
        advertising report using connectable undirected advertising.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            data=DataTypes(le_discoverability_mode=DiscoverabilityMode.DISCOVERABLE_GENERAL),
            own_address_type=OwnAddressType.PUBLIC,
            connectable=True,
@@ -523,7 +522,7 @@ class GAPProxy(ProfileProxy):
        send an advertising report.
        """

        self.host.StartAdvertising(own_address_type=OwnAddressType.PUBLIC,)
        self.advertise = self.host.Advertise(own_address_type=OwnAddressType.PUBLIC,)

        return "OK"

@@ -542,7 +541,7 @@ class GAPProxy(ProfileProxy):
        """

        try:
            self.host.Disconnect(connection=self.host.GetLEConnection(address=pts_addr).connection)
            self.host.Disconnect(connection=self.connection)
        except Exception:
            pass

@@ -563,8 +562,7 @@ class GAPProxy(ProfileProxy):
        if test not in {"GAP/SEC/AUT/BV-21-C"}:
            self.security_storage.DeleteBond(public=pts_addr)

        connection = self.host.GetLEConnection(address=pts_addr).connection
        self.security.Secure(connection=connection, le=LESecurityLevel.LE_LEVEL3)
        self.security.Secure(connection=self.connection, le=LESecurityLevel.LE_LEVEL3)

        return "OK"

@@ -630,7 +628,7 @@ class GAPProxy(ProfileProxy):
        self.host.SetDiscoverabilityMode(
            mode=DiscoverabilityMode.DISCOVERABLE_GENERAL)

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            data=DataTypes(le_discoverability_mode=DiscoverabilityMode.DISCOVERABLE_GENERAL),
            own_address_type=OwnAddressType.PUBLIC,
            connectable=True,
@@ -707,8 +705,7 @@ class GAPProxy(ProfileProxy):
        """

        # No idea how we can bond in non-bondable mode, but this passes the tests...
        connection = self.host.GetLEConnection(address=pts_addr).connection
        self.security.Secure(connection=connection, le=LESecurityLevel.LE_LEVEL3)
        self.security.Secure(connection=self.connection, le=LESecurityLevel.LE_LEVEL3)

        return "OK"

@@ -769,7 +766,7 @@ class GAPProxy(ProfileProxy):
        flags turned on.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            data=DataTypes(le_discoverability_mode=DiscoverabilityMode.DISCOVERABLE_GENERAL),
            own_address_type=OwnAddressType.PUBLIC,
            connectable=False,
@@ -784,7 +781,7 @@ class GAPProxy(ProfileProxy):
        an advertising report.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            data=DataTypes(le_discoverability_mode=DiscoverabilityMode.NOT_DISCOVERABLE),
            own_address_type=OwnAddressType.PUBLIC,
            connectable=True,
@@ -799,7 +796,7 @@ class GAPProxy(ProfileProxy):
        advertising report using connectable undirected advertising.
        """

        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            data=DataTypes(le_discoverability_mode=DiscoverabilityMode.DISCOVERABLE_GENERAL),
            own_address_type=OwnAddressType.PUBLIC,
            connectable=True,
@@ -891,14 +888,12 @@ class GAPProxy(ProfileProxy):
        if test != "GAP/SEC/SEM/BV-08-C":
            # we already started in the Connect MMI
            self.pairing_events = self.security.OnPairing()
            self.security.Secure(connection=connection, le=LESecurityLevel.LE_LEVEL3)

        connection = self.host.GetConnection(address=pts_addr).connection
            self.security.Secure(connection=self.connection, le=LESecurityLevel.LE_LEVEL3)

        def after_that():
            self.host.WaitConnection()  # this really waits for bonding
            sleep(1)
            self.host.Disconnect(connection=connection)
            self.host.Disconnect(connection=self.connection)

        Thread(target=after_that).start()

+1 −1
Original line number Diff line number Diff line
@@ -947,7 +947,7 @@ class GATTProxy(ProfileProxy):
        the Implementation Under Test (IUT) can accept GATT connect request from
        PTS.
        """
        self.host.StartAdvertising(
        self.advertise = self.host.Advertise(
            connectable=True,
            own_address_type=OwnAddressType.PUBLIC,
        )
+5 −30
Original line number Diff line number Diff line
@@ -29,9 +29,6 @@ import time
# Standard time to wait before asking for waitConnection
WAIT_DELAY_BEFORE_CONNECTION = 2

# The tests needs the MMI to accept pairing confirmation request.
NEEDS_WAIT_CONNECTION_BEFORE_TEST = {"HFP/AG/WBS/BV-01-I", "HFP/AG/SLC/BV-05-I"}

IXIT_PHONE_NUMBER = 42
IXIT_SECOND_PHONE_NUMBER = 43

@@ -46,7 +43,6 @@ class HFPProxy(ProfileProxy):
        self.security_storage = SecurityStorage(channel)
        self.rootcanal = rootcanal
        self.modem = modem

        self.connection = None

        self._auto_confirm_requests()
@@ -64,7 +60,6 @@ class HFPProxy(ProfileProxy):
        th.start()

    def test_started(self, test: str, pts_addr: bytes, **kwargs):
        if test in NEEDS_WAIT_CONNECTION_BEFORE_TEST:
        self.asyncWaitConnection(pts_addr)

        return "OK"
@@ -146,8 +141,6 @@ class HFPProxy(ProfileProxy):
        Implementation Under Test (IUT).
        """

        self.connection = self.host.GetConnection(address=pts_addr).connection

        def disable_slc():
            time.sleep(2)
            if "HFP/HF" in test:
@@ -238,8 +231,6 @@ class HFPProxy(ProfileProxy):
        level connection (SLC) or power-off the IUT.
        """

        self.connection = self.host.GetConnection(address=pts_addr).connection

        def disable_audio():
            time.sleep(2)
            if "HFP/HF" in test:
@@ -266,8 +257,6 @@ class HFPProxy(ProfileProxy):
        Implementation Under Test (IUT) to the PTS.
        """

        self.connection = self.host.GetConnection(address=pts_addr).connection

        def enable_audio():
            time.sleep(2)
            if "HFP/HF" in test:
@@ -287,8 +276,6 @@ class HFPProxy(ProfileProxy):
        close the service level connection. Do not power-off the IUT.
        """

        self.connection = self.host.GetConnection(address=pts_addr).connection

        def disable_slc():
            time.sleep(2)
            self.hfp.DisableSlc(connection=self.connection)
@@ -409,8 +396,6 @@ class HFPProxy(ProfileProxy):
        registered.
        """

        self.connection = self.host.GetConnection(address=pts_addr).connection

        def disable_slc():
            time.sleep(2)
            self.hfp.DisableSlc(connection=self.connection)
@@ -604,7 +589,7 @@ class HFPProxy(ProfileProxy):
        if "HFP/HF" not in test:
            self.hfp.SetVoiceRecognition(
                enabled=True,
                connection=self.host.GetConnection(address=pts_addr).connection,
                connection=self.connection,
            )

        return "OK"
@@ -636,8 +621,6 @@ class HFPProxy(ProfileProxy):
        Test (IUT).
        """

        self.connection = self.host.GetConnection(address=pts_addr).connection

        def reject_call():
            time.sleep(2)
            if "HFP/HF" in test:
@@ -656,8 +639,6 @@ class HFPProxy(ProfileProxy):
        Test (IUT).
        """

        self.connection = self.host.GetConnection(address=pts_addr).connection

        def answer_call():
            time.sleep(2)
            self.hfp.AnswerCallAsHandsfree(connection=self.connection)
@@ -704,8 +685,6 @@ class HFPProxy(ProfileProxy):
        (IUT).
        """

        self.connection = self.host.GetConnection(address=pts_addr).connection

        def disable_call():
            time.sleep(2)
            self.hfp.EndCallAsHandsfree(connection=self.connection)
@@ -748,8 +727,6 @@ class HFPProxy(ProfileProxy):
        (IUT) using an enterted phone number.
        """

        self.connection = self.host.GetConnection(address=pts_addr).connection

        def disable_call():
            time.sleep(2)
            self.hfp.MakeCallAsHandsfree(connection=self.connection, number="42")
@@ -780,8 +757,6 @@ class HFPProxy(ProfileProxy):
        the active call on hold.
        """

        self.connection = self.host.GetConnection(address=pts_addr).connection

        def call_swap_then_disable_held_alternative():
            time.sleep(2)
            self.hfp.CallTransferAsHandsfree(connection=self.connection)
@@ -818,7 +793,7 @@ class HFPProxy(ProfileProxy):

        self.hfp.SetVoiceRecognitionAsHandsfree(
            enabled=True,
            connection=self.host.GetConnection(address=pts_addr).connection,
            connection=self.connection,
        )

        return "OK"
@@ -831,7 +806,7 @@ class HFPProxy(ProfileProxy):

        self.hfp.SetVoiceRecognitionAsHandsfree(
            enabled=False,
            connection=self.host.GetConnection(address=pts_addr).connection,
            connection=self.connection,
        )

        return "OK"
@@ -843,7 +818,7 @@ class HFPProxy(ProfileProxy):
        """

        self.hfp.SendDtmfFromHandsfree(
            connection=self.host.GetConnection(address=pts_addr).connection,
            connection=self.connection,
            code=dtmf[0].encode("ascii")[0],
        )

Loading