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