Wed, Oct 07, 2020 at 03:48:09PM CEST, jurbanov(a)redhat.com wrote:
From: Jozef Urbanovsky <jurbanov(a)redhat.com>
Signed-off-by: Jozef Urbanovsky <jurbanov(a)redhat.com>
---
lnst/Tests/PacketAssert.py | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/lnst/Tests/PacketAssert.py b/lnst/Tests/PacketAssert.py
index 25a92ba..ca1284e 100644
--- a/lnst/Tests/PacketAssert.py
+++ b/lnst/Tests/PacketAssert.py
@@ -8,6 +8,29 @@ from lnst.Tests.BaseTestModule import BaseTestModule
from lnst.Common.LnstError import LnstError
class PacketAssert(BaseTestModule):
+ """
+ This test module utilizes tcpdump to capture packets on a network interface
+ based on filters defined by the test module parameters. It returns the number
+ of captured packets that match the filter criteria.
+
+ This test module is usually used in conjunction with :any:`Ping` test module,
+ for example:
+
+ pa_job = host1.run(PacketAssert())
+
+ host1.run(Ping())
+
+ pa_job.kill()
+
+ if pa_job.res_data['p_recv'] < 10:
+ print("failed")
+
+ :param interface: interface to be used by the tcpdump
+ :param p_filter: tcpdump's pcap filter expression to be matched
+ :param grep_for: regex to be matched in the string representation of a
+ packet in the tcpdump output
One more comment. you need to indent the "packet in the tcpdump output"
by few spaces so that the documentation is rendered correctly.
I get following error:
PacketAssert
^^^^^^^^^^
/home/igyn/tmp/lnst/lnst/Tests/PacketAssert.py:docstring of
lnst.Tests.PacketAssert.PacketAssert:20: WARNING: Field list ends without a blank line;
unexpected unindent.
+ :param promiscuous: toggle of promiscuous mode
+ """
interface = DeviceParam(mandatory=True)
p_filter = StrParam(default='')
grep_for = ListParam(default=[])
--
2.25.4
_______________________________________________
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...