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

Commit 21ea12cf authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "SM: Add double pairing test"

parents 556fcd39 49b553ab
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -53,11 +53,12 @@ class PySecurity(Closable):
        self._device.security.CreateBond(
            common.BluetoothAddressWithType(address=common.BluetoothAddress(address=address), type=type))

    def remove_bond(self, address_with_type):
    def remove_bond(self, address, type):
        """
            Removes bond from stack under test
        """
        self._device.security.RemoveBond(address_with_type)
        self._device.security.RemoveBond(
            common.BluetoothAddressWithType(address=common.BluetoothAddress(address=address), type=type))

    def set_io_capabilities(self, io_capabilities):
        """
+37 −0
Original line number Diff line number Diff line
@@ -274,6 +274,43 @@ class SecurityTest(GdBaseTestClass):
            expected_init_bond_event=BondMsgType.DEVICE_BONDED,
            expected_resp_bond_event=None)

    # no_input_no_output + no_input_no_output is JustWorks no confirmation
    def test_dut_initiated_no_input_no_output_no_input_no_output_twice(self):
        # Arrange
        self.dut_security.set_io_capabilities(IoCapabilities.NO_INPUT_NO_OUTPUT)
        self.dut_security.set_authentication_requirements(AuthenticationRequirements.DEDICATED_BONDING_MITM_PROTECTION)
        self.dut_security.set_oob_data(OobDataPresent.NOT_PRESENT)
        self.cert_security.set_io_capabilities(IoCapabilities.NO_INPUT_NO_OUTPUT)
        self.cert_security.set_authentication_requirements(AuthenticationRequirements.DEDICATED_BONDING_MITM_PROTECTION)
        self.cert_security.set_oob_data(OobDataPresent.NOT_PRESENT)

        # Act and Assert
        self._run_ssp_numeric_comparison(
            initiator=self.dut_security,
            responder=self.cert_security,
            init_ui_response=True,
            resp_ui_response=True,
            expected_init_ui_event=None,
            expected_resp_ui_event=None,
            expected_init_bond_event=BondMsgType.DEVICE_BONDED,
            expected_resp_bond_event=None)

        self.dut_security.remove_bond(self.cert.address, common.BluetoothAddressTypeEnum.PUBLIC_DEVICE_ADDRESS)

        # Give time for ACL to disconnect
        time.sleep(1)

        # Act and Assert
        self._run_ssp_numeric_comparison(
            initiator=self.dut_security,
            responder=self.cert_security,
            init_ui_response=True,
            resp_ui_response=True,
            expected_init_ui_event=None,
            expected_resp_ui_event=None,
            expected_init_bond_event=BondMsgType.DEVICE_BONDED,
            expected_resp_bond_event=None)


## Other permutations
#def xtest_dut_initiated_display_only_display_only_local_user_deny(self)
+0 −4
Original line number Diff line number Diff line
@@ -55,8 +55,6 @@ void SecurityManagerChannel::Release(hci::Address address) {
    return;
  }
  entry->second->Release();
  entry->second.reset();
  link_map_.erase(entry);
}

void SecurityManagerChannel::Disconnect(hci::Address address) {
@@ -66,8 +64,6 @@ void SecurityManagerChannel::Disconnect(hci::Address address) {
    return;
  }
  entry->second->Disconnect();
  entry->second.reset();
  link_map_.erase(entry);
}

void SecurityManagerChannel::OnCommandComplete(hci::CommandCompleteView packet) {