Skip to content

Commit

Permalink
Move HELLO tests to unit/protocol.tcl
Browse files Browse the repository at this point in the history
Signed-off-by: Rueian <rueiancsie@gmail.com>
  • Loading branch information
rueian committed Dec 27, 2024
1 parent f71b1bc commit 793f911
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 31 deletions.
26 changes: 26 additions & 0 deletions tests/unit/protocol.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,32 @@ start_server {tags {"protocol network"}} {

}

start_server {tags {"protocol hello"}} {
test {HELLO without protover} {
set reply [r HELLO 3]
assert_equal [dict get $reply proto] 3

set reply [r HELLO]
assert_equal [dict get $reply proto] 3

set reply [r HELLO 2]
assert_equal [dict get $reply proto] 2

set reply [r HELLO]
assert_equal [dict get $reply proto] 2
}

test {HELLO and availability-zone} {
r CONFIG SET availability-zone myzone

set reply [r HELLO 3]
assert_equal [dict get $reply availability_zone] myzone

set reply [r HELLO 2]
assert_equal [dict get $reply availability_zone] myzone
}
}

start_server {tags {"regression"}} {
test "Regression for a crash with blocking ops and pipelining" {
set rd [valkey_deferring_client]
Expand Down
31 changes: 0 additions & 31 deletions tests/unit/tracking.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -154,37 +154,6 @@ start_server {tags {"tracking network logreqres:skip"}} {
assert_equal [dict get $reply proto] 3
}

test {HELLO without protover} {
set reply [r HELLO 3]
assert_equal [dict get $reply proto] 3

set reply [r HELLO]
assert_equal [dict get $reply proto] 3

set reply [r HELLO 2]
assert_equal [dict get $reply proto] 2

set reply [r HELLO]
assert_equal [dict get $reply proto] 2

# restore RESP3 for next test
r HELLO 3
}

test {HELLO with availability-zone} {
r CONFIG SET availability-zone myzone

set reply [r HELLO 3]
assert_equal [dict get $reply availability_zone] myzone

set reply [r HELLO 2]
assert_equal [dict get $reply availability_zone] myzone

# restore for next test
r HELLO 3
r CONFIG SET availability-zone ""
}

test {RESP3 based basic invalidation} {
r CLIENT TRACKING off
r CLIENT TRACKING on
Expand Down

0 comments on commit 793f911

Please sign in to comment.