On Mon, Dec 14, 2020 at 11:59:28AM +0100, jurbanov(a)redhat.com wrote:
From: Jozef Urbanovsky <jurbanov(a)redhat.com>
Improvement to logs to be more human readable,
especially in the Trex* flows.
Signed-off-by: Jozef Urbanovsky <jurbanov(a)redhat.com>
---
lnst/Tests/TRex.py | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/lnst/Tests/TRex.py b/lnst/Tests/TRex.py
index 40da393..4870b86 100644
--- a/lnst/Tests/TRex.py
+++ b/lnst/Tests/TRex.py
@@ -2,6 +2,7 @@ from lnst.Common.Parameters import Param, StrParam, IntParam, FloatParam
from lnst.Common.Parameters import IpParam, DeviceOrIpParam
from lnst.Tests.BaseTestModule import BaseTestModule, TestModuleError
from lnst.External.TRex.TRexLib import TRexCli, TRexSrv, TRexError
+from pprint import pformat
class TRexCommon(BaseTestModule):
@@ -12,6 +13,8 @@ class TRexClient(TRexCommon):
flows = Param(mandatory=True)
+ module = StrParam(default="UDPSimple")
+
duration = IntParam(mandatory=True)
warmup_time = IntParam(default=5)
@@ -24,6 +27,20 @@ class TRexClient(TRexCommon):
super(TRexClient, self).__init__(**kwargs)
self.impl = TRexCli(self.params)
+ def __repr__(self):
+ string = f"""
+ TrexClient(
+ trex_dir={self.impl.params.trex_dir},
+ module={self.impl.params.module},
+ msg_size={self.impl.params.msg_size},
+ ports={self.impl.params.ports},
+ server_hostname={self.impl.params.server_hostname},
+ flows={pformat(self.impl.params.flows)}
+ )
+ """
+
+ return string
+
def runtime_estimate(self):
_duration_overhead = 5
return (self.params.duration +
@@ -51,6 +68,16 @@ class TRexServer(TRexCommon):
super(TRexServer, self).__init__(**kwargs)
self.impl = TRexSrv(self.params)
+ def __repr__(self):
+ string = f"""
+ TrexServer("
^
I think there's an extra " character? Possibly a typo.
-Ondrej
+ trex_dir={self.impl.params.trex_dir},
+ cores={self.impl.params.cores},
+ flows={pformat(self.impl.params.flows)}
+ )
+ """
+ return string
+
def run(self):
self._res_data={}
try:
--
2.28.0
_______________________________________________
LNST-developers mailing list -- lnst-developers(a)lists.fedorahosted.org
To unsubscribe send an email to lnst-developers-leave(a)lists.fedorahosted.org
Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives:
https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedora...