From 2586ea76377f8144be904676ffdf331d262fdf24 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 18 Mar 2014 14:58:27 +0100 Subject: [PATCH] Sentinel: instance_is_killed proc added to sentinel.tcl. --- tests/sentinel.tcl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/sentinel.tcl b/tests/sentinel.tcl index faa39354..4c0a718c 100644 --- a/tests/sentinel.tcl +++ b/tests/sentinel.tcl @@ -356,6 +356,12 @@ proc kill_instance {type id} { set ::pids [lsearch -all -inline -not -exact $::pids $pid] } +# Return true of the instance of the specified type/id is killed. +proc instance_is_killed {type id} { + set pid [get_instance_attrib $type $id pid] + return $pid == -1 +} + # Restart an instance previously killed by kill_instance proc restart_instance {type id} { set dirname "${type}_${id}"