bootstrap-vz/bootstrapvz/base/__init__.py
Anders Ingemann e271f3e49a Initial work on integration testing started.
The work consists of three parts:
* Allow for bootstrapping remotely,
  this makes it possible to run the tests
  on e.g. OSX with VirtualBox installed
* Make bootstrapping a fully automated process
  where the manifests can be generated by the tests
  and the tests can call the bootstrapper directly in python
* Create a framework wherein instances can be booted up
  using the bootstrapped images and subsequently tested
2015-04-16 22:15:17 +02:00

21 lines
864 B
Python

from phase import Phase
from task import Task
__all__ = ['Phase', 'Task', 'main']
def validate_manifest(data, validator, error):
"""Validates the manifest using the base manifest
:param dict data: The data of the manifest
:param function validator: The function that validates the manifest given the data and a path
:param function error: The function tha raises an error when the validation fails
"""
import os.path
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
validator(data, schema_path)
# Check the bootloader/partitioning configuration.
# Doing this via the schema is a pain and does not output a useful error message.
if data['system']['bootloader'] == 'grub' and data['volume']['partitions']['type'] == 'none':
error('Grub cannot boot from unpartitioned disks', ['system', 'bootloader'])