From 0c2b3c83f9cc0c25277c39660dce132aad55c3d7 Mon Sep 17 00:00:00 2001 From: Dan Klein Date: Wed, 28 Oct 2015 07:28:37 +0200 Subject: updated more HLTAPI functionality and fixed found bugs. Working: Start/stop traffic, traffic config (semi), connect, clean Missing: stats Next: boost console --- .../examples/stateless_example.py | 31 +++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) mode change 100644 => 100755 scripts/automation/trex_control_plane/examples/stateless_example.py (limited to 'scripts/automation/trex_control_plane/examples/stateless_example.py') diff --git a/scripts/automation/trex_control_plane/examples/stateless_example.py b/scripts/automation/trex_control_plane/examples/stateless_example.py old mode 100644 new mode 100755 index f97bce4c..bb0fe983 --- a/scripts/automation/trex_control_plane/examples/stateless_example.py +++ b/scripts/automation/trex_control_plane/examples/stateless_example.py @@ -1 +1,30 @@ -__author__ = 'danklei' +#!/router/bin/python + +import trex_root_path +from client.trex_hltapi import CTRexHltApi + +if __name__ == "__main__": + port_list = [1,2] + try: + hlt_client = CTRexHltApi() + con = hlt_client.connect("localhost", port_list, "danklei", break_locks=True, reset=True)#, port=6666) + print con + + res = hlt_client.traffic_config("create", 1)#, ip_src_addr="2000.2.2") + print res + res = hlt_client.traffic_config("create", 2)#, ip_src_addr="2000.2.2") + print res + + res = hlt_client.traffic_control("run", [1, 2])#, ip_src_addr="2000.2.2") + print res + + res = hlt_client.traffic_control("stop", [1, 2])#, ip_src_addr="2000.2.2") + print res + + + + except Exception as e: + raise + finally: + res = hlt_client.cleanup_session(port_list) + print res \ No newline at end of file -- cgit 1.2.3-korg