LGTM
On Mon, Jul 14, 2014 at 3:29 PM, Dimitris Bliablias <[email protected]> wrote: > This patch, extends the 'ganeti.utils.storage_unittest.py' unit test > with a new test for the Gluster storage type. Also, the current unit > tests are updated accordingly to correspond to the latest changes. > > Signed-off-by: Dimitris Bliablias <[email protected]> > --- > test/py/ganeti.utils.storage_unittest.py | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > diff --git a/test/py/ganeti.utils.storage_unittest.py b/test/py/ > ganeti.utils.storage_unittest.py > index 64e6277..f71e1ca 100755 > --- a/test/py/ganeti.utils.storage_unittest.py > +++ b/test/py/ganeti.utils.storage_unittest.py > @@ -64,6 +64,13 @@ class > TestGetStorageUnitForDiskTemplate(unittest.TestCase): > self.assertEqual(storage_type, constants.ST_SHARED_FILE) > self.assertEqual(storage_key, self._cluster.shared_file_storage_dir) > > + def testGetDefaultStorageUnitForDiskTemplateGluster(self): > + (storage_type, storage_key) = \ > + storage._GetDefaultStorageUnitForDiskTemplate(self._cfg, > + > constants.DT_GLUSTER) > + self.assertEqual(storage_type, constants.ST_GLUSTER) > + self.assertEqual(storage_key, self._cluster.gluster_storage_dir) > + > def testGetDefaultStorageUnitForDiskTemplateDiskless(self): > (storage_type, storage_key) = \ > storage._GetDefaultStorageUnitForDiskTemplate(self._cfg, > @@ -80,9 +87,10 @@ class TestGetStorageUnits(unittest.TestCase): > self._cfg = mock.Mock() > > def testGetStorageUnits(self): > - disk_templates = constants.DTS_FILEBASED - frozenset( > - storage.GetDiskTemplatesOfStorageTypes(constants.ST_SHARED_FILE) > - ) > + sts_non_reporting = \ > + storage.GetDiskTemplatesOfStorageTypes(constants.ST_GLUSTER, > + constants.ST_SHARED_FILE) > + disk_templates = constants.DTS_FILEBASED - > frozenset(sts_non_reporting) > storage_units = storage.GetStorageUnits(self._cfg, disk_templates) > self.assertEqual(len(storage_units), len(disk_templates)) > > -- > 1.7.10.4 > >
