summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/examples/client_tcl_example.tcl
diff options
context:
space:
mode:
authorvakalapa <vakalapa@cisco.com>2016-04-04 10:20:15 -0400
committervakalapa <vakalapa@cisco.com>2016-04-04 10:20:15 -0400
commit14e4f028b2fc26df224b44eff35a75680c534266 (patch)
treec8003cc5c50979c1519f16d6289395f11a8b7f4d /scripts/automation/trex_control_plane/examples/client_tcl_example.tcl
parent3f32ebdefe99fd44a8de76adf19b9e6d1ded5777 (diff)
Adding trex tcl client and example tcl script
Diffstat (limited to 'scripts/automation/trex_control_plane/examples/client_tcl_example.tcl')
-rwxr-xr-xscripts/automation/trex_control_plane/examples/client_tcl_example.tcl28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/examples/client_tcl_example.tcl b/scripts/automation/trex_control_plane/examples/client_tcl_example.tcl
new file mode 100755
index 00000000..636f1669
--- /dev/null
+++ b/scripts/automation/trex_control_plane/examples/client_tcl_example.tcl
@@ -0,0 +1,28 @@
+#!/bin/sh
+#\
+exec /usr/bin/expect "$0" "$@"
+#
+
+# Sourcing the tcl trex client api
+source trex_tcl_client.tcl
+
+#Initializing trex server attributes
+set check [TRexTclClient::create_host "http://172.18.73.122"]
+
+#Formulate the command options as a dict
+set trex_cmds [dict create c 2 m 10 l 1000 ]
+
+#call the start_trex rpc function by feeding the appropriate arguments
+set status [::TRexTclClient::start_trex "cap2/dns.yaml" 40 $trex_cmds]
+puts "Status : $status"
+
+#get the result json
+set result [::TRexTclClient::get_result_obj]
+puts "$result"
+
+#stop the trex server
+set ret_value [ ::TRexTclClient::stop_trex $status]
+puts "Stop value : $ret_value"
+puts "\n \n"
+
+