Exemple #1
0
 def test_remove_host_from_hostset_hostset_doesnt_exists(self, mock_client):
     """
     hpe3par flash cache - create a flash cache
     """
     mock_client.HPE3ParClient.hostSetExists.return_value = False
     result = hostset.remove_hosts(
         mock_client.HPE3ParClient, "user", "password", "hostname", ["member1"])
     self.assertEqual(result, (True, False, "Hostset does not exist", {}))
Exemple #2
0
 def test_remove_host_from_hostset_No_new_members_to_remove_from_the_Host_set_setmembers_none(self, mock_client):
     """
     hpe3par flash cache - create a flash cache
     """
     mock_client.HPE3ParClient.getHostSet.return_value.setmembers = None
     result = hostset.remove_hosts(
         mock_client.HPE3ParClient, "user", "password", "hostname", ["member1"])
     self.assertEqual(
         result, (True, True, 'Removed hosts successfully.', {}))
Exemple #3
0
 def test_remove_host_from_hostset_No_new_members_to_remove_from_the_Host_set(self, mock_client):
     """
     hpe3par flash cache - create a flash cache
     """
     mock_client.HPE3ParClient.getHostSet.return_value.setmembers = []
     result = hostset.remove_hosts(
         mock_client.HPE3ParClient, "user", "password", "hostname", ["member1"])
     self.assertEqual(
         result, (True, False, "No members to remove from the Host set hostname. Nothing to do.", {}))
Exemple #4
0
 def test_remove_host_from_hostset_hostset_create_exception_in_login(self, mock_client):
     """
     hpe3par hostset - create a hostset
     """
     mock_client.HPE3ParClient.login.side_effect = Exception(
         "Failed to login!")
     result = hostset.remove_hosts(
         mock_client.HPE3ParClient, "user", "password", "host", ["members"])
     self.assertEqual(
         result, (False, False, "Remove hosts from hostset failed | Failed to login!", {}))
Exemple #5
0
 def test_remove_host_from_hostset_hostset_create_sucess_login(self, mock_client):
     """
     hpe3par hostset - create a hostset
     """
     mock_client.hostSetExists.return_value = True
     mock_client.getHostSet.return_value.setmembers = ["members"]
     mock_client.return_value = mock_client
     result = hostset.remove_hosts(
         mock_client, "user", "pass", "host", ["members"])
     self.assertEqual(
         result, (True, True, 'Removed hosts successfully.', {}))
Exemple #6
0
    def test_remove_host_from_hostset_hostset_hostname_empty(self, mock_client):
        """
        hpe3par hostset - create a hostset
        """
        result = hostset.remove_hosts(mock_client, "user", "pass", None, None)

        self.assertEqual(result, (
            False,
            False,
            "Remove host from hostset failed. Hostset name is null",
            {}))
Exemple #7
0
    def test_remove_host_from_hostset_hostset_username_empty(self, mock_client):
        """
        hpe3par hostset - create a hostset
        """
        result = hostset.remove_hosts(mock_client, None, None, None, None)

        self.assertEqual(result, (
            False,
            False,
            "Remove host from hostset failed. Storage system username or password is null",
            {}))
Exemple #8
0
    def test_remove_host_from_hostset_hostset_setmembers_empty(self, mock_client):
        """
        hpe3par hostset - create a hostset
        """
        result = hostset.remove_hosts(
            mock_client, "user", "pass", "hostset", None)

        self.assertEqual(result, (
            False,
            False,
            "setmembers delete failed. Setmembers is null",
            {}))