summaryrefslogtreecommitdiffstats
path: root/scripts/api/stl/examples/stl_simple_burst.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-02-08 10:55:20 -0500
committerimarom <imarom@cisco.com>2016-02-08 10:55:20 -0500
commit6107c1ca4aa485c5971ff3326513b8f4934f7ac1 (patch)
treea109d80501bd087e3219f68c186fb55bc17e090a /scripts/api/stl/examples/stl_simple_burst.py
parentf5a5e50bfe046148a20f6ce578d6082119dec2c0 (diff)
huge refactor - again
Diffstat (limited to 'scripts/api/stl/examples/stl_simple_burst.py')
-rw-r--r--scripts/api/stl/examples/stl_simple_burst.py65
1 files changed, 0 insertions, 65 deletions
diff --git a/scripts/api/stl/examples/stl_simple_burst.py b/scripts/api/stl/examples/stl_simple_burst.py
deleted file mode 100644
index 1e3e7695..00000000
--- a/scripts/api/stl/examples/stl_simple_burst.py
+++ /dev/null
@@ -1,65 +0,0 @@
-import stl_path
-from trex_control_plane.stl.api import *
-
-import time
-
-def simple_burst ():
-
-
- # create client
- c = STLClient()
- passed = True
-
- try:
- pkt = STLPktBuilder(pkt = Ether()/IP(src="16.0.0.1",dst="48.0.0.1")/UDP(dport=12,sport=1025)/IP()/'a_payload_example')
-
- # create two bursts and link them
- s1 = STLStream(name = 'A',
- packet = pkt,
- mode = STLTXSingleBurst(total_pkts = 5000),
- next = 'B')
-
- s2 = STLStream(name = 'B',
- self_start = False,
- packet = pkt,
- mode = STLTXSingleBurst(total_pkts = 3000))
-
- # connect to server
- c.connect()
-
- # prepare our ports
- c.reset(ports = [0, 3])
-
- # add both streams to ports
- stream_ids = c.add_streams([s1, s2], ports = [0, 3])
-
- # run 5 times
- for i in xrange(1, 6):
- c.clear_stats()
- c.start(ports = [0, 3], mult = "1gbps")
- c.wait_on_traffic(ports = [0, 3])
-
- stats = c.get_stats()
- ipackets = stats['total']['ipackets']
-
- print "Test iteration {0} - Packets Received: {1} ".format(i, ipackets)
- # (5000 + 3000) * 2 ports = 16,000
- if (ipackets != (16000)):
- passed = False
-
- except STLError as e:
- passed = False
- print e
-
- finally:
- c.disconnect()
-
- if passed:
- print "\nTest has passed :-)\n"
- else:
- print "\nTest has failed :-(\n"
-
-
-# run the tests
-simple_burst()
-