From 35864853559560b9144faf3202e97b35b11b14f1 Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Thu, 21 Mar 2024 19:16:03 -0700 Subject: [PATCH] Moved to correct cli and benchmark --- tests/cluster/tests/04-resharding.tcl | 2 +- .../cluster/tests/12-replica-migration-2.tcl | 4 +- .../tests/12.1-replica-migration-3.tcl | 2 +- tests/cluster/tests/includes/utils.tcl | 6 +-- tests/integration/aof-race.tcl | 2 +- tests/integration/psync2-reg.tcl | 2 +- tests/support/benchmark.tcl | 6 +-- tests/support/cli.tcl | 4 +- tests/unit/cluster/cli.tcl | 46 +++++++++---------- tests/unit/moduleapi/cluster.tcl | 8 ++-- 10 files changed, 41 insertions(+), 41 deletions(-) diff --git a/tests/cluster/tests/04-resharding.tcl b/tests/cluster/tests/04-resharding.tcl index 18a26bda63..3a08c70802 100644 --- a/tests/cluster/tests/04-resharding.tcl +++ b/tests/cluster/tests/04-resharding.tcl @@ -84,7 +84,7 @@ test "Cluster consistency during live resharding" { flush stdout set target [dict get [get_myself [randomInt 5]] id] set tribpid [lindex [exec \ - ../../../src/redis-cli --cluster reshard \ + ../../../src/placeholderkv-cli --cluster reshard \ 127.0.0.1:[get_instance_attrib redis 0 port] \ --cluster-from all \ --cluster-to $target \ diff --git a/tests/cluster/tests/12-replica-migration-2.tcl b/tests/cluster/tests/12-replica-migration-2.tcl index ed680061cc..b41edf9c83 100644 --- a/tests/cluster/tests/12-replica-migration-2.tcl +++ b/tests/cluster/tests/12-replica-migration-2.tcl @@ -38,7 +38,7 @@ test "Set allow-replica-migration yes" { set master0_id [dict get [get_myself 0] id] test "Resharding all the master #0 slots away from it" { set output [exec \ - ../../../src/redis-cli --cluster rebalance \ + ../../../src/placeholderkv-cli --cluster rebalance \ 127.0.0.1:[get_instance_attrib redis 0 port] \ {*}[rediscli_tls_config "../../../tests"] \ --cluster-weight ${master0_id}=0 >@ stdout ] @@ -59,7 +59,7 @@ test "Resharding back some slot to master #0" { # new resharding. after 10000 set output [exec \ - ../../../src/redis-cli --cluster rebalance \ + ../../../src/placeholderkv-cli --cluster rebalance \ 127.0.0.1:[get_instance_attrib redis 0 port] \ {*}[rediscli_tls_config "../../../tests"] \ --cluster-weight ${master0_id}=.01 \ diff --git a/tests/cluster/tests/12.1-replica-migration-3.tcl b/tests/cluster/tests/12.1-replica-migration-3.tcl index 790c73209c..9015062e8a 100644 --- a/tests/cluster/tests/12.1-replica-migration-3.tcl +++ b/tests/cluster/tests/12.1-replica-migration-3.tcl @@ -37,7 +37,7 @@ test "Set allow-replica-migration no" { set master0_id [dict get [get_myself 0] id] test "Resharding all the master #0 slots away from it" { set output [exec \ - ../../../src/redis-cli --cluster rebalance \ + ../../../src/placeholderkv-cli --cluster rebalance \ 127.0.0.1:[get_instance_attrib redis 0 port] \ {*}[rediscli_tls_config "../../../tests"] \ --cluster-weight ${master0_id}=0 >@ stdout ] diff --git a/tests/cluster/tests/includes/utils.tcl b/tests/cluster/tests/includes/utils.tcl index c1b0fe6b70..ee71a4747c 100644 --- a/tests/cluster/tests/includes/utils.tcl +++ b/tests/cluster/tests/includes/utils.tcl @@ -8,7 +8,7 @@ proc config_set_all_nodes {keyword value} { proc fix_cluster {addr} { set code [catch { - exec ../../../src/redis-cli {*}[rediscli_tls_config "../../../tests"] --cluster fix $addr << yes + exec ../../../src/placeholderkv-cli {*}[rediscli_tls_config "../../../tests"] --cluster fix $addr << yes } result] if {$code != 0} { puts "redis-cli --cluster fix returns non-zero exit code, output below:\n$result" @@ -17,7 +17,7 @@ proc fix_cluster {addr} { # but we can ignore that and rely on the check below. assert_cluster_state ok wait_for_condition 100 100 { - [catch {exec ../../../src/redis-cli {*}[rediscli_tls_config "../../../tests"] --cluster check $addr} result] == 0 + [catch {exec ../../../src/placeholderkv-cli {*}[rediscli_tls_config "../../../tests"] --cluster check $addr} result] == 0 } else { puts "redis-cli --cluster check returns non-zero exit code, output below:\n$result" fail "Cluster could not settle with configuration" @@ -26,7 +26,7 @@ proc fix_cluster {addr} { proc wait_cluster_stable {} { wait_for_condition 1000 50 { - [catch {exec ../../../src/redis-cli --cluster \ + [catch {exec ../../../src/placeholderkv-cli --cluster \ check 127.0.0.1:[get_instance_attrib redis 0 port] \ {*}[rediscli_tls_config "../../../tests"] \ }] == 0 diff --git a/tests/integration/aof-race.tcl b/tests/integration/aof-race.tcl index 839858b7b1..1220472c40 100644 --- a/tests/integration/aof-race.tcl +++ b/tests/integration/aof-race.tcl @@ -8,7 +8,7 @@ tags {"aof external:skip"} { # was subsequently appended to the new AOF, resulting in duplicate commands. start_server_aof [list dir $server_path] { set client [redis [srv host] [srv port] 0 $::tls] - set bench [open "|src/redis-benchmark -q -s [srv unixsocket] -c 20 -n 20000 incr foo" "r+"] + set bench [open "|src/placeholderkv-benchmark -q -s [srv unixsocket] -c 20 -n 20000 incr foo" "r+"] wait_for_condition 100 1 { [$client get foo] > 0 diff --git a/tests/integration/psync2-reg.tcl b/tests/integration/psync2-reg.tcl index b8dd101044..8317f1e365 100644 --- a/tests/integration/psync2-reg.tcl +++ b/tests/integration/psync2-reg.tcl @@ -40,7 +40,7 @@ start_server {} { } set cycle_start_time [clock milliseconds] - set bench_pid [exec src/redis-benchmark -s $R_unixsocket(0) -n 10000000 -r 1000 incr __rand_int__ > /dev/null &] + set bench_pid [exec src/placeholderkv-benchmark -s $R_unixsocket(0) -n 10000000 -r 1000 incr __rand_int__ > /dev/null &] while 1 { set elapsed [expr {[clock milliseconds]-$cycle_start_time}] if {$elapsed > $duration*1000} break diff --git a/tests/support/benchmark.tcl b/tests/support/benchmark.tcl index 156b20556e..3d49ee16f8 100644 --- a/tests/support/benchmark.tcl +++ b/tests/support/benchmark.tcl @@ -12,21 +12,21 @@ proc redisbenchmark_tls_config {testsdir} { } proc redisbenchmark {host port {opts {}}} { - set cmd [list src/redis-benchmark -h $host -p $port] + set cmd [list src/placeholderkv-benchmark -h $host -p $port] lappend cmd {*}[redisbenchmark_tls_config "tests"] lappend cmd {*}$opts return $cmd } proc redisbenchmarkuri {host port {opts {}}} { - set cmd [list src/redis-benchmark -u redis://$host:$port] + set cmd [list src/placeholderkv-benchmark -u redis://$host:$port] lappend cmd {*}[redisbenchmark_tls_config "tests"] lappend cmd {*}$opts return $cmd } proc redisbenchmarkuriuserpass {host port user pass {opts {}}} { - set cmd [list src/redis-benchmark -u redis://$user:$pass@$host:$port] + set cmd [list src/placeholderkv-benchmark -u redis://$user:$pass@$host:$port] lappend cmd {*}[redisbenchmark_tls_config "tests"] lappend cmd {*}$opts return $cmd diff --git a/tests/support/cli.tcl b/tests/support/cli.tcl index a080823eb7..a83ad43187 100644 --- a/tests/support/cli.tcl +++ b/tests/support/cli.tcl @@ -13,7 +13,7 @@ proc rediscli_tls_config {testsdir} { # Returns command line for executing redis-cli proc rediscli {host port {opts {}}} { - set cmd [list src/redis-cli -h $host -p $port] + set cmd [list src/placeholderkv-cli -h $host -p $port] lappend cmd {*}[rediscli_tls_config "tests"] lappend cmd {*}$opts return $cmd @@ -21,7 +21,7 @@ proc rediscli {host port {opts {}}} { # Returns command line for executing redis-cli with a unix socket address proc rediscli_unixsocket {unixsocket {opts {}}} { - return [list src/redis-cli -s $unixsocket {*}$opts] + return [list src/placeholderkv-cli -s $unixsocket {*}$opts] } # Run redis-cli with specified args on the server of specified level. diff --git a/tests/unit/cluster/cli.tcl b/tests/unit/cluster/cli.tcl index ce4629ec92..e96b3bcef0 100644 --- a/tests/unit/cluster/cli.tcl +++ b/tests/unit/cluster/cli.tcl @@ -20,7 +20,7 @@ start_multiple_servers 3 [list overrides $base_conf] { set node3_rd [redis_deferring_client -2] test {Create 3 node cluster} { - exec src/redis-cli --cluster-yes --cluster create \ + exec src/placeholderkv-cli --cluster-yes --cluster create \ 127.0.0.1:[srv 0 port] \ 127.0.0.1:[srv -1 port] \ 127.0.0.1:[srv -2 port] @@ -47,7 +47,7 @@ start_multiple_servers 3 [list overrides $base_conf] { } test "Perform a Resharding" { - exec src/redis-cli --cluster-yes --cluster reshard 127.0.0.1:[srv -2 port] \ + exec src/placeholderkv-cli --cluster-yes --cluster reshard 127.0.0.1:[srv -2 port] \ --cluster-to [$node1 cluster myid] \ --cluster-from [$node3 cluster myid] \ --cluster-slots 1 @@ -68,9 +68,9 @@ start_multiple_servers 3 [list overrides $base_conf] { # waiting for cluster_state to be okay is an independent check that all the # nodes actually believe each other are healthy, prevent cluster down error. wait_for_condition 1000 50 { - [catch {exec src/redis-cli --cluster check 127.0.0.1:[srv 0 port]}] == 0 && - [catch {exec src/redis-cli --cluster check 127.0.0.1:[srv -1 port]}] == 0 && - [catch {exec src/redis-cli --cluster check 127.0.0.1:[srv -2 port]}] == 0 && + [catch {exec src/placeholderkv-cli --cluster check 127.0.0.1:[srv 0 port]}] == 0 && + [catch {exec src/placeholderkv-cli --cluster check 127.0.0.1:[srv -1 port]}] == 0 && + [catch {exec src/placeholderkv-cli --cluster check 127.0.0.1:[srv -2 port]}] == 0 && [CI 0 cluster_state] eq {ok} && [CI 1 cluster_state] eq {ok} && [CI 2 cluster_state] eq {ok} @@ -92,8 +92,8 @@ start_multiple_servers 3 [list overrides $base_conf] { assert_error "*MOVED $slot_for_foo :*" {$node1 set foo bar} # when in cluster mode, redirect using previous hostip - assert_equal "[exec src/redis-cli -h 127.0.0.1 -p [srv 0 port] -c set foo bar]" {OK} - assert_match "[exec src/redis-cli -h 127.0.0.1 -p [srv 0 port] -c get foo]" {bar} + assert_equal "[exec src/placeholderkv-cli -h 127.0.0.1 -p [srv 0 port] -c set foo bar]" {OK} + assert_match "[exec src/placeholderkv-cli -h 127.0.0.1 -p [srv 0 port] -c get foo]" {bar} assert_equal [$node1 CONFIG SET cluster-preferred-endpoint-type "$endpoint_type_before_set"] {OK} } @@ -164,7 +164,7 @@ start_multiple_servers 5 [list overrides $base_conf] { set node5_rd [redis_client -4] test {Functions are added to new node on redis-cli cluster add-node} { - exec src/redis-cli --cluster-yes --cluster create \ + exec src/placeholderkv-cli --cluster-yes --cluster create \ 127.0.0.1:[srv 0 port] \ 127.0.0.1:[srv -1 port] \ 127.0.0.1:[srv -2 port] @@ -179,13 +179,13 @@ start_multiple_servers 5 [list overrides $base_conf] { } # upload a function to all the cluster - exec src/redis-cli --cluster-yes --cluster call 127.0.0.1:[srv 0 port] \ + exec src/placeholderkv-cli --cluster-yes --cluster call 127.0.0.1:[srv 0 port] \ FUNCTION LOAD {#!lua name=TEST redis.register_function('test', function() return 'hello' end) } # adding node to the cluster - exec src/redis-cli --cluster-yes --cluster add-node \ + exec src/placeholderkv-cli --cluster-yes --cluster add-node \ 127.0.0.1:[srv -3 port] \ 127.0.0.1:[srv 0 port] @@ -213,7 +213,7 @@ start_multiple_servers 5 [list overrides $base_conf] { # adding node 5 to the cluster should failed because it already contains the 'test' function catch { - exec src/redis-cli --cluster-yes --cluster add-node \ + exec src/placeholderkv-cli --cluster-yes --cluster add-node \ 127.0.0.1:[srv -4 port] \ 127.0.0.1:[srv 0 port] } e @@ -227,7 +227,7 @@ test {Migrate the last slot away from a node using redis-cli} { start_multiple_servers 4 [list overrides $base_conf] { # Create a cluster of 3 nodes - exec src/redis-cli --cluster-yes --cluster create \ + exec src/placeholderkv-cli --cluster-yes --cluster create \ 127.0.0.1:[srv 0 port] \ 127.0.0.1:[srv -1 port] \ 127.0.0.1:[srv -2 port] @@ -241,11 +241,11 @@ test {Migrate the last slot away from a node using redis-cli} { } # Insert some data - assert_equal OK [exec src/redis-cli -c -p [srv 0 port] SET foo bar] - set slot [exec src/redis-cli -c -p [srv 0 port] CLUSTER KEYSLOT foo] + assert_equal OK [exec src/placeholderkv-cli -c -p [srv 0 port] SET foo bar] + set slot [exec src/placeholderkv-cli -c -p [srv 0 port] CLUSTER KEYSLOT foo] # Add new node to the cluster - exec src/redis-cli --cluster-yes --cluster add-node \ + exec src/placeholderkv-cli --cluster-yes --cluster add-node \ 127.0.0.1:[srv -3 port] \ 127.0.0.1:[srv 0 port] @@ -283,10 +283,10 @@ test {Migrate the last slot away from a node using redis-cli} { # Using --cluster check make sure we won't get `Not all slots are covered by nodes`. # Wait for the cluster to become stable make sure the cluster is up during MIGRATE. wait_for_condition 1000 50 { - [catch {exec src/redis-cli --cluster check 127.0.0.1:[srv 0 port]}] == 0 && - [catch {exec src/redis-cli --cluster check 127.0.0.1:[srv -1 port]}] == 0 && - [catch {exec src/redis-cli --cluster check 127.0.0.1:[srv -2 port]}] == 0 && - [catch {exec src/redis-cli --cluster check 127.0.0.1:[srv -3 port]}] == 0 && + [catch {exec src/placeholderkv-cli --cluster check 127.0.0.1:[srv 0 port]}] == 0 && + [catch {exec src/placeholderkv-cli --cluster check 127.0.0.1:[srv -1 port]}] == 0 && + [catch {exec src/placeholderkv-cli --cluster check 127.0.0.1:[srv -2 port]}] == 0 && + [catch {exec src/placeholderkv-cli --cluster check 127.0.0.1:[srv -3 port]}] == 0 && [CI 0 cluster_state] eq {ok} && [CI 1 cluster_state] eq {ok} && [CI 2 cluster_state] eq {ok} && @@ -296,7 +296,7 @@ test {Migrate the last slot away from a node using redis-cli} { } # Move the only slot back to original node using redis-cli - exec src/redis-cli --cluster reshard 127.0.0.1:[srv -3 port] \ + exec src/placeholderkv-cli --cluster reshard 127.0.0.1:[srv -3 port] \ --cluster-from $newnode_id \ --cluster-to $owner_id \ --cluster-slots 1 \ @@ -341,7 +341,7 @@ start_server [list overrides [list cluster-enabled yes cluster-node-timeout 1 cl # The last two are used to test --cluster add-node test "redis-cli -4 --cluster create using $ip_or_localhost with cluster-port" { - exec src/redis-cli -4 --cluster-yes --cluster create \ + exec src/placeholderkv-cli -4 --cluster-yes --cluster create \ $ip_or_localhost:[srv 0 port] \ $ip_or_localhost:[srv -1 port] \ $ip_or_localhost:[srv -2 port] @@ -362,7 +362,7 @@ start_server [list overrides [list cluster-enabled yes cluster-node-timeout 1 cl test "redis-cli -4 --cluster add-node using $ip_or_localhost with cluster-port" { # Adding node to the cluster (without cluster-port) - exec src/redis-cli -4 --cluster-yes --cluster add-node \ + exec src/placeholderkv-cli -4 --cluster-yes --cluster add-node \ $ip_or_localhost:[srv -3 port] \ $ip_or_localhost:[srv 0 port] @@ -378,7 +378,7 @@ start_server [list overrides [list cluster-enabled yes cluster-node-timeout 1 cl } # Adding node to the cluster (with cluster-port) - exec src/redis-cli -4 --cluster-yes --cluster add-node \ + exec src/placeholderkv-cli -4 --cluster-yes --cluster add-node \ $ip_or_localhost:[srv -4 port] \ $ip_or_localhost:[srv 0 port] diff --git a/tests/unit/moduleapi/cluster.tcl b/tests/unit/moduleapi/cluster.tcl index cddd90f759..1d1b2df799 100644 --- a/tests/unit/moduleapi/cluster.tcl +++ b/tests/unit/moduleapi/cluster.tcl @@ -43,7 +43,7 @@ start_cluster 3 0 [list config_lines $modules] { test "Perform a Resharding" { - exec src/redis-cli --cluster-yes --cluster reshard 127.0.0.1:[srv -2 port] \ + exec src/placeholderkv-cli --cluster-yes --cluster reshard 127.0.0.1:[srv -2 port] \ --cluster-to [$node1 cluster myid] \ --cluster-from [$node3 cluster myid] \ --cluster-slots 1 @@ -69,9 +69,9 @@ start_cluster 3 0 [list config_lines $modules] { test "Wait for cluster to be stable" { wait_for_condition 1000 50 { - [catch {exec src/redis-cli --cluster check 127.0.0.1:[srv 0 port]}] == 0 && - [catch {exec src/redis-cli --cluster check 127.0.0.1:[srv -1 port]}] == 0 && - [catch {exec src/redis-cli --cluster check 127.0.0.1:[srv -2 port]}] == 0 && + [catch {exec src/placeholderkv-cli --cluster check 127.0.0.1:[srv 0 port]}] == 0 && + [catch {exec src/placeholderkv-cli --cluster check 127.0.0.1:[srv -1 port]}] == 0 && + [catch {exec src/placeholderkv-cli --cluster check 127.0.0.1:[srv -2 port]}] == 0 && [CI 0 cluster_state] eq {ok} && [CI 1 cluster_state] eq {ok} && [CI 2 cluster_state] eq {ok}