Пример #1
0
 def setUp(self):
     super(VolumeTypesManageApiTest, self).setUp()
     self.flags(host='fake')
     self.controller = types_manage.VolumeTypesManageController()
     """to reset notifier drivers left over from other api/contrib tests"""
     fake_notifier.reset()
     self.addCleanup(fake_notifier.reset)
Пример #2
0
 def setUp(self):
     super(VolumeTypesManageApiTest, self).setUp()
     self.flags(host='fake')
     self.controller = types_manage.VolumeTypesManageController()
     """to reset notifier drivers left over from other api/contrib tests"""
     fake_notifier.reset()
     self.addCleanup(fake_notifier.reset)
Пример #3
0
 def setUp(self):
     super(VolumeTypeEncryptionTest, self).setUp()
     self.flags(host='fake')
     self.api_path = '/v2/fake/os-volume-types/1/encryption'
     """to reset notifier drivers left over from other api/contrib tests"""
     fake_notifier.reset()
     self.addCleanup(fake_notifier.reset)
Пример #4
0
 def setUp(self):
     super(VolumeTypesExtraSpecsTest, self).setUp()
     self.flags(host='fake')
     self.stubs.Set(cinder.db, 'volume_type_get', volume_type_get)
     self.api_path = '/v2/fake/os-volume-types/1/extra_specs'
     self.controller = types_extra_specs.VolumeTypeExtraSpecsController()
     """to reset notifier drivers left over from other api/contrib tests"""
     fake_notifier.reset()
     self.addCleanup(fake_notifier.reset)
 def setUp(self):
     super(VolumeTypesExtraSpecsTest, self).setUp()
     self.flags(host='fake')
     self.stubs.Set(cinder.db, 'volume_type_get', volume_type_get)
     self.api_path = '/v2/fake/os-volume-types/1/extra_specs'
     self.controller = types_extra_specs.VolumeTypeExtraSpecsController()
     """to reset notifier drivers left over from other api/contrib tests"""
     fake_notifier.reset()
     self.addCleanup(fake_notifier.reset)
    def setUp(self):
        super(QoSSpecManageApiTest, self).setUp()
        self.flags(host='fake')
        self.controller = qos_specs_manage.QoSSpecsController()

        #reset notifier drivers left over from other api/contrib tests
        # NOTE(flaper87) WTF? ^^^^ Cleanups should happen in each test,
        # not the purpose of this patch, though.
        fake_notifier.reset()
        self.addCleanup(fake_notifier.reset)
    def setUp(self):
        super(QoSSpecManageApiTest, self).setUp()
        self.flags(host='fake')
        self.controller = qos_specs_manage.QoSSpecsController()

        #reset notifier drivers left over from other api/contrib tests
        # NOTE(flaper87) WTF? ^^^^ Cleanups should happen in each test,
        # not the purpose of this patch, though.
        fake_notifier.reset()
        self.addCleanup(fake_notifier.reset)
Пример #8
0
    def test_rename_existing_name(self):
        self.stubs.Set(volume_types, 'update',
                       return_volume_types_update_exist)
        self.stubs.Set(volume_types, 'get_volume_type',
                       return_volume_types_get_volume_type_updated)
        # first attempt fail
        body = {"volume_type": {"name": "vol_type_666"}}
        req = fakes.HTTPRequest.blank('/v2/fake/types/666')
        req.method = 'PUT'

        self.assertEqual(0, len(fake_notifier.NOTIFICATIONS))
        self.assertRaises(webob.exc.HTTPConflict,
                          self.controller._update, req, '666', body)
        self.assertEqual(1, len(fake_notifier.NOTIFICATIONS))

        # delete
        fake_notifier.reset()
        self.stubs.Set(volume_types, 'destroy',
                       return_volume_types_destroy)

        req = fakes.HTTPRequest.blank('/v2/fake/types/1')
        self.assertEqual(0, len(fake_notifier.NOTIFICATIONS))
        self.controller._delete(req, '1')
        self.assertEqual(1, len(fake_notifier.NOTIFICATIONS))

        # update again
        self.stubs.Set(volume_types, 'update',
                       return_volume_types_update)
        self.stubs.Set(volume_types, 'get_volume_type',
                       return_volume_types_get_volume_type_updated)
        body = {"volume_type": {"name": "vol_type_666_666"}}
        req = fakes.HTTPRequest.blank('/v2/fake/types/666')
        req.method = 'PUT'

        fake_notifier.reset()
        self.assertEqual(0, len(fake_notifier.NOTIFICATIONS))
        res_dict = self.controller._update(req, '666', body)
        self._check_test_results(res_dict,
                                 {'expected_name': 'vol_type_666',
                                  'expected_desc': 'vol_type_desc_666'})
        self.assertEqual(1, len(fake_notifier.NOTIFICATIONS))
Пример #9
0
    def test_rename_existing_name(self):
        self.stubs.Set(volume_types, 'update',
                       return_volume_types_update_exist)
        self.stubs.Set(volume_types, 'get_volume_type',
                       return_volume_types_get_volume_type_updated)
        # first attempt fail
        body = {"volume_type": {"name": "vol_type_666"}}
        req = fakes.HTTPRequest.blank('/v2/fake/types/666')
        req.method = 'PUT'

        self.assertEqual(0, len(fake_notifier.NOTIFICATIONS))
        self.assertRaises(webob.exc.HTTPConflict, self.controller._update, req,
                          '666', body)
        self.assertEqual(1, len(fake_notifier.NOTIFICATIONS))

        # delete
        fake_notifier.reset()
        self.stubs.Set(volume_types, 'destroy', return_volume_types_destroy)

        req = fakes.HTTPRequest.blank('/v2/fake/types/1')
        self.assertEqual(0, len(fake_notifier.NOTIFICATIONS))
        self.controller._delete(req, '1')
        self.assertEqual(1, len(fake_notifier.NOTIFICATIONS))

        # update again
        self.stubs.Set(volume_types, 'update', return_volume_types_update)
        self.stubs.Set(volume_types, 'get_volume_type',
                       return_volume_types_get_volume_type_updated)
        body = {"volume_type": {"name": "vol_type_666_666"}}
        req = fakes.HTTPRequest.blank('/v2/fake/types/666')
        req.method = 'PUT'

        fake_notifier.reset()
        self.assertEqual(0, len(fake_notifier.NOTIFICATIONS))
        res_dict = self.controller._update(req, '666', body)
        self._check_test_results(res_dict, {
            'expected_name': 'vol_type_666',
            'expected_desc': 'vol_type_desc_666'
        })
        self.assertEqual(1, len(fake_notifier.NOTIFICATIONS))
Пример #10
0
 def tearDown(self):
     super(UsageInfoTestCase, self).tearDown()
     fake_notifier.reset()
Пример #11
0
 def tearDown(self):
     super(UsageInfoTestCase, self).tearDown()
     fake_notifier.reset()
Пример #12
0
 def tearDown(self):
     super(VolumeApiTest, self).tearDown()
     fake_notifier.reset()
Пример #13
0
 def tearDown(self):
     super(VolumeApiTest, self).tearDown()
     fake_notifier.reset()