GSO: Add export of results to json files. 65/39365/9
authorTibor Frank <tifrank@cisco.com>
Mon, 14 Aug 2023 09:00:44 +0000 (09:00 +0000)
committerTibor Frank <tifrank@cisco.com>
Tue, 15 Aug 2023 07:54:57 +0000 (07:54 +0000)
Change-Id: Iac742f0571b11e06662af6bf1b680d0b4e196ddd
Signed-off-by: Tibor Frank <tifrank@cisco.com>
resources/libraries/python/model/ExportJson.py
resources/libraries/python/model/validate.py
resources/libraries/robot/performance/performance_utils.robot
resources/model_schema/test_case.schema.yaml

index de8874d..73e8224 100644 (file)
@@ -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.
index ee82d32..85c4b99 100644 (file)
@@ -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
index 4840e05..34b9ab6 100644 (file)
 | | ${results}= | Send iPerf3 traffic at specified rate
 | | ... | ${trial_duration} | ${None} | ${None}
 | | ... | ${trial_multiplicity} | ${traffic_directions}
+| | ... | export_mrr_unit=bps
 | | Set Test Message | ${\n}iPerf3 trial results
 | | Set Test Message | in Gbits per second: ${results}
 | | ... | append=yes
 | | ... | Type: integer
 | | ... | - extended_debug - True to enable extended debug.
 | | ... | Type: boolean
+| | ... | - export_mrr_unit - Use this unit when exporting MRR values,
+| | ... | or empty string for no export.
+| | ... | Type: string
 | |
 | | ... | *Example:*
 | |
 | | [Arguments] | ${trial_duration} | ${rate} | ${frame_size}
 | | ... | ${trial_multiplicity}=${trial_multiplicity}
 | | ... | ${traffic_directions}=${1} | ${extended_debug}=${extended_debug}
+| | ... | ${export_mrr_unit}=${Empty}
 | |
 | | Set Test Variable | ${extended_debug}
 | | Set Test Variable | ${rate}
 | | | ... | bind=${iperf_client_bind}
 | | | ... | affinity=${iperf_client_affinity}
 | | | ${conv} = | Convert To Number | ${rr['sum_received']['bits_per_second']}
+| | | Append Mrr Value | ${conv} | ${export_mrr_unit}
 | | | ${conv} = | Evaluate | ${conv} / ${1000} / ${1000} / ${1000}
 | | | ${conv} = | Evaluate | "{:.3f}".format(${conv})
 | | | Append To List
index 5d33e0e..5c7cf30 100644 (file)
@@ -429,12 +429,14 @@ $defs:
             description: >-
                 Packets per second (pps),
                 connections per second (cps),
-                requests per second (rps).
+                requests per second (rps),
+                bits per second (bps).
             type: string
             enum:
             -   pps
             -   cps
             -   rps
+            -   bps
         bandwidth_unit:
             description: >-
                 Unit of measurement for bandwidth values.