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

Commit bfb5fe08 authored by Charlie Boutier's avatar Charlie Boutier Committed by Gerrit Code Review
Browse files

Merge "[PTS-Bot]: Added 24 MAP test cases"

parents a973d0bf 630f304f
Loading
Loading
Loading
Loading
+16 −8
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@ from mmi2grpc.hfp import HFPProxy
from mmi2grpc.hid import HIDProxy
from mmi2grpc.hid import HIDProxy
from mmi2grpc.hogp import HOGPProxy
from mmi2grpc.hogp import HOGPProxy
from mmi2grpc.l2cap import L2CAPProxy
from mmi2grpc.l2cap import L2CAPProxy
from mmi2grpc.map import MAPProxy
from mmi2grpc.rfcomm import RFCOMMProxy
from mmi2grpc.rfcomm import RFCOMMProxy
from mmi2grpc.sdp import SDPProxy
from mmi2grpc.sdp import SDPProxy
from mmi2grpc.sm import SMProxy
from mmi2grpc.sm import SMProxy
@@ -77,6 +78,7 @@ class IUT:
        self._hid = None
        self._hid = None
        self._hogp = None
        self._hogp = None
        self._l2cap = None
        self._l2cap = None
        self._map = None
        self._rfcomm = None
        self._rfcomm = None
        self._sdp = None
        self._sdp = None
        self._sm = None
        self._sm = None
@@ -108,6 +110,7 @@ class IUT:
        self._l2cap = None
        self._l2cap = None
        self._hid = None
        self._hid = None
        self._hogp = None
        self._hogp = None
        self._map = None
        self._rfcomm = None
        self._rfcomm = None
        self._sdp = None
        self._sdp = None
        self._sm = None
        self._sm = None
@@ -221,6 +224,11 @@ class IUT:
            if not self._l2cap:
            if not self._l2cap:
                self._l2cap = L2CAPProxy(grpc.insecure_channel(f"localhost:{self.pandora_server_port}"))
                self._l2cap = L2CAPProxy(grpc.insecure_channel(f"localhost:{self.pandora_server_port}"))
            return self._l2cap.interact(test, interaction, description, pts_address)
            return self._l2cap.interact(test, interaction, description, pts_address)
        # Handles MAP MMIs.
        if profile in ("MAP"):
            if not self._map:
                self._map = MAPProxy(grpc.insecure_channel(f"localhost:{self.pandora_server_port}"))
            return self._map.interact(test, interaction, description, pts_address)
        # Handles RFCOMM MMIs.
        # Handles RFCOMM MMIs.
        if profile in ("RFCOMM"):
        if profile in ("RFCOMM"):
            if not self._rfcomm:
            if not self._rfcomm:
