aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/model
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2023-08-14 09:00:44 +0000
committerTibor Frank <tifrank@cisco.com>2023-08-15 07:54:57 +0000
commit9aaade66aee4d1f1ca57aca272128db201a6f6cc (patch)
tree3855622a9e26b5294eb0d5f78fa108be43c0582e /resources/libraries/python/model
parentc3f6c20aa939ccdb0f3673ea715886ad3d1d2333 (diff)
GSO: Add export of results to json files.
Change-Id: Iac742f0571b11e06662af6bf1b680d0b4e196ddd Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/libraries/python/model')
-rw-r--r--resources/libraries/python/model/ExportJson.py2
-rw-r--r--resources/libraries/python/model/validate.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/resources/libraries/python/model/ExportJson.py b/resources/libraries/python/model/ExportJson.py
index de8874dc52..73e822491c 100644
--- a/resources/libraries/python/model/ExportJson.py
+++ b/resources/libraries/python/model/ExportJson.py
@@ -71,7 +71,7 @@ class ExportJson():
elif u"HOSTSTACK" in tags:
test_type = u"hoststack"
elif u"GSO_TRUE" in tags or u"GSO_FALSE" in tags:
- test_type = u"gso"
+ test_type = u"mrr"
elif u"RECONF" in tags:
test_type = u"reconf"
# The remaining 3 options could also apply to DPDK and TRex tests.
diff --git a/resources/libraries/python/model/validate.py b/resources/libraries/python/model/validate.py
index ee82d3289f..85c4b993c9 100644
--- a/resources/libraries/python/model/validate.py
+++ b/resources/libraries/python/model/validate.py
@@ -52,10 +52,11 @@ def validate(file_path, validator):
:param validator: Validator instance to use for validation.
:type file_path: str
:type validator: jsonschema.validators.Validator
- :raises RuntimeError: If schema validation fails.
+ :raises ValidationError: If schema validation fails.
"""
with open(file_path, "rt", encoding="utf-8") as file_in:
instance = json.load(file_in)
error = jsonschema.exceptions.best_match(validator.iter_errors(instance))
if error is not None:
+ print(json.dumps(instance, indent=4))
raise error