'Test exception when hgst_space_group doesn\'t map to UNIX group.'

@mock.patch('pwd.getpwnam', return_value=1)
@mock.patch('grp.getgrnam', return_value=1)
@mock.patch('socket.gethostbyname', return_value='123.123.123.123')
def test_parameter_group_invalid(self, mock_ghn, mock_grnam, mock_pwnam):

    self.driver.check_for_setup_error()
    mock_grnam.side_effect = KeyError()
    self.configuration.hgst_space_group = ''
    self.assertRaises(exception.VolumeDriverException, self.driver.check_for_setup_error)
    self.configuration.hgst_space_group = 'Fred!`'
    self.assertRaises(exception.VolumeDriverException, self.driver.check_for_setup_error)
