summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-08-24 01:07:14 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-08-24 01:07:14 +0300
commit8634fdc567b948b35c2a87cea4679aff3995cba6 (patch)
tree7d0645ff27ba9f5976293df8618d0e1b390f1d52 /scripts
parent0ace93bbf2049a8da1ad8a002da5ecb8b2bae3b9 (diff)
hltapi example: add example command of removing all streams from port
Diffstat (limited to 'scripts')
-rw-r--r--scripts/automation/trex_control_plane/stl/examples/hlt_udp_simple.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/automation/trex_control_plane/stl/examples/hlt_udp_simple.py b/scripts/automation/trex_control_plane/stl/examples/hlt_udp_simple.py
index bdec9999..1f754f0a 100644
--- a/scripts/automation/trex_control_plane/stl/examples/hlt_udp_simple.py
+++ b/scripts/automation/trex_control_plane/stl/examples/hlt_udp_simple.py
@@ -70,7 +70,7 @@ if __name__ == "__main__":
print('Connecting to TRex')
res = hltapi.connect(device = args.server, port_list = [0, 1], reset = True, break_locks = True)
check_res(res)
- ports = res['port_handle']
+ ports = list(res['port_handle'].values())
if len(ports) < 2:
error('Should have at least 2 ports for this test')
print('Connected, acquired ports: %s' % ports)
@@ -103,6 +103,10 @@ if __name__ == "__main__":
res = hltapi.traffic_stats(mode = 'aggregate', port_handle = ports[:2])
check_res(res)
print_brief_stats(res)
+
+ print('Removing all streams from port 0')
+ res = hltapi.traffic_config(mode = 'remove', port_handle = ports[0], stream_id = 'all')
+ check_res(res)
res = hltapi.cleanup_session(port_handle = 'all')
check_res(res)