Merge "[docs] Document the changes to k8s container"
[validation.git] / bluval / bluval.py
index 4a01a92..8ed6bdf 100644 (file)
@@ -28,19 +28,21 @@ def run_testcase(testcase):
     """
     show_stopper = testcase.get('show_stopper', False)
     what = testcase.get('what')
-    results = "results/"+what
-    command = '{} {} {} {}'.format("robot", "-d", results, what)
+    variables = "variables.yaml"
+    results = "results/"+testcase.get('layer')+"/"+what
+    test_path = "tests/"+testcase.get('layer')+"/"+what
+    args = ["robot", "-V", variables, "-d", results, test_path]
 
     print('Executing testcase {}'.format(testcase['name']))
     print('          show_stopper {}'.format(show_stopper))
-    print('Invoking {}'.format(command))
+    print('Invoking {}'.format(args))
     try:
-        status = subprocess.call(command, shell=True)
+        status = subprocess.call(args, shell=False)
         if status != 0 and show_stopper:
             print('Show stopper testcase failed')
             return status
     except OSError:
-        print('Error while executing {}'.format(command))
+        print('Error while executing {}'.format(args))
         return -1
     return status
 
@@ -50,6 +52,7 @@ def validate_layer(blueprint, layer):
     """
     print('## Layer {}'.format(layer))
     for testcase in blueprint[layer]:
+        testcase['layer'] = layer
         run_testcase(testcase)