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
22ae0ddf
Unverified
Commit
22ae0ddf
authored
Mar 13, 2020
by
Salvatore Sanfilippo
Committed by
GitHub
Mar 13, 2020
Browse files
Merge pull request #6974 from yangbodong22011/fix-tcl-test-host-option
Fix bug of tcl test using external server
parents
b1db7acf
336458d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/support/server.tcl
View file @
22ae0ddf
...
@@ -159,9 +159,12 @@ proc start_server {options {code undefined}} {
...
@@ -159,9 +159,12 @@ proc start_server {options {code undefined}} {
if
{
$::external
}
{
if
{
$::external
}
{
if
{[
llength $::servers
]
== 0
}
{
if
{[
llength $::servers
]
== 0
}
{
set srv
{}
set srv
{}
# In test_server_main
(
tests/test_helper.tcl:215~218
)
, increase the value of start_port
# and assign it to ::port through the `--port` option, so we need to reduce it.
set baseport
[
expr
{
$::port-100
}]
dict set srv
"host"
$::host
dict set srv
"host"
$::host
dict set srv
"port"
$
::
port
dict set srv
"port"
$
base
port
set client
[
redis $::host $
::
port 0 $::tls
]
set client
[
redis $::host $
base
port 0 $::tls
]
dict set srv
"client"
$client
dict set srv
"client"
$client
$client select 9
$client select 9
...
...
tests/test_helper.tcl
View file @
22ae0ddf
...
@@ -505,6 +505,9 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
...
@@ -505,6 +505,9 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
}
elseif
{
$opt
eq
{
--host
}}
{
}
elseif
{
$opt
eq
{
--host
}}
{
set ::external 1
set ::external 1
set ::host $arg
set ::host $arg
# If we use an external server, we can only set numclients to 1,
# otherwise the port will be miscalculated.
set ::numclients 1
incr j
incr j
}
elseif
{
$opt
eq
{
--port
}}
{
}
elseif
{
$opt
eq
{
--port
}}
{
set ::port $arg
set ::port $arg
...
...
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