]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Merge "Set LVM driver default overprovisioning ratio to 1.0"
authorJenkins <jenkins@review.openstack.org>
Sat, 23 Jan 2016 05:57:28 +0000 (05:57 +0000)
committerGerrit Code Review <review@openstack.org>
Sat, 23 Jan 2016 05:57:29 +0000 (05:57 +0000)
1  2 
cinder/tests/unit/test_volume.py

index 86ba29321bbfb5ee8de33c974f5ee012a1fd5e2f,35058060938cff761cd1ac3ac5a483ca21bf03db..d3a5a230cad38b8d8fdefdca7208c044f48983f2
@@@ -7365,8 -7374,28 +7366,28 @@@ class LVMVolumeDriverTestCase(DriverTes
          volume = tests_utils.create_volume(self.context, status='available',
                                             size=1, host=CONF.host)
          ret = self.volume.driver.unmanage(volume)
 -        self.assertEqual(ret, None)
 +        self.assertIsNone(ret)
  
+     # Global setting, LVM setting, expected outcome
+     @ddt.data((10.0, 2.0, 2.0))
+     @ddt.data((10.0, None, 10.0))
+     @ddt.unpack
+     def test_lvm_max_over_subscription_ratio(self,
+                                              global_value,
+                                              lvm_value,
+                                              expected_value):
+         configuration = conf.Configuration(fake_opt, 'fake_group')
+         configuration.max_over_subscription_ratio = global_value
+         configuration.lvm_max_over_subscription_ratio = lvm_value
+         fake_vg = mock.Mock(fake_lvm.FakeBrickLVM('cinder-volumes', False,
+                                                   None, 'default'))
+         lvm_driver = lvm.LVMVolumeDriver(configuration=configuration,
+                                          vg_obj=fake_vg, db=db)
+         self.assertEqual(expected_value,
+                          lvm_driver.configuration.max_over_subscription_ratio)
  
  class ISCSITestCase(DriverTestCase):
      """Test Case for ISCSIDriver"""