コード例 #1
0
    def test_delete_unknown_fqdn(self):
        """Negative test to delete Passpoint profile using an unknown FQDN.

        1. Pass an unknown FQDN for removal.
        2. Verify that it was not successful.

        """
        if wutils.delete_passpoint(self.dut, self.unknown_fqdn):
            raise signals.TestFailure("Failed because an unknown FQDN"
                                      " was successfully deleted.")
コード例 #2
0
 def get_configured_passpoint_and_delete(self):
     """Get configured Passpoint network and delete using its FQDN."""
     passpoint_config = self.dut.droid.getPasspointConfigs()
     if not len(passpoint_config):
         raise signals.TestFailure("Failed to fetch the list of configured"
                                   "passpoint networks.")
     if not wutils.delete_passpoint(self.dut, passpoint_config[0]):
         raise signals.TestFailure(
             "Failed to delete Passpoint configuration"
             " with FQDN = %s" % passpoint_config[0])
コード例 #3
0
    def test_passpoint_failover(self):
        """Add a pair of passpoint networks and test failover when one of the"
           profiles is removed.

        1. Install a Passpoint Profile A and B.
        2. Verify device connects to a Passpoint network and get SSID.
        3. Delete the current Passpoint profile using its FQDN.
        4. Verify device fails over and connects to the other Passpoint SSID.
        5. Delete Passpoint configuration using its FQDN.

        """
        # Install both Passpoint profiles on the device.
        passpoint_ssid = list()
        for passpoint_config in self.passpoint_networks:
            passpoint_ssid.append(passpoint_config[WifiEnums.SSID_KEY])
            self.install_passpoint_profile(passpoint_config)
            time.sleep(DEFAULT_TIMEOUT)

        # Get the current network and the failover network.
        wutils.wait_for_connect(self.dut)
        current_passpoint = self.dut.droid.wifiGetConnectionInfo()
        current_ssid = current_passpoint[WifiEnums.SSID_KEY]
        if current_ssid not in passpoint_ssid:
            raise signals.TestFailure("Device did not connect to any of the "
                                      "configured Passpoint networks.")

        expected_ssid = self.passpoint_networks[0][WifiEnums.SSID_KEY]
        if current_ssid == expected_ssid:
            expected_ssid = self.passpoint_networks[1][WifiEnums.SSID_KEY]

        # Remove the current Passpoint profile.
        for network in self.passpoint_networks:
            if network[WifiEnums.SSID_KEY] == current_ssid:
                if not wutils.delete_passpoint(self.dut, network["fqdn"]):
                    raise signals.TestFailure("Failed to delete Passpoint"
                                              " configuration with FQDN = %s" %
                                              network["fqdn"])
        # Verify device fails over and connects to the other passpoint network.
        time.sleep(DEFAULT_TIMEOUT)

        current_passpoint = self.dut.droid.wifiGetConnectionInfo()
        if current_passpoint[WifiEnums.SSID_KEY] != expected_ssid:
            raise signals.TestFailure("Device did not failover to the %s"
                                      " passpoint network" % expected_ssid)

        # Delete the remaining Passpoint profile.
        self.get_configured_passpoint_and_delete()
        wutils.wait_for_disconnect(self.dut)
コード例 #4
0
    def test_add_delete_list_of_passpoint_network(self):
        """Add multiple passpoint networks, list them and delete one by one.

        1. Install Passpoint Profile A.
        2. Install Passpoint Profile B.
        3. Get all the Passpoint configurations added above and verify.
        6. Ensure all Passpoint configurations can be deleted.

        """
        for passpoint_config in self.passpoint_networks:
            self.install_passpoint_profile(passpoint_config)
            time.sleep(DEFAULT_TIMEOUT)
        configs = self.dut.droid.getPasspointConfigs()
        if not len(configs) or len(configs) != len(self.passpoint_networks):
            raise signals.TestFailure("Failed to fetch some or all of the"
                                      " configured passpoint networks.")
        for config in configs:
            if not wutils.delete_passpoint(self.dut, config):
                raise signals.TestFailure("Failed to delete Passpoint"
                                          " configuration with FQDN = %s" %
                                          config)