X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2Fmodel%2FExportJson.py;h=73e822491cd8fd74ac9d0abaca9b1740ea90e826;hb=9aaade66aee4d1f1ca57aca272128db201a6f6cc;hp=bbb989c3cc41ecfc4acb726e1985f8298b081e84;hpb=8609df3a0e9f5510a5485d100ed03a40b051c199;p=csit.git diff --git a/resources/libraries/python/model/ExportJson.py b/resources/libraries/python/model/ExportJson.py index bbb989c3cc..73e822491c 100644 --- a/resources/libraries/python/model/ExportJson.py +++ b/resources/libraries/python/model/ExportJson.py @@ -23,12 +23,14 @@ as serialization might have introduced subtle errors. import datetime import os.path +from binascii import b2a_base64 from dateutil.parser import parse from robot.api import logger from robot.libraries.BuiltIn import BuiltIn +from zlib import compress from resources.libraries.python.Constants import Constants -from resources.libraries.python.jumpavg.AvgStdevStats import AvgStdevStats +from resources.libraries.python.jumpavg import AvgStdevStats from resources.libraries.python.model.ExportResult import ( export_dut_type_and_version, export_tg_type_and_version ) @@ -65,11 +67,11 @@ class ExportJson(): if u"DEVICETEST" in tags: test_type = u"device" elif u"LDP_NGINX" in tags: - test_type = u"vsap" + test_type = u"hoststack" 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. @@ -357,6 +359,11 @@ class ExportJson(): Results are used to avoid future post processing, making it more efficient to consume. """ + if self.data["telemetry"]: + telemetry_encode = "\n".join(self.data["telemetry"]).encode() + telemetry_compress = compress(telemetry_encode, level=9) + telemetry_base64 = b2a_base64(telemetry_compress, newline=False) + self.data["telemetry"] = [telemetry_base64.decode()] if u"result" not in self.data: return result_node = self.data[u"result"]