Refactor some tests to reference new executable

This commit is contained in:
Madelyn Olson 2024-03-21 19:11:08 -07:00
parent 0aaae734f4
commit ee107481e5
5 changed files with 19 additions and 19 deletions

View File

@ -275,7 +275,7 @@ proc create_server_config_file {filename config config_lines} {
} }
proc spawn_server {config_file stdout stderr args} { proc spawn_server {config_file stdout stderr args} {
set cmd [list src/redis-server $config_file] set cmd [list src/placeholderkv-server $config_file]
set args {*}$args set args {*}$args
if {[llength $args] > 0} { if {[llength $args] > 0} {
lappend cmd {*}$args lappend cmd {*}$args

View File

@ -1143,7 +1143,7 @@ proc system_backtrace_supported {} {
# libmusl does not support backtrace. Also return 0 on # libmusl does not support backtrace. Also return 0 on
# static binaries (ldd exit code 1) where we can't detect libmusl # static binaries (ldd exit code 1) where we can't detect libmusl
catch { catch {
set ldd [exec ldd src/redis-server] set ldd [exec ldd src/placeholderkv-server]
if {![string match {*libc.*musl*} $ldd]} { if {![string match {*libc.*musl*} $ldd]} {
return 1 return 1
} }

View File

@ -1227,10 +1227,10 @@ start_server [list overrides [list "dir" $server_path "aclfile" "user.acl"] tags
} }
test {Test loading duplicate users in config on startup} { test {Test loading duplicate users in config on startup} {
catch {exec src/redis-server --user foo --user foo} err catch {exec src/placeholderkv-server --user foo --user foo} err
assert_match {*Duplicate user*} $err assert_match {*Duplicate user*} $err
catch {exec src/redis-server --user default --user default} err catch {exec src/placeholderkv-server --user default --user default} err
assert_match {*Duplicate user*} $err assert_match {*Duplicate user*} $err
} {} {external:skip} } {} {external:skip}
} }

View File

@ -708,44 +708,44 @@ start_server {tags {"introspection"}} {
test {redis-server command line arguments - error cases} { test {redis-server command line arguments - error cases} {
# Take '--invalid' as the option. # Take '--invalid' as the option.
catch {exec src/redis-server --invalid} err catch {exec src/placeholderkv-server --invalid} err
assert_match {*Bad directive or wrong number of arguments*} $err assert_match {*Bad directive or wrong number of arguments*} $err
catch {exec src/redis-server --port} err catch {exec src/placeholderkv-server --port} err
assert_match {*'port'*wrong number of arguments*} $err assert_match {*'port'*wrong number of arguments*} $err
catch {exec src/redis-server --port 6380 --loglevel} err catch {exec src/placeholderkv-server --port 6380 --loglevel} err
assert_match {*'loglevel'*wrong number of arguments*} $err assert_match {*'loglevel'*wrong number of arguments*} $err
# Take `6379` and `6380` as the port option value. # Take `6379` and `6380` as the port option value.
catch {exec src/redis-server --port 6379 6380} err catch {exec src/placeholderkv-server --port 6379 6380} err
assert_match {*'port "6379" "6380"'*wrong number of arguments*} $err assert_match {*'port "6379" "6380"'*wrong number of arguments*} $err
# Take `--loglevel` and `verbose` as the port option value. # Take `--loglevel` and `verbose` as the port option value.
catch {exec src/redis-server --port --loglevel verbose} err catch {exec src/placeholderkv-server --port --loglevel verbose} err
assert_match {*'port "--loglevel" "verbose"'*wrong number of arguments*} $err assert_match {*'port "--loglevel" "verbose"'*wrong number of arguments*} $err
# Take `--bla` as the port option value. # Take `--bla` as the port option value.
catch {exec src/redis-server --port --bla --loglevel verbose} err catch {exec src/placeholderkv-server --port --bla --loglevel verbose} err
assert_match {*'port "--bla"'*argument couldn't be parsed into an integer*} $err assert_match {*'port "--bla"'*argument couldn't be parsed into an integer*} $err
# Take `--bla` as the loglevel option value. # Take `--bla` as the loglevel option value.
catch {exec src/redis-server --logfile --my--log--file --loglevel --bla} err catch {exec src/placeholderkv-server --logfile --my--log--file --loglevel --bla} err
assert_match {*'loglevel "--bla"'*argument(s) must be one of the following*} $err assert_match {*'loglevel "--bla"'*argument(s) must be one of the following*} $err
# Using MULTI_ARG's own check, empty option value # Using MULTI_ARG's own check, empty option value
catch {exec src/redis-server --shutdown-on-sigint} err catch {exec src/placeholderkv-server --shutdown-on-sigint} err
assert_match {*'shutdown-on-sigint'*argument(s) must be one of the following*} $err assert_match {*'shutdown-on-sigint'*argument(s) must be one of the following*} $err
catch {exec src/redis-server --shutdown-on-sigint "now force" --shutdown-on-sigterm} err catch {exec src/placeholderkv-server --shutdown-on-sigint "now force" --shutdown-on-sigterm} err
assert_match {*'shutdown-on-sigterm'*argument(s) must be one of the following*} $err assert_match {*'shutdown-on-sigterm'*argument(s) must be one of the following*} $err
# Something like `redis-server --some-config --config-value1 --config-value2 --loglevel debug` would break, # Something like `redis-server --some-config --config-value1 --config-value2 --loglevel debug` would break,
# because if you want to pass a value to a config starting with `--`, it can only be a single value. # because if you want to pass a value to a config starting with `--`, it can only be a single value.
catch {exec src/redis-server --replicaof 127.0.0.1 abc} err catch {exec src/placeholderkv-server --replicaof 127.0.0.1 abc} err
assert_match {*'replicaof "127.0.0.1" "abc"'*Invalid master port*} $err assert_match {*'replicaof "127.0.0.1" "abc"'*Invalid master port*} $err
catch {exec src/redis-server --replicaof --127.0.0.1 abc} err catch {exec src/placeholderkv-server --replicaof --127.0.0.1 abc} err
assert_match {*'replicaof "--127.0.0.1" "abc"'*Invalid master port*} $err assert_match {*'replicaof "--127.0.0.1" "abc"'*Invalid master port*} $err
catch {exec src/redis-server --replicaof --127.0.0.1 --abc} err catch {exec src/placeholderkv-server --replicaof --127.0.0.1 --abc} err
assert_match {*'replicaof "--127.0.0.1"'*wrong number of arguments*} $err assert_match {*'replicaof "--127.0.0.1"'*wrong number of arguments*} $err
} {} {external:skip} } {} {external:skip}

View File

@ -221,15 +221,15 @@ start_server {tags {"modules"}} {
} }
test {startup moduleconfigs} { test {startup moduleconfigs} {
# No loadmodule directive # No loadmodule directive
catch {exec src/redis-server --moduleconfigs.string "hello"} err catch {exec src/placeholderkv-server --moduleconfigs.string "hello"} err
assert_match {*Module Configuration detected without loadmodule directive or no ApplyConfig call: aborting*} $err assert_match {*Module Configuration detected without loadmodule directive or no ApplyConfig call: aborting*} $err
# Bad config value # Bad config value
catch {exec src/redis-server --loadmodule "$testmodule" --moduleconfigs.string "rejectisfreed"} err catch {exec src/placeholderkv-server --loadmodule "$testmodule" --moduleconfigs.string "rejectisfreed"} err
assert_match {*Issue during loading of configuration moduleconfigs.string : Cannot set string to 'rejectisfreed'*} $err assert_match {*Issue during loading of configuration moduleconfigs.string : Cannot set string to 'rejectisfreed'*} $err
# missing LoadConfigs call # missing LoadConfigs call
catch {exec src/redis-server --loadmodule "$testmodule" noload --moduleconfigs.string "hello"} err catch {exec src/placeholderkv-server --loadmodule "$testmodule" noload --moduleconfigs.string "hello"} err
assert_match {*Module Configurations were not set, likely a missing LoadConfigs call. Unloading the module.*} $err assert_match {*Module Configurations were not set, likely a missing LoadConfigs call. Unloading the module.*} $err
# successful # successful