Add a helper for configuring the iperf module with number of packets other
than duration. This way, a recipe can ask for a specific number of packets
to be sent by iperf.
Signed-off-by: Yotam Gigi <yotamg(a)mellanox.com>
---
recipes/switchdev/TestLib.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/recipes/switchdev/TestLib.py b/recipes/switchdev/TestLib.py
index 91f6a8d..965afe1 100644
--- a/recipes/switchdev/TestLib.py
+++ b/recipes/switchdev/TestLib.py
@@ -207,6 +207,16 @@ class TestLib:
proc = host.run(srv_m, bg=True, netns=listener.get_netns())
return proc
+ def _get_iperf_cli_mod_packets(self, mc_group, num, speed, size = 100):
+ modules_options = {
+ "role" : "client",
+ "iperf_server" : mc_group,
+ "duration" : 1,
+ "iperf_opts" : "-u -l %d -n %d -b %dmb -T 100" %
+ (size, size * num, speed)
+ }
+ return self._ctl.get_module("Iperf", options = modules_options)
+
def iperf_mc(self, sender, recivers, mc_group, desc=None):
if not desc:
desc = self._generate_default_desc(sender, recivers)
--
2.8.4