test: remove invalid test method in libvirt/test_imagebackend
Config option preallocate_images only accept two values 'none' and 'space', other value will lead a ValueError. So don't test invalid values. Change-Id: I1e215438850dbe0c98ecebfde0cbe03b17ad3d3a Related-Bug: #1517839
This commit is contained in:
parent
defdbc1ec5
commit
4d537365fb
|
@ -1674,17 +1674,9 @@ class BackendTestCase(test.NoDBTestCase):
|
|||
self._test_image('raw', imagebackend.Flat, imagebackend.Flat)
|
||||
|
||||
def test_image_flat_preallocate_images(self):
|
||||
flags = ('space', 'Space', 'SPACE')
|
||||
for f in flags:
|
||||
self.flags(preallocate_images=f)
|
||||
raw = imagebackend.Flat(self.INSTANCE, 'fake_disk',
|
||||
'/tmp/xyz')
|
||||
self.assertTrue(raw.preallocate)
|
||||
|
||||
def test_image_flat_preallocate_images_bad_conf(self):
|
||||
self.flags(preallocate_images='space1')
|
||||
self.flags(preallocate_images='space')
|
||||
raw = imagebackend.Flat(self.INSTANCE, 'fake_disk', '/tmp/xyz')
|
||||
self.assertFalse(raw.preallocate)
|
||||
self.assertTrue(raw.preallocate)
|
||||
|
||||
def test_image_flat_native_io(self):
|
||||
self.flags(preallocate_images="space")
|
||||
|
@ -1695,16 +1687,9 @@ class BackendTestCase(test.NoDBTestCase):
|
|||
self._test_image('qcow2', imagebackend.Qcow2, imagebackend.Qcow2)
|
||||
|
||||
def test_image_qcow2_preallocate_images(self):
|
||||
flags = ('space', 'Space', 'SPACE')
|
||||
for f in flags:
|
||||
self.flags(preallocate_images=f)
|
||||
qcow = imagebackend.Qcow2(self.INSTANCE, 'fake_disk', '/tmp/xyz')
|
||||
self.assertTrue(qcow.preallocate)
|
||||
|
||||
def test_image_qcow2_preallocate_images_bad_conf(self):
|
||||
self.flags(preallocate_images='space1')
|
||||
self.flags(preallocate_images='space')
|
||||
qcow = imagebackend.Qcow2(self.INSTANCE, 'fake_disk', '/tmp/xyz')
|
||||
self.assertFalse(qcow.preallocate)
|
||||
self.assertTrue(qcow.preallocate)
|
||||
|
||||
def test_image_qcow2_native_io(self):
|
||||
self.flags(preallocate_images="space")
|
||||
|
|
Loading…
Reference in New Issue