From e85ea75669ea39e4f99519138a3a84e4df6eed2d Mon Sep 17 00:00:00 2001 From: imarom Date: Sun, 6 Nov 2016 18:50:16 +0200 Subject: RX features Signed-off-by: imarom --- .../stl/trex_stl_lib/trex_stl_port.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py') diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py index 571a6e16..4e5778a6 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py @@ -75,13 +75,13 @@ class Port(object): # decorator to verify port is up def up(func): - def func_wrapper(*args): + def func_wrapper(*args, **kwargs): port = args[0] if not port.is_up(): return port.err("{0} - port is down".format(func.__name__)) - return func(*args) + return func(*args, **kwargs) return func_wrapper @@ -489,7 +489,7 @@ class Port(object): return self.ok() - @writeable + @owned def set_rx_sniffer (self, pcap_filename, limit): params = {"handler": self.handler, @@ -505,6 +505,20 @@ class Port(object): return self.ok() + @owned + def remove_rx_sniffer (self): + params = {"handler": self.handler, + "port_id": self.port_id, + "type": "capture", + "enabled": False} + + rc = self.transmit("set_rx_feature", params) + if rc.bad(): + return self.err(rc.err()) + + return self.ok() + + @owned def pause (self): -- cgit 1.2.3-korg