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/examples | |
parent | f2b38a3de49bd73ac1c29103c9c3305b18222c6a (diff) |
added force option to local PCAP - for > 1MB files
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/examples')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/examples/stl_pcap_remote.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/automation/trex_control_plane/stl/examples/stl_pcap_remote.py b/scripts/automation/trex_control_plane/stl/examples/stl_pcap_remote.py index 2270b51c..c47eee31 100644 --- a/scripts/automation/trex_control_plane/stl/examples/stl_pcap_remote.py +++ b/scripts/automation/trex_control_plane/stl/examples/stl_pcap_remote.py @@ -13,8 +13,10 @@ def inject_pcap (c, pcap_file, port, loop_count, ipg_usec, duration): # assume 100 seconds is enough - but can be more c.wait_on_traffic(ports = [port], timeout = 100) - #stats = c.get_stats() - #opackets = stats[port]['opackets'] + stats = c.get_stats() + opackets = stats[port]['opackets'] + + return opackets #print("{0} packets were Tx on port {1}\n".format(opackets, port)) @@ -102,8 +104,8 @@ def start (args): for i, cap in enumerate(caps, start = 1): before = time.time() print ("{:} CAP {:} @ {:} - ".format(i, cap, sizeof_fmt(os.path.getsize(cap)))), - inject_pcap(c, cap, options.port, options.loop_count, options.ipg, options.duration) - print("took {:.2f} seconds").format(time.time()-before) + injected = inject_pcap(c, cap, options.port, options.loop_count, options.ipg, options.duration) + print("took {:.2f} seconds for {:} packets").format(time.time() - before, injected) except STLError as e: print(e) |