Exemple #1
0
 def test_getmetaparam(self):
     with namedTemporaryDir() as tmpdir:
         metadata = {sd.DMDK_VERSION: 3}
         manifest = make_filesd_manifest(tmpdir, metadata)
         metadata[sd.DMDK_SDUUID] = manifest.sdUUID
         self.assertEquals(manifest.sdUUID,
                           manifest.getMetaParam(sd.DMDK_SDUUID))
Exemple #2
0
 def test_getmetaparam(self):
     with namedTemporaryDir() as tmpdir:
         metadata = {sd.DMDK_VERSION: 3}
         manifest = make_filesd_manifest(tmpdir, metadata)
         metadata[sd.DMDK_SDUUID] = manifest.sdUUID
         self.assertEquals(manifest.sdUUID,
                           manifest.getMetaParam(sd.DMDK_SDUUID))
Exemple #3
0
 def test_getallimages(self):
     with namedTemporaryDir() as tmpdir:
         manifest = make_filesd_manifest(tmpdir)
         self.assertEqual(set(), manifest.getAllImages())
         img_uuid = str(uuid.uuid4())
         make_file_volume(manifest.domaindir, VOLSIZE, img_uuid)
         self.assertIn(img_uuid, manifest.getAllImages())
Exemple #4
0
 def test_getallimages(self):
     with namedTemporaryDir() as tmpdir:
         manifest = make_filesd_manifest(tmpdir)
         self.assertEqual(set(), manifest.getAllImages())
         img_uuid = str(uuid.uuid4())
         make_file_volume(manifest.domaindir, VOLSIZE, img_uuid)
         self.assertIn(img_uuid, manifest.getAllImages())
Exemple #5
0
 def test_getmdpath(self):
     with namedTemporaryDir() as tmpdir:
         manifest = make_filesd_manifest(tmpdir)
         mdpath = os.path.join(manifest.domaindir, sd.DOMAIN_META_DATA)
         self.assertEquals(mdpath, manifest.getMDPath())
Exemple #6
0
 def test_getisodomainimagesdir(self):
     with namedTemporaryDir() as tmpdir:
         manifest = make_filesd_manifest(tmpdir)
         isopath = os.path.join(manifest.domaindir, sd.DOMAIN_IMAGES,
                                sd.ISO_IMAGE_UUID)
         self.assertEquals(isopath, manifest.getIsoDomainImagesDir())
Exemple #7
0
 def test_getvallocsize(self):
     with namedTemporaryDir() as tmpdir:
         manifest = make_filesd_manifest(tmpdir)
         imguuid, voluuid = make_file_volume(manifest.domaindir, VOLSIZE)
         self.assertEqual(0, manifest.getVAllocSize(imguuid, voluuid))
Exemple #8
0
 def test_getreaddelay(self):
     with namedTemporaryDir() as tmpdir:
         manifest = make_filesd_manifest(tmpdir)
         self.assertIsInstance(manifest.getReadDelay(), float)
Exemple #9
0
 def test_getmdpath(self):
     with namedTemporaryDir() as tmpdir:
         manifest = make_filesd_manifest(tmpdir)
         mdpath = os.path.join(manifest.domaindir, sd.DOMAIN_META_DATA)
         self.assertEquals(mdpath, manifest.getMDPath())
Exemple #10
0
 def test_getisodomainimagesdir(self):
     with namedTemporaryDir() as tmpdir:
         manifest = make_filesd_manifest(tmpdir)
         isopath = os.path.join(manifest.domaindir, sd.DOMAIN_IMAGES,
                                sd.ISO_IMAGE_UUID)
         self.assertEquals(isopath, manifest.getIsoDomainImagesDir())
Exemple #11
0
 def test_getvallocsize(self):
     with namedTemporaryDir() as tmpdir:
         manifest = make_filesd_manifest(tmpdir)
         imguuid, voluuid = make_file_volume(manifest.domaindir, VOLSIZE)
         self.assertEqual(0, manifest.getVAllocSize(imguuid, voluuid))
Exemple #12
0
 def test_getreaddelay(self):
     with namedTemporaryDir() as tmpdir:
         manifest = make_filesd_manifest(tmpdir)
         self.assertIsInstance(manifest.getReadDelay(), float)