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

Commit 74547a99 authored by William Escande's avatar William Escande Committed by Gerrit Code Review
Browse files

Merge "[PANDORA_TEST] pts-bot HFP Coverage: WBS"

parents 993812bf 6be19635
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -22,6 +22,14 @@ from pandora.host_grpc import Host
import sys
import threading

# 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',
}


class HFPProxy(ProfileProxy):

@@ -32,6 +40,24 @@ class HFPProxy(ProfileProxy):

        self.connection = None

    def asyncWaitConnection(self, pts_addr, delay=WAIT_DELAY_BEFORE_CONNECTION):
        """
        Send a WaitConnection in a grpc callback
        """

        def waitConnectionCallback(self, pts_addr):
            self.connection = self.host.WaitConnection(address=pts_addr).connection

        print(f'HFP placeholder mmi: asyncWaitConnection', file=sys.stderr)
        th = threading.Timer(interval=delay, function=waitConnectionCallback, args=(self, pts_addr))
        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"

    @assert_description
    def TSC_delete_pairing_iut(self, pts_addr: bytes, **kwargs):
        """
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
        <option name="profile" value="HFP/AG/DIS" />
        <option name="profile" value="HFP/AG/HFI" />
        <option name="profile" value="HFP/AG/SLC" />
        <option name="profile" value="HFP/AG/WBS" />
        <option name="profile" value="SDP/SR" />
        <option name="profile" value="SM/CEN/EKS" />
        <option name="profile" value="SM/CEN/JW" />
+2 −1
Original line number Diff line number Diff line
@@ -45,7 +45,8 @@
    "HFP/AG/HFI/BI-03-I",
    "HFP/AG/HFI/BV-02-I",
    "HFP/AG/SLC/BV-09-I",
    "HFP/AG/SLC/BV-10-I"
    "HFP/AG/SLC/BV-10-I",
    "HFP/AG/WBS/BV-01-I"
  ],
  "skip": [
    "A2DP/SRC/AS/BV-01-I",