if method is 'GetClusterCapacity' and version == '1.0':
LOG.info('Called Fake GetClusterCapacity...')
data = {'result':
- {'clusterCapacity': {'maxProvisionedSpace': 99999999,
- 'usedSpace': 999,
+ {'clusterCapacity': {'maxProvisionedSpace': 107374182400,
+ 'usedSpace': 1073741824,
'compressionPercent': 100,
'deDuplicationPercent': 100,
'thinProvisioningPercent': 100}}}
self.assertTrue(sfv.retype(self.ctxt,
testvol,
test_type, diff, host))
+
+ def test_update_cluster_status(self):
+ self.stubs.Set(SolidFireDriver, '_issue_api_request',
+ self.fake_issue_api_request)
+ sfv = SolidFireDriver(configuration=self.configuration)
+ sfv._update_cluster_status()
+ self.assertEqual(sfv.cluster_stats['free_capacity_gb'], 99.0)
+ self.assertEqual(sfv.cluster_stats['total_capacity_gb'], 100.0)
data["driver_version"] = self.VERSION
data["storage_protocol"] = 'iSCSI'
- data['total_capacity_gb'] = results['maxProvisionedSpace']
+ data['total_capacity_gb'] =\
+ float(results['maxProvisionedSpace'] / units.GiB)
data['free_capacity_gb'] = float(free_capacity / units.GiB)
data['reserved_percentage'] = self.configuration.reserved_percentage