From 7c54740c9a405d28cabb8032d1f6999ddbe89c89 Mon Sep 17 00:00:00 2001 From: filipecosta90 Date: Sat, 18 Nov 2023 14:56:49 +0000 Subject: [PATCH] Fixed tls arg tests --- .github/workflows/ci.yml | 4 ++-- memtier_benchmark.cpp | 4 ++-- tests/tests_oss_simple_flow.py | 22 ++++++++++++++++------ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0bce623..95d9b1b2 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' 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' 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 26e585cf..315af342 100755 --- a/memtier_benchmark.cpp +++ b/memtier_benchmark.cpp @@ -913,8 +913,8 @@ 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; } diff --git a/tests/tests_oss_simple_flow.py b/tests/tests_oss_simple_flow.py index f0743acd..6fb0c726 100644 --- a/tests/tests_oss_simple_flow.py +++ b/tests/tests_oss_simple_flow.py @@ -261,8 +261,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() @@ -281,8 +283,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() @@ -301,8 +305,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) @@ -327,8 +333,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) @@ -353,9 +361,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) - 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__') + memtier_config = get_default_memtier_config() master_nodes_list = env.getMasterNodesList() overall_expected_request_count = get_expected_request_count(config)