def test___init___iscsi_no_rest_address(self): proto = 'iscsi' cfg = copy.copy(self.cfg) cfg.nexenta_rest_addresses = '' cfg.nexenta_host = '4.4.4.4' result = jsonrpc.NefProxy(proto, cfg.nexenta_folder, cfg) self.assertIsInstance(result, jsonrpc.NefProxy)
def test___init___no_rest_port_https(self): proto = 'nfs' cfg = copy.copy(self.cfg) cfg.nexenta_rest_port = 0 cfg.nexenta_use_https = True result = jsonrpc.NefProxy(proto, cfg.nexenta_folder, cfg) self.assertIsInstance(result, jsonrpc.NefProxy)
def test___init___no_ssl_cert_verify(self, disable_warnings): proto = 'nfs' cfg = copy.copy(self.cfg) cfg.nexenta_ssl_cert_verify = False disable_warnings.return_value = None result = jsonrpc.NefProxy(proto, cfg.nexenta_folder, cfg) disable_warnings.assert_called() self.assertIsInstance(result, jsonrpc.NefProxy)
def setUp(self): super(TestNefProxy, self).setUp() self.cfg = mock.Mock(spec=conf.Configuration) self.cfg.nexenta_use_https = True self.cfg.nexenta_ssl_cert_verify = True self.cfg.nexenta_user = '******' self.cfg.nexenta_password = '******' self.cfg.nexenta_rest_addresses = ['1.1.1.1', '2.2.2.2'] self.cfg.nexenta_rest_port = 8443 self.cfg.nexenta_rest_backoff_factor = 1 self.cfg.nexenta_rest_retry_count = 3 self.cfg.nexenta_rest_connect_timeout = 1 self.cfg.nexenta_rest_read_timeout = 1 self.cfg.nexenta_nas_host = '3.3.3.3' self.cfg.nexenta_folder = 'pool/path/to/share' self.nef_mock = mock.Mock() self.mock_object(jsonrpc, 'NefRequest') self.proto = 'nfs' self.proxy = jsonrpc.NefProxy(self.proto, self.cfg.nexenta_folder, self.cfg)
def do_setup(self, context): self.nef = jsonrpc.NefProxy(self.storage_protocol, self.root_path, self.configuration)
def test___init___nfs_no_rest_address(self): proto = 'nfs' cfg = copy.copy(self.cfg) cfg.nexenta_rest_addresses = '' result = jsonrpc.NefProxy(proto, cfg.nexenta_folder, cfg) self.assertIsInstance(result, jsonrpc.NefProxy)
def test___init___iscsi(self): proto = 'iscsi' cfg = copy.copy(self.cfg) result = jsonrpc.NefProxy(proto, cfg.nexenta_folder, cfg) self.assertIsInstance(result, jsonrpc.NefProxy)