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

Commit c427241d authored by bidsharma's avatar bidsharma Committed by Thomas Girardier
Browse files

[PANDORA_TEST] Implement SMP test on pts-bot

Tag: #feature
Bug: 239437774
Test: atest pts-bot:SM/CEN/KDU -v
Ignore-AOSP-First: Cherry-picked from AOSP
Change-Id: I60f06949170d3e8956d9a40f6d71aaf501b01cbb
Merged-In: I60f06949170d3e8956d9a40f6d71aaf501b01cbb
parent 6986f60e
Loading
Loading
Loading
Loading
+31 −3
Original line number Diff line number Diff line
@@ -24,6 +24,17 @@ NEEDS_PAIRING_CONFIRMATION = {
    "SM/CEN/EKS/BV-01-C",
    "SM/CEN/JW/BI-04-C",
    "SM/CEN/JW/BI-01-C",
    "SM/CEN/KDU/BV-04-C",
    "SM/CEN/KDU/BV-05-C",
    "SM/CEN/KDU/BV-06-C",
    "SM/CEN/KDU/BV-10-C",
    "SM/CEN/KDU/BV-11-C",
}

ACCEPTS_REMOTE_PAIRING_CONFIRMATION = {
    "SM/CEN/KDU/BI-01-C",
    "SM/CEN/KDU/BI-02-C",
    "SM/CEN/KDU/BI-03-C",
}


@@ -36,11 +47,13 @@ class SMProxy(ProfileProxy):
        self.connection = None

    @assert_description
    def MMI_IUT_ENABLE_CONNECTION_SM(self, pts_addr: bytes, **kwargs):
    def MMI_IUT_ENABLE_CONNECTION_SM(self, test, pts_addr: bytes, **kwargs):
        """
        Initiate an connection from the IUT to the PTS.
        """
        self.connection = self.host.ConnectLE(address=pts_addr).connection
        if self.connection and test in ACCEPTS_REMOTE_PAIRING_CONFIRMATION:
            self.sm.ProvidePairingConfirmation(connection=self.connection, pairing_confirmation_value=True)
        return "OK"

    @assert_description
@@ -68,3 +81,18 @@ class SMProxy(ProfileProxy):
            self.host.DisconnectLE(connection=self.connection)
            self.connection = None
        return "OK"

    def MMI_LESC_NUMERIC_COMPARISON(self, **kwargs):
        """
        Please confirm the following number matches IUT: 385874.
        """

        return "OK"

    @assert_description
    def MMI_ASK_IUT_PERFORM_RESET(self, **kwargs):
        """
        Please reset your device.
        """
        self.host.Reset()
        return "OK"
+2 −0
Original line number Diff line number Diff line
@@ -31,5 +31,7 @@
        <option name="profile" value="SDP/SR" />
        <option name="profile" value="SM/CEN/EKS" />
        <option name="profile" value="SM/CEN/JW" />
        <option name="profile" value="SM/CEN/KDU" />

    </test>
</configuration>
+9 −1
Original line number Diff line number Diff line
@@ -93,7 +93,15 @@
    "SM/CEN/EKS/BV-01-C",
    "SM/CEN/JW/BI-01-C",
    "SM/CEN/JW/BI-04-C",
    "SM/CEN/JW/BV-05-C"
    "SM/CEN/JW/BV-05-C",
    "SM/CEN/KDU/BI-01-C",
    "SM/CEN/KDU/BV-04-C",
    "SM/CEN/KDU/BV-05-C",
    "SM/CEN/KDU/BI-02-C",
    "SM/CEN/KDU/BV-06-C",
    "SM/CEN/KDU/BV-10-C",
    "SM/CEN/KDU/BI-03-C",
    "SM/CEN/KDU/BV-11-C"
  ],
  "skip": [
    "A2DP/SRC/AS/BV-01-I",
+0 −1
Original line number Diff line number Diff line
@@ -122,7 +122,6 @@ class GattInstance(val mDevice: BluetoothDevice, val mTransport: Int, val mConte
    require(isConnected()) {
      "Trying to disconnect an already disconnected device $mDevice"
    }
    mGatt.close()
    mGatt.disconnect()
    gattInstances.remove(mDevice.address)
  }