aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/Iperf3.py
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2022-05-05 13:08:10 +0200
committerPeter Mikus <pmikus@cisco.com>2022-05-24 08:25:08 +0000
commita201f3d3a5fdb9ccb86d57664cfd1de4bf484d36 (patch)
tree6233cbe5bf30a768505e8677f8b2143ad15e3752 /resources/libraries/python/Iperf3.py
parent93e808cb3e8b5270bec46e2a19d78736e08aa46c (diff)
fix(uti): Add TG type export
- This is actually bug not a feature. - AB to be added later - Tested on TREX and iPerf3 Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: Ib6f2d13e3b9401a9fb5759e42a8a310ee11b9d41
Diffstat (limited to 'resources/libraries/python/Iperf3.py')
-rw-r--r--resources/libraries/python/Iperf3.py27
1 files changed, 26 insertions, 1 deletions
diff --git a/resources/libraries/python/Iperf3.py b/resources/libraries/python/Iperf3.py
index ed186f0757..12d0633abc 100644
--- a/resources/libraries/python/Iperf3.py
+++ b/resources/libraries/python/Iperf3.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2021 Cisco and/or its affiliates.
+# Copyright (c) 2022 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@ -33,6 +33,31 @@ class Iperf3:
# Computed affinity for iPerf client.
self._c_affinity = None
+ @staticmethod
+ def get_iperf_type(node):
+ """Log and return the installed traffic generator type.
+
+ :param node: Node from topology file.
+ :type node: dict
+ :returns: Traffic generator type string.
+ :rtype: str
+ """
+ return "IPERF"
+
+ @staticmethod
+ def get_iperf_version(node):
+ """Log and return the installed traffic generator version.
+
+ :param node: Node from topology file.
+ :type node: dict
+ :returns: Traffic generator version string.
+ :rtype: str
+ """
+ command = f"iperf3 --version | head -1"
+ message = u"Get iPerf version failed!"
+ stdout, _ = exec_cmd_no_error(node, command, message=message)
+ return stdout.strip()
+
def initialize_iperf_server(
self, node, pf_key, interface, bind, bind_gw, bind_mask,
namespace=None, cpu_skip_cnt=0, cpu_cnt=1, instances=1):