Beispiel #1
0
 def get_vnx_enabler_status(self):
     return common.VNXEnablerStatus(
         dedup=self.is_dedup_enabled(),
         compression=self.is_compression_enabled(),
         thin=self.is_thin_enabled(),
         fast=self.is_fast_enabled(),
         snap=self.is_snap_enabled())
 def test_validate_extra_spec_dedup_invalid(self):
     spec_obj = common.ExtraSpecs({
         'provisioning:type': 'deduplicated',
     })
     enabler_status = common.VNXEnablerStatus(dedup=False)
     self.assertRaises(exception.InvalidVolumeType, spec_obj.validate,
                       enabler_status)
 def test_validate_extra_spec_no_thin_invalid(self):
     spec_obj = common.ExtraSpecs({
         'provisioning:type': 'compressed',
     })
     enabler_status = common.VNXEnablerStatus(compression=True, thin=False)
     self.assertRaises(exception.InvalidVolumeType, spec_obj.validate,
                       enabler_status)
 def test_validate_extra_spec_is_valid(self):
     spec_obj = common.ExtraSpecs({
         'storagetype:pool': 'fake_pool',
         'provisioning:type': 'thin',
         'storagetype:tiering': 'auto',
     })
     enabler_status = common.VNXEnablerStatus(dedup=True,
                                              fast=True,
                                              thin=True)
     re = spec_obj.validate(enabler_status)
     self.assertTrue(re)
 def test_validate_extra_spec_dedup_and_tier_failed(self):
     spec_obj = common.ExtraSpecs({
         'storagetype:pool': 'fake_pool',
         'provisioning:type': 'deduplicated',
         'storagetype:tiering': 'auto',
     })
     enabler_status = common.VNXEnablerStatus(dedup=True,
                                              fast=True,
                                              thin=True)
     self.assertRaises(exception.InvalidVolumeType, spec_obj.validate,
                       enabler_status)
 def test_validate_extra_spec_tier_invalid(self):
     spec_obj = common.ExtraSpecs({
         'storagetype:tiering': 'auto',
     })
     enabler_status = common.VNXEnablerStatus(dedup=True,
                                              fast=False,
                                              compression=True,
                                              snap=True,
                                              thin=True)
     self.assertRaises(exception.InvalidVolumeType, spec_obj.validate,
                       enabler_status)