diff options
author | 2016-05-09 17:16:58 +0300 | |
---|---|---|
committer | 2016-05-09 17:16:58 +0300 | |
commit | 1142e8c4678b2c357b080f5ae31eca30fac46478 (patch) | |
tree | faa580cb15682d1cc6355925ca2f293cbc8cd2ad /scripts/automation/trex_control_plane/stl/trex_stl_lib | |
parent | f2b38a3de49bd73ac1c29103c9c3305b18222c6a (diff) |
added force option to local PCAP - for > 1MB files
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib')
-rwxr-xr-x | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py index 9f96b237..d1352804 100755 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py @@ -1931,7 +1931,8 @@ class STLClient(object): ipg_usec = None, speedup = 1.0, count = 1, - duration = -1): + duration = -1, + force = False): """ Push a local PCAP to the server This is equivalent to loading a PCAP file to a profile @@ -1958,6 +1959,9 @@ class STLClient(object): duration: float Limit runtime by duration in seconds + force: bool + Ignore file size limit - push any file size to the server + :raises: + :exc:`STLError` @@ -1972,8 +1976,8 @@ class STLClient(object): validate_type('duration', duration, (float, int)) # no support for > 1MB PCAP - use push remote - if os.path.getsize(pcap_filename) > (1024 * 1024): - raise STLError("PCAP size of {:,} B is too big for local push - consider using remote push".format(os.path.getsize(pcap_filename))) + if not force and os.path.getsize(pcap_filename) > (1024 * 1024): + raise STLError("PCAP size of {:} is too big for local push - consider using remote push or provide 'force'".format(format_num(os.path.getsize(pcap_filename), suffix = 'B'))) self.remove_all_streams(ports = ports) @@ -2695,7 +2699,8 @@ class STLClient(object): ipg_usec = opts.ipg_usec, speedup = opts.speedup, count = opts.count, - duration = opts.duration) + duration = opts.duration, + force = opts.force) |