diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0bce623..8234675f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,13 +54,13 @@ jobs: if: matrix.platform == 'ubuntu-latest' timeout-minutes: 10 run: | - TLS_PROTOCOLS="tlsv1.2" TLS=1 ./tests/run_tests.sh + TLS_PROTOCOLS='TLSv1.2' VERBOSE=1 TLS=1 ./tests/run_tests.sh - name: Test OSS TCP TLS v1.3 if: matrix.platform == 'ubuntu-latest' timeout-minutes: 10 run: | - TLS_PROTOCOLS="tlsv1.3" TLS=1 ./tests/run_tests.sh + TLS_PROTOCOLS='TLSv1.3' VERBOSE=1 TLS=1 ./tests/run_tests.sh - name: Test OSS-CLUSTER TCP timeout-minutes: 10 diff --git a/memtier_benchmark.cpp b/memtier_benchmark.cpp index 136dda79..002af3cb 100755 --- a/memtier_benchmark.cpp +++ b/memtier_benchmark.cpp @@ -54,6 +54,7 @@ #endif +#include #include #include "client.h" @@ -896,9 +897,9 @@ static int config_parse_args(int argc, char *argv[], struct benchmark_config *cf break; case o_tls_protocols: { - const char tls_delimiter = ','; - char* tls_token = strtok(optarg, &tls_delimiter); - while (tls_token != 0) { + const char* tls_delimiter = ","; + char* tls_token = std::strtok(optarg, tls_delimiter); + while (tls_token != NULL) { if (!strcasecmp(tls_token, "tlsv1")) cfg->tls_protocols |= REDIS_TLS_PROTO_TLSv1; else if (!strcasecmp(tls_token, "tlsv1.1")) @@ -913,12 +914,12 @@ static int config_parse_args(int argc, char *argv[], struct benchmark_config *cf return -1; #endif } else { - fprintf(stderr, "Invalid tls-protocols specified. " - "Use a combination of 'TLSv1', 'TLSv1.1', 'TLSv1.2' and 'TLSv1.3'."); + fprintf(stderr, "Invalid tls-protocols specified %s. " + "Use a combination of 'TLSv1', 'TLSv1.1', 'TLSv1.2' and 'TLSv1.3'.", tls_token); return -1; break; } - tls_token = strtok(0, &tls_delimiter); + tls_token = std::strtok(NULL, tls_delimiter); } break; } diff --git a/tests/include.py b/tests/include.py index a010637c..1e32c45d 100644 --- a/tests/include.py +++ b/tests/include.py @@ -40,7 +40,6 @@ def assert_minimum_memtier_outcomes(config, env, memtier_ok, overall_expected_re def add_required_env_arguments(benchmark_specs, config, env, master_nodes_list): if VERBOSE: - import logging logging.basicConfig(level=logging.DEBUG) # if we've specified TLS_PROTOCOLS ensure we configure it on redis diff --git a/tests/tests_oss_simple_flow.py b/tests/tests_oss_simple_flow.py index fef399c5..8088456c 100644 --- a/tests/tests_oss_simple_flow.py +++ b/tests/tests_oss_simple_flow.py @@ -262,8 +262,10 @@ def test_default_set_get_3_runs(env): def test_default_arbitrary_command_pubsub(env): - benchmark_specs = {"name": env.testName, "args": ['--command=publish \"__key__\" \"__data__\"']} + benchmark_specs = {"name": env.testName, "args": []} addTLSArgs(benchmark_specs, env) + # on arbitrary command args should be the last one + benchmark_specs["args"].append('--command=publish \"__key__\" \"__data__\"') config = get_default_memtier_config() master_nodes_list = env.getMasterNodesList() @@ -282,8 +284,10 @@ def test_default_arbitrary_command_pubsub(env): def test_default_arbitrary_command_keyless(env): - benchmark_specs = {"name": env.testName, "args": ['--command=PING']} + benchmark_specs = {"name": env.testName, "args": []} addTLSArgs(benchmark_specs, env) + # on arbitrary command args should be the last one + benchmark_specs["args"].append('--command=PING') config = get_default_memtier_config() master_nodes_list = env.getMasterNodesList() @@ -302,8 +306,10 @@ def test_default_arbitrary_command_keyless(env): def test_default_arbitrary_command_set(env): - benchmark_specs = {"name": env.testName, "args": ['--command=SET __key__ __data__']} + benchmark_specs = {"name": env.testName, "args": []} addTLSArgs(benchmark_specs, env) + # on arbitrary command args should be the last one + benchmark_specs["args"].append('--command=SET __key__ __data__') config = get_default_memtier_config() master_nodes_list = env.getMasterNodesList() overall_expected_request_count = get_expected_request_count(config) @@ -328,8 +334,10 @@ def test_default_arbitrary_command_set(env): def test_default_arbitrary_command_hset(env): - benchmark_specs = {"name": env.testName, "args": ['--command=HSET __key__ field1 __data__']} + benchmark_specs = {"name": env.testName, "args": []} addTLSArgs(benchmark_specs, env) + # on arbitrary command args should be the last one + benchmark_specs["args"].append('--command=HSET __key__ field1 __data__') config = get_default_memtier_config() master_nodes_list = env.getMasterNodesList() overall_expected_request_count = get_expected_request_count(config) @@ -354,9 +362,11 @@ def test_default_arbitrary_command_hset(env): def test_default_arbitrary_command_hset_multi_data_placeholders(env): - benchmark_specs = {"name": env.testName, "args": ['--command=HSET __key__ field1 __data__ field2 __data__ field3 __data__']} + benchmark_specs = {"name": env.testName, "args": []} addTLSArgs(benchmark_specs, env) - memtier_config = get_default_memtier_config() + # on arbitrary command args should be the last one + benchmark_specs["args"].append('--command=HSET __key__ field1 __data__ field2 __data__ field3 __data__') + config = get_default_memtier_config() master_nodes_list = env.getMasterNodesList() overall_expected_request_count = get_expected_request_count(memtier_config) @@ -381,6 +391,7 @@ def test_default_arbitrary_command_hset_multi_data_placeholders(env): overall_request_count) def test_default_set_get_rate_limited(env): + env.skipOnCluster() master_nodes_list = env.getMasterNodesList() for client_count in [1,2,4]: for thread_count in [1,2]: