summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/examples/client_tcl_example.tcl
blob: 3467c89895e074762a4b54b1756af2a5da163eef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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 "localhost"]

#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"