diff options
author | 2015-11-09 11:20:28 +0200 | |
---|---|---|
committer | 2015-11-09 11:20:28 +0200 | |
commit | 82280f7c87fabed60d83643bd9ec2c79cac34668 (patch) | |
tree | 62916038bc3650e161c53bc1f9a44df02dca8fe3 /scripts/automation/trex_control_plane/examples | |
parent | 7c9355cc198ee897de9cd2d60e88a232ce1fa405 (diff) | |
parent | c6d2cb0554ebc39142fb433040a968714a7ec24f (diff) |
Merge branch 'rpc_intg1'
Diffstat (limited to 'scripts/automation/trex_control_plane/examples')
-rwxr-xr-x | scripts/automation/trex_control_plane/examples/stateless_example.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/examples/stateless_example.py b/scripts/automation/trex_control_plane/examples/stateless_example.py new file mode 100755 index 00000000..bb0fe983 --- /dev/null +++ b/scripts/automation/trex_control_plane/examples/stateless_example.py @@ -0,0 +1,30 @@ +#!/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 |