+ #print('Error while executing {}'.format(args))
+ raise BluvalError(OSError)
+
+
+def validate_layer(blueprint, layer):
+ """validates a layer by validating all testcases under that layer
+ """
+ print('## Layer {}'.format(layer))
+ for testcase in blueprint[layer]:
+ testcase['layer'] = layer
+ run_testcase(testcase)
+
+
+def validate_blueprint(yaml_loc, layer):
+ """Parse yaml file and validates given layer. If no layer given all layers
+ validated
+ """
+ with open(str(yaml_loc)) as yaml_file:
+ yamldoc = yaml.safe_load(yaml_file)
+ blueprint = yamldoc['blueprint']
+ validate_layer(blueprint, layer)