Exemplo n.º 1
0
 def setUp(self):
     super(ManagedRBDTestCase, self).setUp()
     # TODO(dosaboy): need to remove dependency on mox stubs here once
     # image.fake has been converted to mock.
     fake_image.stub_out_image_service(self.stubs)
     self.volume.driver.set_initialized()
     self.volume.stats = {'allocated_capacity_gb': 0, 'pools': {}}
     self.called = []
Exemplo n.º 2
0
 def setUp(self):
     super(ManagedRBDTestCase, self).setUp()
     # TODO(dosaboy): need to remove dependency on mox stubs here once
     # image.fake has been converted to mock.
     fake_image.stub_out_image_service(self.stubs)
     self.volume.driver.set_initialized()
     self.volume.stats = {'allocated_capacity_gb': 0}
     self.called = []
Exemplo n.º 3
0
 def setUp(self):
     super(VolumeTestCase, self).setUp()
     vol_tmpdir = tempfile.mkdtemp()
     self.flags(connection_type="fake", volumes_dir=vol_tmpdir, notification_driver=[test_notifier.__name__])
     self.volume = importutils.import_object(FLAGS.volume_manager)
     self.context = context.get_admin_context()
     self.stubs.Set(iscsi.TgtAdm, "_get_target", self.fake_get_target)
     fake_image.stub_out_image_service(self.stubs)
     test_notifier.NOTIFICATIONS = []
Exemplo n.º 4
0
 def setUp(self):
     super(VolumeTestCase, self).setUp()
     vol_tmpdir = tempfile.mkdtemp()
     self.flags(connection_type="fake", volumes_dir=vol_tmpdir)
     self.volume = importutils.import_object(FLAGS.volume_manager)
     self.context = context.get_admin_context()
     self.stubs.Set(cinder.flags.FLAGS, "notification_driver", "cinder.openstack.common.notifier.test_notifier")
     fake_image.stub_out_image_service(self.stubs)
     test_notifier.NOTIFICATIONS = []
Exemplo n.º 5
0
 def setUp(self):
     super(VolumeTestCase, self).setUp()
     vol_tmpdir = tempfile.mkdtemp()
     self.flags(connection_type='fake',
                volumes_dir=vol_tmpdir,
                notification_driver=[test_notifier.__name__])
     self.volume = importutils.import_object(FLAGS.volume_manager)
     self.context = context.get_admin_context()
     self.stubs.Set(iscsi.TgtAdm, '_get_target', self.fake_get_target)
     fake_image.stub_out_image_service(self.stubs)
     test_notifier.NOTIFICATIONS = []
Exemplo n.º 6
0
    def setUp(self):
        super(VolumeApiTest, self).setUp()
        self.ext_mgr = extensions.ExtensionManager()
        self.ext_mgr.extensions = {}
        fake_image.stub_out_image_service(self.stubs)
        self.controller = volumes.VolumeController(self.ext_mgr)

        self.stubs.Set(db, 'volume_get_all', stubs.stub_volume_get_all)
        self.stubs.Set(db, 'service_get_all_by_topic',
                       stubs.stub_service_get_all_by_topic)
        self.stubs.Set(volume_api.API, 'delete', stubs.stub_volume_delete)
Exemplo n.º 7
0
    def setUp(self):
        super(VolumeApiTest, self).setUp()
        self.ext_mgr = extensions.ExtensionManager()
        self.ext_mgr.extensions = {}
        fake_image.stub_out_image_service(self.stubs)
        self.controller = volumes.VolumeController(self.ext_mgr)

        self.stubs.Set(db, "volume_get_all", fakes.stub_volume_get_all)
        self.stubs.Set(db, "volume_get_all_by_project", fakes.stub_volume_get_all_by_project)
        self.stubs.Set(volume_api.API, "get", fakes.stub_volume_get)
        self.stubs.Set(volume_api.API, "delete", fakes.stub_volume_delete)
Exemplo n.º 8
0
    def setUp(self):
        super(VolumeApiTest, self).setUp()
        self.ext_mgr = extensions.ExtensionManager()
        self.ext_mgr.extensions = {}
        fake_image.stub_out_image_service(self.stubs)
        self.controller = volumes.VolumeController(self.ext_mgr)

        self.stubs.Set(db, 'volume_get_all', stubs.stub_volume_get_all)
        self.stubs.Set(db, 'volume_get_all_by_project',
                       stubs.stub_volume_get_all_by_project)
        self.stubs.Set(volume_api.API, 'get', stubs.stub_volume_get)
        self.stubs.Set(volume_api.API, 'delete', stubs.stub_volume_delete)
Exemplo n.º 9
0
    def setUp(self):
        super(VolumeApiTest, self).setUp()
        self.addCleanup(fake_notifier.reset)
        self.ext_mgr = extensions.ExtensionManager()
        self.ext_mgr.extensions = {}
        fake_image.stub_out_image_service(self.stubs)
        self.controller = volumes.VolumeController(self.ext_mgr)

        self.flags(host='fake', notification_driver=[fake_notifier.__name__])
        self.stubs.Set(db, 'volume_get_all', stubs.stub_volume_get_all)
        self.stubs.Set(db, 'service_get_all_by_topic',
                       stubs.stub_service_get_all_by_topic)
        self.stubs.Set(volume_api.API, 'delete', stubs.stub_volume_delete)
Exemplo n.º 10
0
    def setUp(self):
        super(VolumeApiTest, self).setUp()
        self.addCleanup(fake_notifier.reset)
        self.ext_mgr = extensions.ExtensionManager()
        self.ext_mgr.extensions = {}
        fake_image.stub_out_image_service(self.stubs)
        self.controller = volumes.VolumeController(self.ext_mgr)

        self.flags(host='fake',
                   notification_driver=[fake_notifier.__name__])
        self.stubs.Set(db, 'volume_get_all', stubs.stub_volume_get_all)
        self.stubs.Set(db, 'service_get_all_by_topic',
                       stubs.stub_service_get_all_by_topic)
        self.stubs.Set(volume_api.API, 'delete', stubs.stub_volume_delete)
Exemplo n.º 11
0
 def setUp(self):
     super(ManagedRBDTestCase, self).setUp()
     fake_image.stub_out_image_service(self.stubs)
Exemplo n.º 12
0
 def setUp(self):
     super(ManagedRBDTestCase, self).setUp()
     fake_image.stub_out_image_service(self.stubs)
Exemplo n.º 13
0
 def setUp(self):
     super(ManagedRBDTestCase, self).setUp()
     fake_image.stub_out_image_service(self.stubs)
     self.volume.driver.set_initialized()
Exemplo n.º 14
0
 def setUp(self):
     super(ManagedRBDTestCase, self).setUp()
     fake_image.stub_out_image_service(self.stubs)
     self.volume.driver.set_initialized()
     self.volume.stats = {"allocated_capacity_gb": 0}
     self.called = []
Exemplo n.º 15
0
 def setUp(self):
     super(ManagedRBDTestCase, self).setUp()
     fake_image.stub_out_image_service(self.stubs)
     self.volume.driver.set_initialized()