summaryrefslogtreecommitdiffstats
path: root/scripts/api
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/api')
-rw-r--r--scripts/api/stl/examples/stl_bi_dir_flows.py8
-rw-r--r--scripts/api/stl/examples/stl_simple_burst.py4
2 files changed, 6 insertions, 6 deletions
diff --git a/scripts/api/stl/examples/stl_bi_dir_flows.py b/scripts/api/stl/examples/stl_bi_dir_flows.py
index 429445e6..38cb36dd 100644
--- a/scripts/api/stl/examples/stl_bi_dir_flows.py
+++ b/scripts/api/stl/examples/stl_bi_dir_flows.py
@@ -90,11 +90,11 @@ def simple_burst ():
# read the stats after the test
stats = c.get_stats()
- print json.dumps(stats["port 0"], indent = 4, separators=(',', ': '), sort_keys = True)
- print json.dumps(stats["port 1"], indent = 4, separators=(',', ': '), sort_keys = True)
+ print json.dumps(stats[0], indent = 4, separators=(',', ': '), sort_keys = True)
+ print json.dumps(stats[1], indent = 4, separators=(',', ': '), sort_keys = True)
- lost_a = stats["port 0"]["opackets"] - stats["port 1"]["ipackets"]
- lost_b = stats["port 1"]["opackets"] - stats["port 0"]["ipackets"]
+ lost_a = stats[0]["opackets"] - stats[1]["ipackets"]
+ lost_b = stats[1]["opackets"] - stats[0]["ipackets"]
print "\npackets lost from 0 --> 1: {0} pkts".format(lost_a)
print "packets lost from 1 --> 0: {0} pkts".format(lost_b)
diff --git a/scripts/api/stl/examples/stl_simple_burst.py b/scripts/api/stl/examples/stl_simple_burst.py
index 3b394d10..2ca71b44 100644
--- a/scripts/api/stl/examples/stl_simple_burst.py
+++ b/scripts/api/stl/examples/stl_simple_burst.py
@@ -37,7 +37,7 @@ def simple_burst ():
try:
- #c.logger.set_verbose(c.logger.VERBOSE_NORMAL)
+ #c.set_verbose("high")
# create two bursts and link them
s1 = STLStream(packet = pkt_bld,
@@ -56,7 +56,7 @@ def simple_burst ():
c.reset(ports = [0, 1])
# add both streams to ports
- c.add_streams([s1, s2], ports = [0, 1])
+ stream_ids = c.add_streams([s1, s2], ports = [0, 1])
# run 5 times
for i in xrange(1, 6):