diff options
author | pmikus <peter.mikus@protonmail.ch> | 2023-01-18 08:54:45 +0000 |
---|---|---|
committer | pmikus <peter.mikus@protonmail.ch> | 2023-01-18 08:54:45 +0000 |
commit | e0eb07f2ec67405abf621bcbe845598de92a0803 (patch) | |
tree | 7f0f7aa00ff94b75cb343e9871388f12cb7d8f8c | |
parent | 8609df3a0e9f5510a5485d100ed03a40b051c199 (diff) |
fix(core): Handle hoststack exceptions
Signed-off-by: pmikus <peter.mikus@protonmail.ch>
Change-Id: I28295ee6e64ab9674449a98e8d036b39d3d538bf
-rw-r--r-- | resources/libraries/python/HoststackUtil.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/resources/libraries/python/HoststackUtil.py b/resources/libraries/python/HoststackUtil.py index 35acdd70ee..073d3ec831 100644 --- a/resources/libraries/python/HoststackUtil.py +++ b/resources/libraries/python/HoststackUtil.py @@ -376,12 +376,15 @@ class HoststackUtil(): return (True, test_results) elif program[u"name"] == u"iperf3": test_results += program_stdout - iperf3_json = json.loads(program_stdout) - program_json = iperf3_json[u"intervals"][0][u"sum"] + program_json = json.loads(program_stdout)[u"intervals"][0][u"sum"] + try: + retransmits = program_json["retransmits"] + except(KeyError): + retransmits = None export_hoststack_results( bandwidth=program_json["bits_per_second"], duration=program_json["seconds"], - retransmits=program_json["retransmits"] + retransmits=retransmits ) else: test_results += u"Unknown HostStack Test Program!\n" + \ |