def setUp(self): super(NetAppEseriesClientDriverTestCase, self).setUp() self.mock_log = mock.Mock() self.mock_object(client, 'LOG', self.mock_log) self.fake_password = '******' self.my_client = client.RestClient('http', 'host', '80', '/test', 'user', self.fake_password, system_id='fake_sys_id') self.my_client.invoke_service = mock.Mock()
def do_setup(self, context): """Any initialization the volume driver does while starting.""" self._check_flags() self._client = client.RestClient( scheme=self.configuration.netapp_transport_type, host=self.configuration.netapp_server_hostname, port=self.configuration.netapp_server_port, service_path=self.configuration.netapp_webservice_path, username=self.configuration.netapp_login, password=self.configuration.netapp_password) self._check_mode_get_or_register_storage_system()
def setUp(self): super(NetAppEseriesClientDriverTestCase, self).setUp() self.mock_log = mock.Mock() self.mock_object(client, 'LOG', self.mock_log) self.fake_password = '******' self.my_client = client.RestClient('http', 'host', '80', '/test', 'user', self.fake_password, system_id='fake_sys_id') self.my_client._endpoint = eseries_fake.FAKE_ENDPOINT_HTTP fake_response = mock.Mock() fake_response.status_code = 200 self.my_client.invoke_service = mock.Mock(return_value=fake_response) self.my_client.api_version = '01.52.9000.1'
def _create_rest_client(self, configuration): port = configuration.netapp_server_port scheme = configuration.netapp_transport_type.lower() if port is None: if scheme == 'http': port = 8080 elif scheme == 'https': port = 8443 return client.RestClient( scheme=scheme, host=configuration.netapp_server_hostname, port=port, service_path=configuration.netapp_webservice_path, username=configuration.netapp_login, password=configuration.netapp_password)
def setUp(self): super(NetAppEseriesClientDriverTestCase, self).setUp() self.mock_log = mock.Mock() self.mock_object(client, 'LOG', self.mock_log) self.fake_password = '******' # Inject fake netapp_lib module classes. eseries_fake.mock_netapp_lib([client]) self.my_client = client.RestClient('http', 'host', '80', '/test', 'user', self.fake_password, system_id='fake_sys_id') self.my_client.client._endpoint = eseries_fake.FAKE_ENDPOINT_HTTP self.mock_object(self.my_client, '_eval_response') fake_response = mock.Mock() fake_response.status_code = 200 self.my_client.invoke_service = mock.Mock(return_value=fake_response)
def do_setup(self, context): """Any initialization the volume driver does while starting.""" na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration) port = self.configuration.netapp_server_port scheme = self.configuration.netapp_transport_type.lower() if port is None: if scheme == 'http': port = 8080 elif scheme == 'https': port = 8443 self._client = client.RestClient( scheme=scheme, host=self.configuration.netapp_server_hostname, port=port, service_path=self.configuration.netapp_webservice_path, username=self.configuration.netapp_login, password=self.configuration.netapp_password) self._check_mode_get_or_register_storage_system()