示例#1
0
 def test_delete_volume(self):
     self.stubs.Set(SolidFire, '_issue_api_request',
                    self.fake_issue_api_request)
     testvol = {'project_id': 'testprjid',
                'name': 'test_volume',
                'size': 1,
                'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66'}
     sfv = SolidFire()
     model_update = sfv.delete_volume(testvol)
示例#2
0
 def test_create_volume(self):
     self.stubs.Set(SolidFire, '_issue_api_request',
                    self.fake_issue_api_request)
     testvol = {'project_id': 'testprjid',
                'name': 'testvol',
                'size': 1,
                'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66'}
     sfv = SolidFire()
     model_update = sfv.create_volume(testvol)
示例#3
0
 def test_delete_volume_fails_no_volume(self):
     self.stubs.Set(SolidFire, '_issue_api_request',
                    self.fake_issue_api_request)
     testvol = {'project_id': 'testprjid',
                'name': 'no-name',
                'size': 1,
                'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66'}
     sfv = SolidFire()
     try:
         model_update = sfv.delete_volume(testvol)
         self.fail("Should have thrown Error")
     except Exception:
         pass
示例#4
0
    def test_create_volume_with_qos(self):
        preset_qos = {}
        preset_qos['qos'] = 'fast'
        self.stubs.Set(SolidFire, '_issue_api_request',
                       self.fake_issue_api_request)

        testvol = {'project_id': 'testprjid',
                   'name': 'testvol',
                   'size': 1,
                   'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66',
                   'metadata': [preset_qos]}

        sfv = SolidFire()
        model_update = sfv.create_volume(testvol)
示例#5
0
    def test_create_volume_with_qos(self):
        preset_qos = {}
        preset_qos['qos'] = 'fast'
        self.stubs.Set(SolidFire, '_issue_api_request',
                       self.fake_issue_api_request)

        testvol = {'project_id': 'testprjid',
                   'name': 'testvol',
                   'size': 1,
                   'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66',
                   'metadata': [preset_qos]}

        sfv = SolidFire()
        model_update = sfv.create_volume(testvol)
示例#6
0
 def test_delete_volume_fails_no_volume(self):
     self.stubs.Set(SolidFire, '_issue_api_request',
                    self.fake_issue_api_request)
     testvol = {
         'project_id': 'testprjid',
         'name': 'no-name',
         'size': 1,
         'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66'
     }
     sfv = SolidFire()
     try:
         model_update = sfv.delete_volume(testvol)
         self.fail("Should have thrown Error")
     except Exception:
         pass
示例#7
0
 def test_delete_volume_fails_no_volume(self):
     self.stubs.Set(SolidFire, '_issue_api_request',
                    self.fake_issue_api_request_no_volume)
     testvol = {'project_id': 'testprjid',
                'name': 'no-name',
                'size': 1,
                'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66'}
     sfv = SolidFire()
     self.assertRaises(exception.VolumeNotFound,
                       sfv.delete_volume, testvol)
示例#8
0
 def test_create_volume_fails(self):
     self.stubs.Set(SolidFire, '_issue_api_request',
                    self.fake_issue_api_request_fails)
     testvol = {'project_id': 'testprjid',
                'name': 'testvol',
                'size': 1,
                'id': 'a720b3c0-d1f0-11e1-9b23-0800200c9a66'}
     sfv = SolidFire()
     self.assertRaises(exception.SolidFireAPIDataException,
                       sfv.create_volume, testvol)
示例#9
0
 def test_get_cluster_info_fail(self):
     self.stubs.Set(SolidFire, '_issue_api_request',
                    self.fake_issue_api_request_fails)
     sfv = SolidFire()
     self.assertRaises(exception.SolidFireAPIException,
                       sfv._get_cluster_info)
示例#10
0
 def test_get_cluster_info(self):
     self.stubs.Set(SolidFire, '_issue_api_request',
                    self.fake_issue_api_request)
     sfv = SolidFire()
     sfv._get_cluster_info()
示例#11
0
 def test_get_sfaccount_by_name_fails(self):
     sfv = SolidFire()
     self.stubs.Set(SolidFire, '_issue_api_request',
                    self.fake_issue_api_request_fails)
     account = sfv._get_sfaccount_by_name('some-name')
     self.assertEqual(account, None)
示例#12
0
 def test_create_sfaccount_fails(self):
     sfv = SolidFire()
     self.stubs.Set(SolidFire, '_issue_api_request',
                    self.fake_issue_api_request_fails)
     account = sfv._create_sfaccount('project-id')
     self.assertEqual(account, None)
示例#13
0
 def test_get_cluster_info(self):
     self.stubs.Set(SolidFire, '_issue_api_request',
                    self.fake_issue_api_request)
     sfv = SolidFire()
     sfv._get_cluster_info()
示例#14
0
 def test_get_sfaccount_by_name_fails(self):
     sfv = SolidFire()
     self.stubs.Set(SolidFire, '_issue_api_request',
                    self.fake_issue_api_request_fails)
     account = sfv._get_sfaccount_by_name('some-name')
     self.assertEqual(account, None)
示例#15
0
 def test_create_sfaccount_fails(self):
     sfv = SolidFire()
     self.stubs.Set(SolidFire, '_issue_api_request',
                    self.fake_issue_api_request_fails)
     account = sfv._create_sfaccount('project-id')
     self.assertEqual(account, None)