def testDynamic(self): fd, outFn = tempfile.mkstemp() os.close(fd) try: vhd.makeDynamic(self.fn, outFn) self.validateVHD(outFn) finally: os.unlink(outFn)
def createVHD(self, hdImage, filebase): diskType = self.getBuildData('vhdDiskType') if diskType == 'fixed': vhd.makeFlat(hdImage) os.rename(hdImage, filebase + '.vhd') elif diskType == 'difference': vhd.makeDynamic(hdImage, filebase + '-base.vhd') os.chmod(filebase + '-base.vhd', 0400) vhd.makeDifference(filebase + '-base.vhd', filebase + '.vhd', self.basefilename + '-base.vhd') else: vhd.makeDynamic(hdImage, filebase + '.vhd')