Lines Matching refs:type
39 proc exec_instance {type cfgfile} {
40 if {$type eq "redis"} {
42 } elseif {$type eq "sentinel"} {
57 proc spawn_instance {type base_port count {conf {}}} {
61 puts "Starting $type #$j at port $port"
64 set dirname "${type}_${j}"
82 set pid [exec_instance $type $cfgfile]
87 abort_sentinel_test "Problems starting $type #$j: ping timeout"
93 lappend ::${type}_instances [list \
274 foreach type $instance_types {
275 foreach_instance_id [set ::${type}_instances] id {
276 if {[instance_is_killed $type $id]} continue
277 set pid [get_instance_attrib $type $id pid]
285 puts -nonewline "$type/$pid "
290 puts "Instance type $type, ID $id:"
391 proc get_instance_attrib {type id attrib} {
392 dict get [lindex [set ::${type}_instances] $id] $attrib
396 proc set_instance_attrib {type id attrib newval} {
397 set d [lindex [set ::${type}_instances] $id]
399 lset ::${type}_instances $id $d
427 proc get_instance_id_by_port {type port} {
428 foreach_${type}_id id {
429 if {[get_instance_attrib $type $id port] == $port} {
433 fail "Instance $type port $port not found."
442 proc kill_instance {type id} {
443 set pid [get_instance_attrib $type $id pid]
444 set port [get_instance_attrib $type $id port]
447 error "You tried to kill $type $id twice."
451 set_instance_attrib $type $id pid -1
452 set_instance_attrib $type $id link you_tried_to_talk_with_killed_instance
472 proc instance_is_killed {type id} {
473 set pid [get_instance_attrib $type $id pid]
478 proc restart_instance {type id} {
479 set dirname "${type}_${id}"
481 set port [get_instance_attrib $type $id port]
485 set pid [exec_instance $type $cfgfile]
486 set_instance_attrib $type $id pid $pid
491 abort_sentinel_test "Problems starting $type #$id: ping timeout"
497 set_instance_attrib $type $id link $link