The promiscuos parameter is passed to the tcpdump that is ran by the
PacketAssert module. This way, the user can control whether he wants to
make a promiscuos snif or not.
Signed-off-by: Yotam Gigi <yotamg(a)mellanox.com>
---
test_modules/PacketAssert.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/test_modules/PacketAssert.py b/test_modules/PacketAssert.py
index 49790b9..1f3c4cb 100644
--- a/test_modules/PacketAssert.py
+++ b/test_modules/PacketAssert.py
@@ -61,10 +61,14 @@ class PacketAssert(TestGeneric):
interface = self.get_mopt("interface")
pcap_filter = self.get_opt("filter")
+ promiscuous = self.get_opt("promiscuous", default=False)
if not pcap_filter:
pcap_filter = ""
- cmd = "tcpdump -p -nn -i %s \"%s\"" % (interface,
pcap_filter)
+ promiscuous_str = "" if promiscuous else "-p"
+
+ cmd = "tcpdump %s -nn -i %s \"%s\"" % (promiscuous_str,
interface,
+ pcap_filter)
logging.debug("PacketAssert tcpdump command: %s" % cmd)
self._cmd = cmd
--
2.4.11