def test_tdl_content_validation(): tree = ET.parse(random.choice(utils.TEMPLATE_FILES)) roottag = tree.getroot() ostag = roottag.find('./os') rootpwtag = ostag.find('./rootpw') ostag.remove(rootpwtag) imagejson = utils.build_base(ET.tostring(roottag)) imageid = imagejson['id'] assert utils.wait_until_base_completes(imageid) == 'FAILED'
def _build_base_from_queue(queue): global base_built while True: tdlfile = queue.get() template = open(tdlfile, "r").read() imagejson = utils.build_base(template) imageid = imagejson["id"] imagestatus = utils.wait_until_base_completes(imageid) with base_lock: base_built[tdlfile] = (imageid, imagestatus) queue.task_done()
def _build_base_from_queue(queue): global base_built while True: tdlfile = queue.get() template = open(tdlfile, 'r').read() imagejson = utils.build_base(template) imageid = imagejson['id'] imagestatus = utils.wait_until_base_completes(imageid) with base_lock: base_built[tdlfile] = (imageid, imagestatus) queue.task_done()
def test_tdl_structure_validation(): template = open(random.choice(utils.TEMPLATE_FILES), 'r').read() template = re.sub('<install', '<intall', template) imagejson = utils.build_base(template) imageid = imagejson['id'] assert utils.wait_until_base_completes(imageid) == 'FAILED'