-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add replication test between old and new version
This includes a way to run two versions of the server from the TCL test framework. The runtest script accepts a new parameter --old-server-path path/to/valkey-server and a new tag "needs:old-server" for test cases and start_server. Includes an attempt to run it in CI as well. Signed-off-by: Viktor Söderqvist <[email protected]>
- Loading branch information
1 parent
66ae8b7
commit 8403010
Showing
4 changed files
with
80 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Test replication from an older version primary. | ||
# | ||
# Use minimal.conf to make sure we don't use any configs not supported on the old version. | ||
|
||
proc server_name_and_version {} { | ||
set server_name [s server_name] | ||
if {$server_name eq {}} { | ||
set server_name redis | ||
} | ||
set server_version [s "${server_name}_version"] | ||
return "$server_name $server_version" | ||
} | ||
|
||
start_server {tags {"repl needs:old-server external:skip"} start-old-server 1 config "minimal.conf"} { | ||
set primary_name_and_version [server_name_and_version] | ||
r set foo bar | ||
|
||
start_server {} { | ||
test "Start replication from $primary_name_and_version" { | ||
r replicaof [srv -1 host] [srv -1 port] | ||
wait_for_sync r | ||
# The key has been transferred. | ||
assert_equal bar [r get foo] | ||
assert_equal up [s master_link_status] | ||
} | ||
|
||
test "Replicate a SET command from $primary_name_and_version" { | ||
r -1 set baz quux | ||
wait_for_ofs_sync [srv 0 client] [srv -1 client] | ||
set reply [r get baz] | ||
assert_equal $reply quux | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters