Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
2af2173a
Commit
2af2173a
authored
Mar 04, 2014
by
antirez
Browse files
Sentinel test: debugging console improved.
parent
1dc1e31c
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/sentinel.tcl
View file @
2af2173a
...
@@ -130,7 +130,7 @@ proc main {} {
...
@@ -130,7 +130,7 @@ proc main {} {
proc pause_on_error
{}
{
proc pause_on_error
{}
{
puts
""
puts
""
puts
[
colorstr yellow
"*** Please inspect the error now ***"
]
puts
[
colorstr yellow
"*** Please inspect the error now ***"
]
puts
"
\n
Type
\"
continue
\"
to resume the test.
\n
"
puts
"
\n
Type
\"
continue
\"
to resume the test
,
\"
help
\"
for help screen
.
\n
"
while 1
{
while 1
{
puts -nonewline
"> "
puts -nonewline
"> "
flush stdout
flush stdout
...
@@ -147,9 +147,49 @@ proc pause_on_error {} {
...
@@ -147,9 +147,49 @@ proc pause_on_error {} {
puts
[
exec tail -$count sentinel_$id/log.txt
]
puts
[
exec tail -$count sentinel_$id/log.txt
]
puts
"---------------------
\n
"
puts
"---------------------
\n
"
}
}
}
elseif
{
$cmd
eq
{
ls
}}
{
foreach_redis_id id
{
puts -nonewline
"Redis
$id
"
set errcode
[
catch
{
set str
{}
append str
"@
[
RI $id tcp_port
]
: "
append str
"
[
RI $id role
]
"
if
{[
RI $id role
]
eq
{
slave
}}
{
append str
"
[
RI $id master_host
]
:
[
RI $id master_port
]
"
}
set str
}
retval
]
if
{
$errcode
}
{
puts
" --
$retval
"
}
else
{
puts $retval
}
}
foreach_sentinel_id id
{
puts -nonewline
"Sentinel
$id
"
set errcode
[
catch
{
set str
{}
append str
"@
[
SI $id tcp_port
]
: "
append str
"
[
join
[
S $id sentinel get-master-addr-by-name mymaster
]]
"
set str
}
retval
]
if
{
$errcode
}
{
puts
" --
$retval
"
}
else
{
puts $retval
}
}
}
elseif
{
$cmd
eq
{
help
}}
{
puts
"ls List Sentinel and Redis instances."
puts
"show-sentinel-logs
\[
N
\]
Show latest N lines of logs."
puts
"S <id> cmd ... arg Call command in Sentinel <id>."
puts
"R <id> cmd ... arg Call command in Redis <id>."
puts
"SI <id> <field> Show Sentinel <id> INFO <field>."
puts
"RI <id> <field> Show Sentinel <id> INFO <field>."
puts
"continue Resume test."
}
else
{
}
else
{
set errcode
[
catch
{
eval $line
}
retval
]
set errcode
[
catch
{
eval $line
}
retval
]
puts
"
$retval
"
if
{
$retval
ne
{}}
{
puts
"
$retval
"
}
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment