diff options
author | imarom <imarom@cisco.com> | 2016-11-06 18:50:16 +0200 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-11-06 18:50:16 +0200 |
commit | e85ea75669ea39e4f99519138a3a84e4df6eed2d (patch) | |
tree | 27e1563def12afc2ef03c369324aa2b03807cc76 /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py | |
parent | a1ade6fd8e044b9866a8644db3519305539cfc61 (diff) |
RX features
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py | 20 |
1 files changed, 17 insertions, 3 deletions
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, @@ -506,6 +506,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): if (self.state == self.STATE_PCAP_TX) : |