def setUp(self): super(NfsDriverTestCase, self).setUp() self.mox = mox_lib.Mox() self.stubs = stubout.StubOutForTesting() self.configuration = mox_lib.MockObject(conf.Configuration) self.configuration.append_config_values(mox_lib.IgnoreArg()) self.configuration.nfs_shares_config = None self.configuration.nfs_sparsed_volumes = True self.configuration.nfs_used_ratio = 0.95 self.configuration.nfs_oversub_ratio = 1.0 self.configuration.nfs_mount_point_base = self.TEST_MNT_POINT_BASE self.configuration.nfs_mount_options = None self.configuration.nfs_mount_attempts = 3 self.configuration.nfs_qcow2_volumes = False self.configuration.nas_secure_file_permissions = 'false' self.configuration.nas_secure_file_operations = 'false' self.configuration.nas_ip = None self.configuration.nas_share_path = None self.configuration.nas_mount_options = None self.configuration.reserved_percentage = 0 self.configuration.volume_dd_blocksize = '1M' self._driver = nfs.NfsDriver(configuration=self.configuration) self._driver.shares = {} self.addCleanup(self.stubs.UnsetAll) self.addCleanup(self.mox.UnsetStubs)
def setUp(self): super(RemoteFsDriverTestCase, self).setUp() self._driver = remotefs.RemoteFSDriver() self.configuration = mox_lib.MockObject(conf.Configuration) self.configuration.append_config_values(mox_lib.IgnoreArg()) self.configuration.nas_secure_file_permissions = 'false' self.configuration.nas_secure_file_operations = 'false' self._driver = remotefs.RemoteFSDriver( configuration=self.configuration)
def setUp(self): self.configuration = mox.MockObject(conf.Configuration) self.configuration.volume_group_name = 'fake-vg' super(BrickLvmTestCase, self).setUp() # Stub processutils.execute for static methods self.stubs.Set(processutils, 'execute', self.fake_execute) self.vg = brick.LVM(self.configuration.volume_group_name, 'sudo', False, None, 'default', self.fake_execute)
def setUp(self): super(RemoteFsDriverTestCase, self).setUp() self._driver = remotefs.RemoteFSDriver() self.configuration = mox_lib.MockObject(conf.Configuration) self.configuration.append_config_values(mox_lib.IgnoreArg()) self.configuration.nas_secure_file_permissions = 'false' self.configuration.nas_secure_file_operations = 'false' self.configuration.max_over_subscription_ratio = 1.0 self.configuration.reserved_percentage = 5 self._driver = remotefs.RemoteFSDriver( configuration=self.configuration)
def setUp(self): self.ctxt = context.get_admin_context() self.configuration = mox.MockObject(conf.Configuration) self.configuration.sf_allow_tenant_qos = True self.configuration.san_is_local = True self.configuration.sf_emulate_512 = True self.configuration.sf_account_prefix = 'cinder' self.configuration.reserved_percentage = 25 self.configuration.iscsi_helper = None self.configuration.sf_template_account_name = 'openstack-vtemplate' self.configuration.sf_allow_template_caching = False self.configuration.sf_svip = None self.configuration.sf_enable_volume_mapping = True super(SolidFireVolumeTestCase, self).setUp() self.stubs.Set(solidfire.SolidFireDriver, '_issue_api_request', self.fake_issue_api_request) self.stubs.Set(solidfire.SolidFireDriver, '_build_endpoint_info', self.fake_build_endpoint_info) self.expected_qos_results = { 'minIOPS': 1000, 'maxIOPS': 10000, 'burstIOPS': 20000 } self.mock_stats_data =\ {'result': {'clusterCapacity': {'maxProvisionedSpace': 107374182400, 'usedSpace': 1073741824, 'compressionPercent': 100, 'deDuplicationPercent': 100, 'thinProvisioningPercent': 100}}} self.mock_volume = { 'project_id': 'testprjid', 'name': 'testvol', 'size': 1, 'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66', 'volume_type_id': 'fast', 'created_at': timeutils.utcnow() } self.fake_image_meta = { 'id': '17c550bb-a411-44c0-9aaf-0d96dd47f501', 'updated_at': datetime.datetime(2013, 9, 28, 15, 27, 36, 325355), 'is_public': True, 'owner': 'testprjid' } self.fake_image_service = 'null'
def setUp(self): """Initialize IBM XIV and DS8K Driver.""" super(XIVDS8KVolumeDriverTest, self).setUp() configuration = mox.MockObject(conf.Configuration) configuration.san_is_local = False configuration.xiv_ds8k_proxy = \ 'cinder.tests.unit.test_ibm_xiv_ds8k.XIVDS8KFakeProxyDriver' configuration.xiv_ds8k_connection_type = 'iscsi' configuration.xiv_chap = 'disabled' configuration.san_ip = FAKE configuration.management_ips = FAKE configuration.san_login = FAKE configuration.san_clustername = FAKE configuration.san_password = FAKE configuration.append_config_values(mox.IgnoreArg()) self.driver = xiv_ds8k.XIVDS8KDriver(configuration=configuration)
def setUp(self): self.tempdir = tempfile.mkdtemp() self.addCleanup(shutil.rmtree, self.tempdir) self.TEST_MOUNT = self.tempdir self.TEST_VOLPATH = os.path.join(self.TEST_MOUNT, self.TEST_VOLDIR, self.TEST_VOLNAME) self.TEST_SNAPPATH = os.path.join(self.TEST_MOUNT, self.TEST_VOLDIR, self.TEST_SNAPNAME) self.TEST_CLONEPATH = os.path.join(self.TEST_MOUNT, self.TEST_VOLDIR, self.TEST_CLONENAME) self.configuration = mox_lib.MockObject(conf.Configuration) self._configure_driver() super(ScalityDriverTestCase, self).setUp() self._driver = scality.ScalityDriver(configuration=self.configuration) self._driver.set_execute(self._execute_wrapper) self._create_fake_mount() self._create_fake_config() self.addCleanup(self._remove_fake_config)
def stub_out_not_replaying(self, obj, attr_name): attr_to_replace = getattr(obj, attr_name) stub = mox_lib.MockObject(attr_to_replace) self.stubs.Set(obj, attr_name, stub)
def create_configuration(): configuration = mox.MockObject(conf.Configuration) configuration.append_config_values(mox.IgnoreArg()) return configuration
def setUp(self): super(LVMISCSITestCase, self).setUp() self.configuration = mox.MockObject(conf.Configuration) self.configuration.iscsi_target_prefix = 'iqn.2010-10.org.openstack:' self.configuration.iscsi_ip_address = '0.0.0.0' self.configuration.iscsi_port = 3260