Beispiel #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))
Beispiel #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))
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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())
Beispiel #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))
Beispiel #8
0
 def test_getreaddelay(self):
     with namedTemporaryDir() as tmpdir:
         manifest = make_filesd_manifest(tmpdir)
         self.assertIsInstance(manifest.getReadDelay(), float)
Beispiel #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())
Beispiel #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())
Beispiel #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))
Beispiel #12
0
 def test_getreaddelay(self):
     with namedTemporaryDir() as tmpdir:
         manifest = make_filesd_manifest(tmpdir)
         self.assertIsInstance(manifest.getReadDelay(), float)