+173 −0
Original line number Original line Diff line number Diff line
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""MAP proxy module."""

from typing import Optional

from mmi2grpc._helpers import assert_description
from mmi2grpc._proxy import ProfileProxy

from pandora_experimental.host_grpc import Host
from pandora_experimental.host_pb2 import Connection
from pandora_experimental._android_grpc import Android
from pandora_experimental._android_pb2 import AccessType


class MAPProxy(ProfileProxy):
    """MAP proxy.

    Implements MAP PTS MMIs.
    """

    connection: Optional[Connection] = None

    def __init__(self, channel):
        super().__init__(channel)

        self.host = Host(channel)
        self._android = Android(channel)

        self.connection = None

    @assert_description
    def TSC_MMI_iut_connectable(self, **kwargs):
        """
        Click OK when the IUT becomes connectable.
        """

        return "OK"

    @assert_description
    def TSC_OBEX_MMI_iut_accept_slc_connect_l2cap(self, pts_addr: bytes, **kwargs):
        """
        Please accept the l2cap channel connection for an OBEX connection.
        """

        self._android.SetAccessPermission(address=pts_addr, access_type=AccessType.ACCESS_MESSAGE)
        self.connection = self.host.WaitConnection(address=pts_addr).connection

        return "OK"

    @assert_description
    def TSC_OBEX_MMI_iut_accept_connect(self, pts_addr: bytes, **kwargs):
        """
        Please accept the OBEX CONNECT REQ.
        """

        return "OK"

    @assert_description
    def TSC_OBEX_MMI_iut_initiate_slc_connect(self, **kwargs):
        """
        Take action to create an l2cap channel or rfcomm channel for an OBEX
        connection.

        Note:
        Service Name: MAP-MNS
        """

        return "OK"

    @assert_description
    def TSC_OBEX_MMI_iut_initiate_connect_MAP(self, **kwargs):
        """
        Take action to initiate an OBEX CONNECT REQ for MAP.
        """

        return "OK"

    @assert_description
    def TSC_OBEX_MMI_iut_initiate_disconnect(self, **kwargs):
        """
        Take action to initiate an OBEX DISCONNECT REQ.
        """

        return "OK"

    @assert_description
    def TSC_OBEX_MMI_iut_accept_disconnect(self, **kwargs):
        """
        Please accept the OBEX DISCONNECT REQ command.
        """

        return "OK"

    @assert_description
    def TSC_OBEX_MMI_iut_accept_set_path(self, **kwargs):
        """
         Please accept the SET_PATH command.
        """

        return "OK"

    @assert_description
    def TSC_OBEX_MMI_iut_accept_get_srm(self, **kwargs):
        """
         Please accept the GET REQUEST with an SRM ENABLED header.
        """

        return "OK"

    @assert_description
    def TSC_OBEX_MMI_iut_accept_browse_folders(self, **kwargs):
        """
         Please accept the browse folders (GET) command.
        """

        return "OK"

    @assert_description
    def TSC_MMI_iut_send_set_event_message_MessageRemoved_request(self, **kwargs):
        """
        Send Set Event Report with MessageRemoved Message.
        """
        return "OK"

    @assert_description
    def TSC_MMI_iut_verify_message_have_send(self, **kwargs):
        """
        Verify that the message has been successfully delivered via the network,
        then click OK.  Otherwise click Cancel.
        """

        return "OK"

    @assert_description
    def TSC_OBEX_MMI_iut_reject_action(self, **kwargs):
        """
        Take action to reject the ACTION command sent by PTS.
        """
        return "OK"

    @assert_description
    def TSC_MMI_iut_send_set_event_message_gsm_request(self, **kwargs):
        """
        Send Set Event Report with New GSM Message.
        """
        return "OK"

    @assert_description
    def TSC_MMI_iut_send_set_event_1_2_request(self, **kwargs):
        """
        Send 1.2 Event Report .
        """
        return "OK"

    @assert_description
    def TSC_OBEX_MMI_iut_reject_session(self, **kwargs):
        """
        Take action to reject the SESSION command sent by PTS.
        """

        return "OK"
+1 −0
Original line number Original line Diff line number Diff line
@@ -41,6 +41,7 @@
        <option name="profile" value="HID/HOS" />
        <option name="profile" value="HID/HOS" />
        <option name="profile" value="HOGP" />
        <option name="profile" value="HOGP" />
        <option name="profile" value="L2CAP/LE" />
        <option name="profile" value="L2CAP/LE" />
        <option name="profile" value="MAP" />
        <option name="profile" value="RFCOMM" />
        <option name="profile" value="RFCOMM" />
        <option name="profile" value="SDP" />
        <option name="profile" value="SDP" />
        <option name="profile" value="SM" />
        <option name="profile" value="SM" />
+1 −0
Original line number Original line Diff line number Diff line
@@ -41,6 +41,7 @@
        <option name="profile" value="HID/HOS" />
        <option name="profile" value="HID/HOS" />
        <option name="profile" value="HOGP" />
        <option name="profile" value="HOGP" />
        <option name="profile" value="L2CAP/LE" />
        <option name="profile" value="L2CAP/LE" />
        <option name="profile" value="MAP" />
        <option name="profile" value="SDP" />
        <option name="profile" value="SDP" />
        <option name="profile" value="SM" />
        <option name="profile" value="SM" />
    </test>
    </test>
+37 −0
Original line number Original line Diff line number Diff line
@@ -322,6 +322,30 @@
    "L2CAP/LE/CPU/BI-02-C",
    "L2CAP/LE/CPU/BI-02-C",
    "L2CAP/LE/CPU/BV-02-C",
    "L2CAP/LE/CPU/BV-02-C",
    "L2CAP/LE/REJ/BI-01-C",
    "L2CAP/LE/REJ/BI-01-C",
    "MAP/MSE/GOEP/CON/BV-01-C",
    "MAP/MSE/GOEP/CON/BV-02-C",
    "MAP/MSE/GOEP/ROB/BV-01-C",
    "MAP/MSE/GOEP/ROB/BV-02-C",
    "MAP/MSE/GOEP/SRM/BI-02-C",
    "MAP/MSE/GOEP/SRM/BI-03-C",
    "MAP/MSE/GOEP/SRM/BI-05-C",
    "MAP/MSE/GOEP/SRM/BV-04-C",
    "MAP/MSE/GOEP/SRM/BV-08-C",
    "MAP/MSE/MMB/BV-09-I",
    "MAP/MSE/MMB/BV-10-I",
    "MAP/MSE/MMB/BV-11-I",
    "MAP/MSE/MMB/BV-16-I",
    "MAP/MSE/MMB/BV-20-I",
    "MAP/MSE/MMB/BV-36-I",
    "MAP/MSE/MMI/BV-02-I",
    "MAP/MSE/MMN/BV-06-I",
    "MAP/MSE/MMU/BV-03-I",
    "MAP/MSE/MNR/BV-03-I",
    "MAP/MSE/MNR/BV-04-I",
    "MAP/MSE/MSM/BV-05-I",
    "MAP/MSE/MSM/BV-06-I",
    "MAP/MSE/MSM/BV-07-I",
    "MAP/MSE/MSM/BV-08-I",
    "RFCOMM/DEVA/RFC/BV-01-C",
    "RFCOMM/DEVA/RFC/BV-01-C",
    "RFCOMM/DEVB/RFC/BV-02-C",
    "RFCOMM/DEVB/RFC/BV-02-C",
    "RFCOMM/DEVA-DEVB/RFC/BV-03-C",
    "RFCOMM/DEVA-DEVB/RFC/BV-03-C",
@@ -643,6 +667,19 @@
    "L2CAP/LE/CID/BV-02-C",
    "L2CAP/LE/CID/BV-02-C",
    "L2CAP/LE/CPU/BV-01-C",
    "L2CAP/LE/CPU/BV-01-C",
    "L2CAP/LE/REJ/BI-02-C",
    "L2CAP/LE/REJ/BI-02-C",
    "MAP/MSE/GOEP/BC/BV-01-I",
    "MAP/MSE/GOEP/BC/BV-03-I",
    "MAP/MSE/GOEP/SRMP/BI-02-C",
    "MAP/MSE/GOEP/SRMP/BV-02-C",
    "MAP/MSE/MMB/BV-13-I",
    "MAP/MSE/MMB/BV-14-I",
    "MAP/MSE/MMB/BV-15-I",
    "MAP/MSE/MMD/BV-02-I",
    "MAP/MSE/MMN/BV-02-I",
    "MAP/MSE/MMN/BV-04-I",
    "MAP/MSE/MMN/BV-07-I",
    "MAP/MSE/MMN/BV-14-I",
    "MAP/MSE/MMU/BV-02-I",
    "RFCOMM/DEVA-DEVB/RFC/BV-21-C",
    "RFCOMM/DEVA-DEVB/RFC/BV-21-C",
    "RFCOMM/DEVA-DEVB/RFC/BV-22-C",
    "RFCOMM/DEVA-DEVB/RFC/BV-22-C",
    "SM/CEN/PKE/BV-01-C",
    "SM/CEN/PKE/BV-01-C",
Loading