From 1142e8c4678b2c357b080f5ae31eca30fac46478 Mon Sep 17 00:00:00 2001 From: imarom Date: Mon, 9 May 2016 17:16:58 +0300 Subject: added force option to local PCAP - for > 1MB files --- .../trex_control_plane/stl/trex_stl_lib/trex_stl_client.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib') 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) -- cgit