summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/examples
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-05-09 17:16:58 +0300
committerimarom <imarom@cisco.com>2016-05-09 17:16:58 +0300
commit1142e8c4678b2c357b080f5ae31eca30fac46478 (patch)
treefaa580cb15682d1cc6355925ca2f293cbc8cd2ad /scripts/automation/trex_control_plane/stl/examples
parentf2b38a3de49bd73ac1c29103c9c3305b18222c6a (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.py10
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)