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